diff --git a/docs/3rdpartylicenses.txt b/docs/3rdpartylicenses.txt old mode 100755 new mode 100644 diff --git a/docs/index.html b/docs/index.html old mode 100755 new mode 100644 index 840e985..ff5581d --- a/docs/index.html +++ b/docs/index.html @@ -35,8 +35,8 @@ - + - + diff --git a/docs/main.df599edf9d6e5423.js b/docs/main.913f78f27803a5f6.js old mode 100755 new mode 100644 similarity index 84% rename from docs/main.df599edf9d6e5423.js rename to docs/main.913f78f27803a5f6.js index 103e4be..5b7d084 --- a/docs/main.df599edf9d6e5423.js +++ b/docs/main.913f78f27803a5f6.js @@ -1 +1 @@ -"use strict";(self.webpackChunkomeglestr=self.webpackChunkomeglestr||[]).push([[792],{45:(zp,Sb,pc)=>{var gc={};pc.r(gc),pc.d(gc,{OG:()=>o0,My:()=>Da,Ph:()=>wn,lX:()=>r0,Id:()=>Gs,fg:()=>NA,qj:()=>Zt,aT:()=>Ca,lq:()=>Yi,z:()=>s0,Q5:()=>Bl});var qp={};function Ib(e,t,r,i,s,o,a){try{var c=e[o](a),l=c.value}catch(u){return void r(u)}c.done?t(l):Promise.resolve(l).then(i,s)}function $(e){return function(){var t=this,r=arguments;return new Promise(function(i,s){var o=e.apply(t,r);function a(l){Ib(o,i,s,a,c,"next",l)}function c(l){Ib(o,i,s,a,c,"throw",l)}a(void 0)})}}pc.r(qp),pc.d(qp,{aK:()=>ro,e8:()=>Ua,DO:()=>Xl,dJ:()=>zN,OG:()=>Tw,My:()=>ja,Ph:()=>no,lX:()=>Cw,Id:()=>eu,fg:()=>GN,qj:()=>gr,aT:()=>Va,r4:()=>Wh,aY:()=>to,x:()=>Aw,lq:()=>Ha,z:()=>Sw,zW:()=>$a,Q5:()=>tu});let wt=null,mc=!1,Hu=1;const Er=Symbol("SIGNAL");function me(e){const t=wt;return wt=e,t}const Tb={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Gp(e){if(mc)throw new Error("");if(null===wt)return;wt.consumerOnSignalRead(e);const t=wt.nextProducerIndex++;mo(wt),t0}function mo(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function Lb(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}let Fb=function fk(){throw new Error};function Bb(){Fb()}let Zp=null;function Ub(e,t){Mb()||Bb(),e.equal(e.value,t)||(e.value=t,function yk(e){e.version++,function lk(){Hu++}(),Ab(e),Zp?.()}(e))}const mk={...Tb,equal:function ok(e,t){return Object.is(e,t)},value:void 0};function nt(e){return"function"==typeof e}function qu(e){const r=e(i=>{Error.call(i),i.stack=(new Error).stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}const Kp=qu(e=>function(r){e(this),this.message=r?`${r.length} errors occurred during unsubscription:\n${r.map((i,s)=>`${s+1}) ${i.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=r});function Gu(e,t){if(e){const r=e.indexOf(t);0<=r&&e.splice(r,1)}}class Rt{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(const o of r)o.remove(this);else r.remove(this);const{initialTeardown:i}=this;if(nt(i))try{i()}catch(o){t=o instanceof Kp?o.errors:[o]}const{_finalizers:s}=this;if(s){this._finalizers=null;for(const o of s)try{Hb(o)}catch(a){t=t??[],a instanceof Kp?t=[...t,...a.errors]:t.push(a)}}if(t)throw new Kp(t)}}add(t){var r;if(t&&t!==this)if(this.closed)Hb(t);else{if(t instanceof Rt){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}}_hasParent(t){const{_parentage:r}=this;return r===t||Array.isArray(r)&&r.includes(t)}_addParent(t){const{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t}_removeParent(t){const{_parentage:r}=this;r===t?this._parentage=null:Array.isArray(r)&&Gu(r,t)}remove(t){const{_finalizers:r}=this;r&&Gu(r,t),t instanceof Rt&&t._removeParent(this)}}Rt.EMPTY=(()=>{const e=new Rt;return e.closed=!0,e})();const $b=Rt.EMPTY;function Vb(e){return e instanceof Rt||e&&"closed"in e&&nt(e.remove)&&nt(e.add)&&nt(e.unsubscribe)}function Hb(e){nt(e)?e():e.unsubscribe()}const Es={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Wu={setTimeout(e,t,...r){const{delegate:i}=Wu;return i?.setTimeout?i.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){const{delegate:t}=Wu;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function zb(e){Wu.setTimeout(()=>{const{onUnhandledError:t}=Es;if(!t)throw e;t(e)})}function Qp(){}const wk=Yp("C",void 0,void 0);function Yp(e,t,r){return{kind:e,value:t,error:r}}let Ds=null;function Zu(e){if(Es.useDeprecatedSynchronousErrorHandling){const t=!Ds;if(t&&(Ds={errorThrown:!1,error:null}),e(),t){const{errorThrown:r,error:i}=Ds;if(Ds=null,r)throw i}}else e()}class Jp extends Rt{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,Vb(t)&&t.add(this)):this.destination=Ik}static create(t,r,i){return new eg(t,r,i)}next(t){this.isStopped?tg(function bk(e){return Yp("N",e,void 0)}(t),this):this._next(t)}error(t){this.isStopped?tg(function _k(e){return Yp("E",void 0,e)}(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?tg(wk,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const Dk=Function.prototype.bind;function Xp(e,t){return Dk.call(e,t)}class Ck{constructor(t){this.partialObserver=t}next(t){const{partialObserver:r}=this;if(r.next)try{r.next(t)}catch(i){Ku(i)}}error(t){const{partialObserver:r}=this;if(r.error)try{r.error(t)}catch(i){Ku(i)}else Ku(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(r){Ku(r)}}}class eg extends Jp{constructor(t,r,i){let s;if(super(),nt(t)||!t)s={next:t??void 0,error:r??void 0,complete:i??void 0};else{let o;this&&Es.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=()=>this.unsubscribe(),s={next:t.next&&Xp(t.next,o),error:t.error&&Xp(t.error,o),complete:t.complete&&Xp(t.complete,o)}):s=t}this.destination=new Ck(s)}}function Ku(e){Es.useDeprecatedSynchronousErrorHandling?function Ek(e){Es.useDeprecatedSynchronousErrorHandling&&Ds&&(Ds.errorThrown=!0,Ds.error=e)}(e):zb(e)}function tg(e,t){const{onStoppedNotification:r}=Es;r&&Wu.setTimeout(()=>r(e,t))}const Ik={closed:!0,next:Qp,error:function Sk(e){throw e},complete:Qp},ng="function"==typeof Symbol&&Symbol.observable||"@@observable";function Cs(e){return e}function qb(e){return 0===e.length?Cs:1===e.length?e[0]:function(r){return e.reduce((i,s)=>s(i),r)}}let Ot=(()=>{class e{constructor(r){r&&(this._subscribe=r)}lift(r){const i=new e;return i.source=this,i.operator=r,i}subscribe(r,i,s){const o=function Ak(e){return e&&e instanceof Jp||function xk(e){return e&&nt(e.next)&&nt(e.error)&&nt(e.complete)}(e)&&Vb(e)}(r)?r:new eg(r,i,s);return Zu(()=>{const{operator:a,source:c}=this;o.add(a?a.call(o,c):c?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(r){try{return this._subscribe(r)}catch(i){r.error(i)}}forEach(r,i){return new(i=Gb(i))((s,o)=>{const a=new eg({next:c=>{try{r(c)}catch(l){o(l),a.unsubscribe()}},error:o,complete:s});this.subscribe(a)})}_subscribe(r){var i;return null===(i=this.source)||void 0===i?void 0:i.subscribe(r)}[ng](){return this}pipe(...r){return qb(r)(this)}toPromise(r){return new(r=Gb(r))((i,s)=>{let o;this.subscribe(a=>o=a,a=>s(a),()=>i(o))})}}return e.create=t=>new e(t),e})();function Gb(e){var t;return null!==(t=e??Es.Promise)&&void 0!==t?t:Promise}const Mk=qu(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let ot=(()=>{class e extends Ot{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){const i=new Wb(this,this);return i.operator=r,i}_throwIfClosed(){if(this.closed)throw new Mk}next(r){Zu(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(r)}})}error(r){Zu(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;const{observers:i}=this;for(;i.length;)i.shift().error(r)}})}complete(){Zu(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return(null===(r=this.observers)||void 0===r?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){const{hasError:i,isStopped:s,observers:o}=this;return i||s?$b:(this.currentObservers=null,o.push(r),new Rt(()=>{this.currentObservers=null,Gu(o,r)}))}_checkFinalizedStatuses(r){const{hasError:i,thrownError:s,isStopped:o}=this;i?r.error(s):o&&r.complete()}asObservable(){const r=new Ot;return r.source=this,r}}return e.create=(t,r)=>new Wb(t,r),e})();class Wb extends ot{constructor(t,r){super(),this.destination=t,this.source=r}next(t){var r,i;null===(i=null===(r=this.destination)||void 0===r?void 0:r.next)||void 0===i||i.call(r,t)}error(t){var r,i;null===(i=null===(r=this.destination)||void 0===r?void 0:r.error)||void 0===i||i.call(r,t)}complete(){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===r||r.call(t)}_subscribe(t){var r,i;return null!==(i=null===(r=this.source)||void 0===r?void 0:r.subscribe(t))&&void 0!==i?i:$b}}class jn extends ot{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const r=super._subscribe(t);return!r.closed&&t.next(this._value),r}getValue(){const{hasError:t,thrownError:r,_value:i}=this;if(t)throw r;return this._throwIfClosed(),i}next(t){super.next(this._value=t)}}function Zb(e){return nt(e?.lift)}function Nt(e){return t=>{if(Zb(t))return t.lift(function(r){try{return e(r,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function _t(e,t,r,i,s){return new Nk(e,t,r,i,s)}class Nk extends Jp{constructor(t,r,i,s,o,a){super(t),this.onFinalize=o,this.shouldUnsubscribe=a,this._next=r?function(c){try{r(c)}catch(l){t.error(l)}}:super._next,this._error=s?function(c){try{s(c)}catch(l){t.error(l)}finally{this.unsubscribe()}}:super._error,this._complete=i?function(){try{i()}catch(c){t.error(c)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:r}=this;super.unsubscribe(),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}}}function Ue(e,t){return Nt((r,i)=>{let s=0;r.subscribe(_t(i,o=>{i.next(e.call(t,o,s++))}))})}const Kb="https://g.co/ng/security#xss";class M extends Error{constructor(t,r){super(function yo(e,t){return`NG0${Math.abs(e)}${t?": "+t:""}`}(t,r)),this.code=t}}function ii(e){return{toString:e}.toString()}const wo="__parameters__";function bo(e,t,r){return ii(()=>{const i=function rg(e){return function(...r){if(e){const i=e(...r);for(const s in i)this[s]=i[s]}}}(t);function s(...o){if(this instanceof s)return i.apply(this,o),this;const a=new s(...o);return c.annotation=a,c;function c(l,u,d){const f=l.hasOwnProperty(wo)?l[wo]:Object.defineProperty(l,wo,{value:[]})[wo];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(a),l}}return r&&(s.prototype=Object.create(r.prototype)),s.prototype.ngMetadataName=e,s.annotationCls=s,s})}const Pe=globalThis;function Fe(e){for(let t in e)if(e[t]===Fe)return t;throw Error("Could not find renamed property on target object.")}function bt(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(bt).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const r=t.indexOf("\n");return-1===r?t:t.substring(0,r)}function ig(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const Ok=Fe({__forward_ref__:Fe});function sg(e){return e.__forward_ref__=sg,e.toString=function(){return bt(this())},e}function re(e){return Yu(e)?e():e}function Yu(e){return"function"==typeof e&&e.hasOwnProperty(Ok)&&e.__forward_ref__===sg}function z(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Jt(e){return{providers:e.providers||[],imports:e.imports||[]}}function Ju(e){return Xb(e,ed)||Xb(e,eE)}function Xb(e,t){return e.hasOwnProperty(t)?e[t]:null}function Xu(e){return e&&(e.hasOwnProperty(og)||e.hasOwnProperty(Uk))?e[og]:null}const ed=Fe({\u0275prov:Fe}),og=Fe({\u0275inj:Fe}),eE=Fe({ngInjectableDef:Fe}),Uk=Fe({ngInjectorDef:Fe});class K{constructor(t,r){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof r?this.__NG_ELEMENT_ID__=r:void 0!==r&&(this.\u0275prov=z({token:this,providedIn:r.providedIn||"root",factory:r.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function dg(e){return e&&!!e.\u0275providers}const vc=Fe({\u0275cmp:Fe}),fg=Fe({\u0275dir:Fe}),hg=Fe({\u0275pipe:Fe}),nE=Fe({\u0275mod:Fe}),si=Fe({\u0275fac:Fe}),wc=Fe({__NG_ELEMENT_ID__:Fe}),rE=Fe({__NG_ENV_ID__:Fe});function de(e){return"string"==typeof e?e:null==e?"":String(e)}function pg(e,t){throw new M(-201,!1)}var Ee=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}(Ee||{});let gg;function iE(){return gg}function fn(e){const t=gg;return gg=e,t}function sE(e,t,r){const i=Ju(e);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:r&Ee.Optional?null:void 0!==t?t:void pg()}const _c={},mg="__NG_DI_FLAG__",td="ngTempTokenPath",qk=/\n/gm,oE="__source";let Eo;function Bi(e){const t=Eo;return Eo=e,t}function Zk(e,t=Ee.Default){if(void 0===Eo)throw new M(-203,!1);return null===Eo?sE(e,void 0,t):Eo.get(e,t&Ee.Optional?null:void 0,t)}function G(e,t=Ee.Default){return(iE()||Zk)(re(e),t)}function P(e,t=Ee.Default){return G(e,nd(t))}function nd(e){return typeof e>"u"||"number"==typeof e?e:(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function yg(e){const t=[];for(let r=0;rArray.isArray(r)?Do(r,t):t(r))}function cE(e,t,r){t>=e.length?e.push(r):e.splice(t,0,r)}function sd(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function Tn(e,t,r){let i=Co(e,t);return i>=0?e[1|i]=r:(i=~i,function lE(e,t,r,i){let s=e.length;if(s==t)e.push(r,i);else if(1===s)e.push(i,e[0]),e[0]=r;else{for(s--,e.push(e[s-1],e[s]);s>t;)e[s]=e[s-2],s--;e[t]=r,e[t+1]=i}}(e,i,t,r)),i}function wg(e,t){const r=Co(e,t);if(r>=0)return e[1|r]}function Co(e,t){return function uE(e,t,r){let i=0,s=e.length>>r;for(;s!==i;){const o=i+(s-i>>1),a=e[o<t?s=o:i=o+1}return~(s<t){a=o-1;break}}}for(;o-1){let o;for(;++so?"":s[d+1].toLowerCase(),2&i&&u!==f){if(er(i))return!1;a=!0}}}}else{if(!a&&!er(i)&&!er(l))return!1;if(a&&er(l))continue;a=!1,i=l|1&i}}return er(i)||a}function er(e){return!(1&e)}function oP(e,t,r,i){if(null===t)return-1;let s=0;if(i||!r){let o=!1;for(;s-1)for(r++;r0?'="'+c+'"':"")+"]"}else 8&i?s+="."+a:4&i&&(s+=" "+a);else""!==s&&!er(a)&&(t+=yE(o,s),s=""),i=a,o=o||!er(i);r++}return""!==s&&(t+=yE(o,s)),t}function So(e){return ii(()=>{const t=wE(e),r={...t,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection===cd.OnPush,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||Jn.Emulated,styles:e.styles||Me,_:null,schemas:e.schemas||null,tView:null,id:""};_E(r);const i=e.dependencies;return r.directiveDefs=ld(i,!1),r.pipeDefs=ld(i,!0),r.id=function yP(e){let t=0;const r=[e.selectors,e.ngContentSelectors,e.hostVars,e.hostAttrs,e.consts,e.vars,e.decls,e.encapsulation,e.standalone,e.signals,e.exportAs,JSON.stringify(e.inputs),JSON.stringify(e.outputs),Object.getOwnPropertyNames(e.type.prototype),!!e.contentQueries,!!e.viewQuery].join("|");for(const s of r)t=Math.imul(31,t)+s.charCodeAt(0)|0;return t+=2147483648,"c"+t}(r),r})}function pP(e){return we(e)||Et(e)}function gP(e){return null!==e}function pn(e){return ii(()=>({type:e.type,bootstrap:e.bootstrap||Me,declarations:e.declarations||Me,imports:e.imports||Me,exports:e.exports||Me,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function vE(e,t){if(null==e)return Dr;const r={};for(const i in e)if(e.hasOwnProperty(i)){const s=e[i];let o,a,c=Xn.None;Array.isArray(s)?(c=s[0],o=s[1],a=s[2]??o):(o=s,a=s),t?(r[o]=c!==Xn.None?[i,c]:i,t[o]=a):r[o]=i}return r}function Xt(e){return ii(()=>{const t=wE(e);return _E(t),t})}function en(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,standalone:!0===e.standalone,onDestroy:e.type.prototype.ngOnDestroy||null}}function we(e){return e[vc]||null}function Et(e){return e[fg]||null}function kt(e){return e[hg]||null}function jt(e,t){const r=e[nE]||null;if(!r&&!0===t)throw new Error(`Type ${bt(e)} does not have '\u0275mod' property.`);return r}function wE(e){const t={};return{type:e.type,providersResolver:null,factory:null,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputTransforms:null,inputConfig:e.inputs||Dr,exportAs:e.exportAs||null,standalone:!0===e.standalone,signals:!0===e.signals,selectors:e.selectors||Me,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:vE(e.inputs,t),outputs:vE(e.outputs),debugInfo:null}}function _E(e){e.features?.forEach(t=>t(e))}function ld(e,t){if(!e)return null;const r=t?kt:pP;return()=>("function"==typeof e?e():e).map(i=>r(i)).filter(gP)}function vP(...e){return{\u0275providers:Dg(0,e),\u0275fromNgModule:!0}}function Dg(e,...t){const r=[],i=new Set;let s;const o=a=>{r.push(a)};return Do(t,a=>{const c=a;ud(c,o,[],i)&&(s||=[],s.push(c))}),void 0!==s&&bE(s,o),r}function bE(e,t){for(let r=0;r{t(o,i)})}}function ud(e,t,r,i){if(!(e=re(e)))return!1;let s=null,o=Xu(e);const a=!o&&we(e);if(o||a){if(a&&!a.standalone)return!1;s=e}else{const l=e.ngModule;if(o=Xu(l),!o)return!1;s=l}const c=i.has(s);if(a){if(c)return!1;if(i.add(s),a.dependencies){const l="function"==typeof a.dependencies?a.dependencies():a.dependencies;for(const u of l)ud(u,t,r,i)}}else{if(!o)return!1;{if(null!=o.imports&&!c){let u;i.add(s);try{Do(o.imports,d=>{ud(d,t,r,i)&&(u||=[],u.push(d))})}finally{}void 0!==u&&bE(u,t)}if(!c){const u=Ss(s)||(()=>new s);t({provide:s,useFactory:u,deps:Me},s),t({provide:_g,useValue:s,multi:!0},s),t({provide:Is,useValue:()=>G(s),multi:!0},s)}const l=o.providers;if(null!=l&&!c){const u=e;Cg(l,d=>{t(d,u)})}}}return s!==e&&void 0!==e.providers}function Cg(e,t){for(let r of e)dg(r)&&(r=r.\u0275providers),Array.isArray(r)?Cg(r,t):t(r)}const wP=Fe({provide:String,useValue:Fe});function Sg(e){return null!==e&&"object"==typeof e&&wP in e}function Ts(e){return"function"==typeof e}const Ig=new K(""),dd={},bP={};let Tg;function fd(){return void 0===Tg&&(Tg=new ad),Tg}class gn{}class Io extends gn{get destroyed(){return this._destroyed}constructor(t,r,i,s){super(),this.parent=r,this.source=i,this.scopes=s,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,Ag(t,a=>this.processProvider(a)),this.records.set(dE,To(void 0,this)),s.has("environment")&&this.records.set(gn,To(void 0,this));const o=this.records.get(Ig);null!=o&&"string"==typeof o.value&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(_g,Me,Ee.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;const t=me(null);try{for(const i of this._ngOnDestroyHooks)i.ngOnDestroy();const r=this._onDestroyHooks;this._onDestroyHooks=[];for(const i of r)i()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),me(t)}}onDestroy(t){return this.assertNotDestroyed(),this._onDestroyHooks.push(t),()=>this.removeOnDestroy(t)}runInContext(t){this.assertNotDestroyed();const r=Bi(this),i=fn(void 0);try{return t()}finally{Bi(r),fn(i)}}get(t,r=_c,i=Ee.Default){if(this.assertNotDestroyed(),t.hasOwnProperty(rE))return t[rE](this);i=nd(i);const o=Bi(this),a=fn(void 0);try{if(!(i&Ee.SkipSelf)){let l=this.records.get(t);if(void 0===l){const u=function IP(e){return"function"==typeof e||"object"==typeof e&&e instanceof K}(t)&&Ju(t);l=u&&this.injectableDefInScope(u)?To(xg(t),dd):null,this.records.set(t,l)}if(null!=l)return this.hydrate(t,l)}return(i&Ee.Self?fd():this.parent).get(t,r=i&Ee.Optional&&r===_c?null:r)}catch(c){if("NullInjectorError"===c.name){if((c[td]=c[td]||[]).unshift(bt(t)),o)throw c;return function Qk(e,t,r,i){const s=e[td];throw t[oE]&&s.unshift(t[oE]),e.message=function Yk(e,t,r,i=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let s=bt(t);if(Array.isArray(t))s=t.map(bt).join(" -> ");else if("object"==typeof t){let o=[];for(let a in t)if(t.hasOwnProperty(a)){let c=t[a];o.push(a+":"+("string"==typeof c?JSON.stringify(c):bt(c)))}s=`{${o.join(", ")}}`}return`${r}${i?"("+i+")":""}[${s}]: ${e.replace(qk,"\n ")}`}("\n"+e.message,s,r,i),e.ngTokenPath=s,e[td]=null,e}(c,t,"R3InjectorError",this.source)}throw c}finally{fn(a),Bi(o)}}resolveInjectorInitializers(){const t=me(null),r=Bi(this),i=fn(void 0);try{const o=this.get(Is,Me,Ee.Self);for(const a of o)a()}finally{Bi(r),fn(i),me(t)}}toString(){const t=[],r=this.records;for(const i of r.keys())t.push(bt(i));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new M(205,!1)}processProvider(t){let r=Ts(t=re(t))?t:re(t&&t.provide);const i=function DP(e){return Sg(e)?To(void 0,e.useValue):To(function CE(e,t,r){let i;if(Ts(e)){const s=re(e);return Ss(s)||xg(s)}if(Sg(e))i=()=>re(e.useValue);else if(function DE(e){return!(!e||!e.useFactory)}(e))i=()=>e.useFactory(...yg(e.deps||[]));else if(function EE(e){return!(!e||!e.useExisting)}(e))i=()=>G(re(e.useExisting));else{const s=re(e&&(e.useClass||e.provide));if(!function CP(e){return!!e.deps}(e))return Ss(s)||xg(s);i=()=>new s(...yg(e.deps))}return i}(e),dd)}(t);if(!Ts(t)&&!0===t.multi){let s=this.records.get(r);s||(s=To(void 0,dd,!0),s.factory=()=>yg(s.multi),this.records.set(r,s)),r=t,s.multi.push(t)}this.records.set(r,i)}hydrate(t,r){const i=me(null);try{return r.value===dd&&(r.value=bP,r.value=r.factory()),"object"==typeof r.value&&r.value&&function SP(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(r.value)&&this._ngOnDestroyHooks.add(r.value),r.value}finally{me(i)}}injectableDefInScope(t){if(!t.providedIn)return!1;const r=re(t.providedIn);return"string"==typeof r?"any"===r||this.scopes.has(r):this.injectorDefTypes.has(r)}removeOnDestroy(t){const r=this._onDestroyHooks.indexOf(t);-1!==r&&this._onDestroyHooks.splice(r,1)}}function xg(e){const t=Ju(e),r=null!==t?t.factory:Ss(e);if(null!==r)return r;if(e instanceof K)throw new M(204,!1);if(e instanceof Function)return function EP(e){if(e.length>0)throw new M(204,!1);const r=function Bk(e){return e&&(e[ed]||e[eE])||null}(e);return null!==r?()=>r.factory(e):()=>new e}(e);throw new M(204,!1)}function To(e,t,r=!1){return{factory:e,value:t,multi:r?[]:void 0}}function Ag(e,t){for(const r of e)Array.isArray(r)?Ag(r,t):r&&dg(r)?Ag(r.\u0275providers,t):t(r)}function oi(e,t){e instanceof Io&&e.assertNotDestroyed();const i=Bi(e),s=fn(void 0);try{return t()}finally{Bi(i),fn(s)}}function SE(){return void 0!==iE()||null!=function Wk(){return Eo}()}const rt=0,F=1,ee=2,ut=3,tr=4,$t=5,xn=6,Ao=7,We=8,mt=9,nr=10,ie=11,Sc=12,TE=13,Mo=14,it=15,Ic=16,No=17,ai=18,Tc=19,xE=20,ji=21,gd=22,xs=23,fe=25,Ng=1,Cr=7,Ro=9,dt=10;var Rg=function(e){return e[e.None=0]="None",e[e.HasTransplantedViews=2]="HasTransplantedViews",e}(Rg||{});function Vt(e){return Array.isArray(e)&&"object"==typeof e[Ng]}function Ht(e){return Array.isArray(e)&&!0===e[Ng]}function Og(e){return!!(4&e.flags)}function As(e){return e.componentOffset>-1}function yd(e){return!(1&~e.flags)}function rr(e){return!!e.template}function kg(e){return!!(512&e[ee])}class UP{constructor(t,r,i){this.previousValue=t,this.currentValue=r,this.firstChange=i}isFirstChange(){return this.firstChange}}function RE(e,t,r,i){null!==t?t.applyValueToInputSignal(t,i):e[r]=i}function Ms(){return OE}function OE(e){return e.type.prototype.ngOnChanges&&(e.setInput=$P),jP}function jP(){const e=PE(this),t=e?.current;if(t){const r=e.previous;if(r===Dr)e.previous=t;else for(let i in t)r[i]=t[i];e.current=null,this.ngOnChanges(t)}}function $P(e,t,r,i,s){const o=this.declaredInputs[i],a=PE(e)||function VP(e,t){return e[kE]=t}(e,{previous:Dr,current:null}),c=a.current||(a.current={}),l=a.previous,u=l[o];c[o]=new UP(u&&u.currentValue,r,l===Dr),RE(e,t,s,r)}Ms.ngInherit=!0;const kE="__ngSimpleChanges__";function PE(e){return e[kE]||null}const Sr=function(e,t,r){};let BE=!1;function je(e){for(;Array.isArray(e);)e=e[rt];return e}function Ac(e,t){return je(t[e])}function tn(e,t){return je(t[e.index])}function Mc(e,t){return e.data[t]}function Oo(e,t){return e[t]}function An(e,t){const r=t[e];return Vt(r)?r:r[rt]}function Ug(e){return!(128&~e[ee])}function Ir(e,t){return null==t?null:e[t]}function UE(e){e[No]=0}function ZP(e){1024&e[ee]||(e[ee]|=1024,Ug(e)&&Nc(e))}function jg(e){return!!(9216&e[ee]||e[xs]?.dirty)}function $g(e){e[nr].changeDetectionScheduler?.notify(1),jg(e)?Nc(e):64&e[ee]&&(function zP(){return BE}()?(e[ee]|=1024,Nc(e)):e[nr].changeDetectionScheduler?.notify())}function Nc(e){e[nr].changeDetectionScheduler?.notify();let t=Ns(e);for(;null!==t&&!(8192&t[ee])&&(t[ee]|=8192,Ug(t));)t=Ns(t)}function vd(e,t){if(!(256&~e[ee]))throw new M(911,!1);null===e[ji]&&(e[ji]=[]),e[ji].push(t)}function Ns(e){const t=e[ut];return Ht(t)?t[ut]:t}const se={lFrame:KE(null),bindingsEnabled:!0,skipHydrationRootTNode:null};function VE(){return se.bindingsEnabled}function N(){return se.lFrame.lView}function De(){return se.lFrame.tView}function ci(e){return se.lFrame.contextLView=e,e[We]}function li(e){return se.lFrame.contextLView=null,e}function Be(){let e=HE();for(;null!==e&&64===e.type;)e=e.parent;return e}function HE(){return se.lFrame.currentTNode}function Tr(e,t){const r=se.lFrame;r.currentTNode=e,r.isParent=t}function Hg(){return se.lFrame.isParent}function zg(){se.lFrame.isParent=!1}function ir(){return se.lFrame.bindingIndex++}function di(e){const t=se.lFrame,r=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,r}function sL(e,t){const r=se.lFrame;r.bindingIndex=r.bindingRootIndex=e,qg(t)}function qg(e){se.lFrame.currentDirectiveIndex=e}function Gg(e){const t=se.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}function Wg(){return se.lFrame.currentQueryIndex}function wd(e){se.lFrame.currentQueryIndex=e}function aL(e){const t=e[F];return 2===t.type?t.declTNode:1===t.type?e[$t]:null}function WE(e,t,r){if(r&Ee.SkipSelf){let s=t,o=e;for(;!(s=s.parent,null!==s||r&Ee.Host||(s=aL(o),null===s||(o=o[Mo],10&s.type))););if(null===s)return!1;t=s,e=o}const i=se.lFrame=ZE();return i.currentTNode=t,i.lView=e,!0}function Zg(e){const t=ZE(),r=e[F];se.lFrame=t,t.currentTNode=r.firstChild,t.lView=e,t.tView=r,t.contextLView=e,t.bindingIndex=r.bindingStartIndex,t.inI18n=!1}function ZE(){const e=se.lFrame,t=null===e?null:e.child;return null===t?KE(e):t}function KE(e){const t={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:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function QE(){const e=se.lFrame;return se.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const YE=QE;function Kg(){const e=QE();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function zt(){return se.lFrame.selectedIndex}function Rs(e){se.lFrame.selectedIndex=e}function Ze(){const e=se.lFrame;return Mc(e.tView,e.selectedIndex)}let XE=!0;function Oc(){return XE}function xr(e){XE=e}function _d(e,t){for(let r=t.directiveStart,i=t.directiveEnd;r=i)break}else t[l]<0&&(e[No]+=65536),(c>14>16&&(3&e[ee])===t&&(e[ee]+=16384,tD(c,o)):tD(c,o)}const Po=-1;class kc{constructor(t,r,i){this.factory=t,this.resolving=!1,this.canSeeViewProviders=r,this.injectImpl=i}}function Jg(e){return e!==Po}function Pc(e){return 32767&e}function Lc(e,t){let r=function wL(e){return e>>16}(e),i=t;for(;r>0;)i=i[Mo],r--;return i}let Xg=!0;function Dd(e){const t=Xg;return Xg=e,t}const nD=255,rD=5;let _L=0;const Ar={};function Cd(e,t){const r=iD(e,t);if(-1!==r)return r;const i=t[F];i.firstCreatePass&&(e.injectorIndex=t.length,em(i.data,e),em(t,null),em(i.blueprint,null));const s=Sd(e,t),o=e.injectorIndex;if(Jg(s)){const a=Pc(s),c=Lc(s,t),l=c[F].data;for(let u=0;u<8;u++)t[o+u]=c[a+u]|l[a+u]}return t[o+8]=s,o}function em(e,t){e.push(0,0,0,0,0,0,0,0,t)}function iD(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function Sd(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let r=0,i=null,s=t;for(;null!==s;){if(i=dD(s),null===i)return Po;if(r++,s=s[Mo],-1!==i.injectorIndex)return i.injectorIndex|r<<16}return Po}function tm(e,t,r){!function bL(e,t,r){let i;"string"==typeof r?i=r.charCodeAt(0)||0:r.hasOwnProperty(wc)&&(i=r[wc]),null==i&&(i=r[wc]=_L++);const s=i&nD;t.data[e+(s>>rD)]|=1<=0?t&nD:SL:t}(r);if("function"==typeof o){if(!WE(t,e,i))return i&Ee.Host?sD(s,0,i):oD(t,r,i,s);try{let a;if(a=o(i),null!=a||i&Ee.Optional)return a;pg()}finally{YE()}}else if("number"==typeof o){let a=null,c=iD(e,t),l=Po,u=i&Ee.Host?t[it][$t]:null;for((-1===c||i&Ee.SkipSelf)&&(l=-1===c?Sd(e,t):t[c+8],l!==Po&&uD(i,!1)?(a=t[F],c=Pc(l),t=Lc(l,t)):c=-1);-1!==c;){const d=t[F];if(lD(o,c,d.data)){const f=DL(c,t,r,a,i,u);if(f!==Ar)return f}l=t[c+8],l!==Po&&uD(i,t[F].data[c+8]===u)&&lD(o,c,t)?(a=d,c=Pc(l),t=Lc(l,t)):c=-1}}return s}function DL(e,t,r,i,s,o){const a=t[F],c=a.data[e+8],d=Id(c,a,r,null==i?As(c)&&Xg:i!=a&&!!(3&c.type),s&Ee.Host&&o===c);return null!==d?Os(t,a,d,c):Ar}function Id(e,t,r,i,s){const o=e.providerIndexes,a=t.data,c=1048575&o,l=e.directiveStart,d=o>>20,h=s?c+d:e.directiveEnd;for(let p=i?c:c+d;p=l&&g.type===r)return p}if(s){const p=a[l];if(p&&rr(p)&&p.type===r)return l}return null}function Os(e,t,r,i){let s=e[r];const o=t.data;if(function gL(e){return e instanceof kc}(s)){const a=s;a.resolving&&function Vk(e,t){throw t&&t.join(" > "),new M(-200,e)}(function Re(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():de(e)}(o[r]));const c=Dd(a.canSeeViewProviders);a.resolving=!0;const u=a.injectImpl?fn(a.injectImpl):null;WE(e,i,Ee.Default);try{s=e[r]=a.factory(void 0,o,e,i),t.firstCreatePass&&r>=i.directiveStart&&function hL(e,t,r){const{ngOnChanges:i,ngOnInit:s,ngDoCheck:o}=t.type.prototype;if(i){const a=OE(t);(r.preOrderHooks??=[]).push(e,a),(r.preOrderCheckHooks??=[]).push(e,a)}s&&(r.preOrderHooks??=[]).push(0-e,s),o&&((r.preOrderHooks??=[]).push(e,o),(r.preOrderCheckHooks??=[]).push(e,o))}(r,o[r],t)}finally{null!==u&&fn(u),Dd(c),a.resolving=!1,YE()}}return s}function lD(e,t,r){return!!(r[t+(e>>rD)]&1<{const t=e.prototype.constructor,r=t[si]||rm(t),i=Object.prototype;let s=Object.getPrototypeOf(e.prototype).constructor;for(;s&&s!==i;){const o=s[si]||rm(s);if(o&&o!==r)return o;s=Object.getPrototypeOf(s)}return o=>new o})}function rm(e){return Yu(e)?()=>{const t=rm(re(e));return t&&t()}:Ss(e)}function dD(e){const t=e[F],r=t.type;return 2===r?t.declTNode:1===r?e[$t]:null}function mD(e,t=null,r=null,i){const s=yD(e,t,r,i);return s.resolveInjectorInitializers(),s}function yD(e,t=null,r=null,i,s=new Set){const o=[r||Me,vP(e)];return i=i||("object"==typeof e?void 0:bt(e)),new Io(o,t||fd(),i||null,s)}let qt=(()=>{class e{static#e=this.THROW_IF_NOT_FOUND=_c;static#t=this.NULL=new ad;static create(r,i){if(Array.isArray(r))return mD({name:""},i,r,"");{const s=r.name??"";return mD({name:s},r.parent,r.providers,s)}}static#r=this.\u0275prov=z({token:e,providedIn:"any",factory:()=>G(dE)});static#h=this.__NG_ELEMENT_ID__=-1}return e})();function sm(e){return e.ngOriginalError}class $n{constructor(){this._console=console}handleError(t){const r=this._findOriginalError(t);this._console.error("ERROR",t),r&&this._console.error("ORIGINAL ERROR",r)}_findOriginalError(t){let r=t&&sm(t);for(;r&&sm(r);)r=sm(r);return r||null}}const wD=new K("",{providedIn:"root",factory:()=>P($n).handleError.bind(void 0)});let Bo=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=PL;static#t=this.__NG_ENV_ID__=r=>r}return e})();class kL extends Bo{constructor(t){super(),this._lView=t}onDestroy(t){return vd(this._lView,t),()=>function Vg(e,t){if(null===e[ji])return;const r=e[ji].indexOf(t);-1!==r&&e[ji].splice(r,1)}(this._lView,t)}}function PL(){return new kL(N())}function LL(){return Uo(Be(),N())}function Uo(e,t){return new $i(tn(e,t))}let $i=(()=>{class e{constructor(r){this.nativeElement=r}static#e=this.__NG_ELEMENT_ID__=LL}return e})();function bD(e){return e instanceof $i?e.nativeElement:e}function om(e){return t=>{setTimeout(e,void 0,t)}}const rn=class FL extends ot{constructor(t=!1){super(),this.destroyRef=void 0,this.__isAsync=t,SE()&&(this.destroyRef=P(Bo,{optional:!0})??void 0)}emit(t){const r=me(null);try{super.next(t)}finally{me(r)}}subscribe(t,r,i){let s=t,o=r||(()=>null),a=i;if(t&&"object"==typeof t){const l=t;s=l.next?.bind(l),o=l.error?.bind(l),a=l.complete?.bind(l)}this.__isAsync&&(o=om(o),s&&(s=om(s)),a&&(a=om(a)));const c=super.subscribe({next:s,error:o,complete:a});return t instanceof Rt&&t.add(c),c}};function BL(){return this._results[Symbol.iterator]()}class am{static#e=Symbol.iterator;get changes(){return this._changes??=new rn}constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._onDirty=void 0,this._results=[],this._changesDetected=!1,this._changes=void 0,this.length=0,this.first=void 0,this.last=void 0;const r=am.prototype;r[Symbol.iterator]||(r[Symbol.iterator]=BL)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,r){return this._results.reduce(t,r)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,r){this.dirty=!1;const i=function hn(e){return e.flat(Number.POSITIVE_INFINITY)}(t);(this._changesDetected=!function tP(e,t,r){if(e.length!==t.length)return!1;for(let i=0;ioF}),oF="ng",$D=new K(""),ks=new K("",{providedIn:"platform",factory:()=>"unknown"}),VD=new K(""),HD=new K("",{providedIn:"root",factory:()=>Vi().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});let zD=()=>null;function wm(e,t,r=!1){return zD(e,t,r)}const KD=new K("",{providedIn:"root",factory:()=>!1});let Bd,Ud;function Vo(e){return function Dm(){if(void 0===Bd&&(Bd=null,Pe.trustedTypes))try{Bd=Pe.trustedTypes.createPolicy("angular",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return Bd}()?.createHTML(e)||e}function YD(e){return function Cm(){if(void 0===Ud&&(Ud=null,Pe.trustedTypes))try{Ud=Pe.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return Ud}()?.createHTML(e)||e}class Ps{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${Kb})`}}class _F extends Ps{getTypeName(){return"HTML"}}class bF extends Ps{getTypeName(){return"Style"}}class EF extends Ps{getTypeName(){return"Script"}}class DF extends Ps{getTypeName(){return"URL"}}class CF extends Ps{getTypeName(){return"ResourceURL"}}function Mn(e){return e instanceof Ps?e.changingThisBreaksApplicationSecurity:e}function Mr(e,t){const r=function SF(e){return e instanceof Ps&&e.getTypeName()||null}(e);if(null!=r&&r!==t){if("ResourceURL"===r&&"URL"===t)return!0;throw new Error(`Required a safe ${t}, got a ${r} (see ${Kb})`)}return r===t}class NF{constructor(t){this.inertDocumentHelper=t}getInertBodyElement(t){t=""+t;try{const r=(new window.DOMParser).parseFromString(Vo(t),"text/html").body;return null===r?this.inertDocumentHelper.getInertBodyElement(t):(r.removeChild(r.firstChild),r)}catch{return null}}}class RF{constructor(t){this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(t){const r=this.inertDocument.createElement("template");return r.innerHTML=Vo(t),r}}const kF=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function jd(e){return(e=String(e)).match(kF)?e:"unsafe:"+e}function fi(e){const t={};for(const r of e.split(","))t[r]=!0;return t}function zc(...e){const t={};for(const r of e)for(const i in r)r.hasOwnProperty(i)&&(t[i]=!0);return t}const tC=fi("area,br,col,hr,img,wbr"),nC=fi("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),rC=fi("rp,rt"),Sm=zc(tC,zc(nC,fi("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),zc(rC,fi("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),zc(rC,nC)),Im=fi("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),iC=zc(Im,fi("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),fi("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),PF=fi("script,style,template");class LF{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(t){let r=t.firstChild,i=!0,s=[];for(;r;)if(r.nodeType===Node.ELEMENT_NODE?i=this.startElement(r):r.nodeType===Node.TEXT_NODE?this.chars(r.nodeValue):this.sanitizedSomething=!0,i&&r.firstChild)s.push(r),r=UF(r);else for(;r;){r.nodeType===Node.ELEMENT_NODE&&this.endElement(r);let o=BF(r);if(o){r=o;break}r=s.pop()}return this.buf.join("")}startElement(t){const r=sC(t).toLowerCase();if(!Sm.hasOwnProperty(r))return this.sanitizedSomething=!0,!PF.hasOwnProperty(r);this.buf.push("<"),this.buf.push(r);const i=t.attributes;for(let s=0;s"),!0}endElement(t){const r=sC(t).toLowerCase();Sm.hasOwnProperty(r)&&!tC.hasOwnProperty(r)&&(this.buf.push(""))}chars(t){this.buf.push(aC(t))}}function BF(e){const t=e.nextSibling;if(t&&e!==t.previousSibling)throw oC(t);return t}function UF(e){const t=e.firstChild;if(t&&function FF(e,t){return(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}(e,t))throw oC(t);return t}function sC(e){const t=e.nodeName;return"string"==typeof t?t:"FORM"}function oC(e){return new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`)}const jF=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$F=/([^\#-~ |!])/g;function aC(e){return e.replace(/&/g,"&").replace(jF,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace($F,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}let $d;function cC(e,t){let r=null;try{$d=$d||function eC(e){const t=new RF(e);return function OF(){try{return!!(new window.DOMParser).parseFromString(Vo(""),"text/html")}catch{return!1}}()?new NF(t):t}(e);let i=t?String(t):"";r=$d.getInertBodyElement(i);let s=5,o=i;do{if(0===s)throw new Error("Failed to sanitize html because the input is unstable");s--,i=o,o=r.innerHTML,r=$d.getInertBodyElement(i)}while(i!==o);return Vo((new LF).sanitizeChildren(Tm(r)||r))}finally{if(r){const i=Tm(r)||r;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function Tm(e){return"content"in e&&function VF(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var Nn=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}(Nn||{});function xm(e){const t=function qc(){const e=N();return e&&e[nr].sanitizer}();return t?YD(t.sanitize(Nn.HTML,e)||""):Mr(e,"HTML")?YD(Mn(e)):cC(Vi(),de(e))}const ZF=/^>|^->||--!>|)/g,QF="\u200b$1\u200b";function gC(e){return e.ownerDocument.defaultView}function Rn(e){return e instanceof Function?e():e}var Hi=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}(Hi||{});let Rm;function Om(e,t){return Rm(e,t)}function zo(e,t,r,i,s){if(null!=i){let o,a=!1;Ht(i)?o=i:Vt(i)&&(a=!0,i=i[rt]);const c=je(i);0===e&&null!==r?null==s?CC(t,r,c):Ls(t,r,c,s||null,!0):1===e&&null!==r?Ls(t,r,c,s||null,!0):2===e?function Zc(e,t,r){const i=Gd(e,t);i&&function p3(e,t,r,i){e.removeChild(t,r,i)}(e,i,t,r)}(t,c,a):3===e&&t.destroyNode(c),null!=o&&function y3(e,t,r,i,s){const o=r[Cr];o!==je(r)&&zo(t,e,i,o,s);for(let c=dt;ct.replace(KF,QF))}(t))}function zd(e,t,r){return e.createElement(t,r)}function bC(e,t){t[nr].changeDetectionScheduler?.notify(1),Zd(e,t,t[ie],2,null,null)}function EC(e,t){const r=e[Ro],i=r.indexOf(t);r.splice(i,1)}function Gc(e,t){if(e.length<=dt)return;const r=dt+t,i=e[r];if(i){const s=i[Ic];null!==s&&s!==e&&EC(s,i),t>0&&(e[r-1][tr]=i[tr]);const o=sd(e,dt+t);!function a3(e,t){bC(e,t),t[rt]=null,t[$t]=null}(i[F],i);const a=o[ai];null!==a&&a.detachView(o[F]),i[ut]=null,i[tr]=null,i[ee]&=-129}return i}function qd(e,t){if(!(256&t[ee])){const r=t[ie];r.destroyNode&&Zd(e,t,r,3,null,null),function l3(e){let t=e[Sc];if(!t)return Lm(e[F],e);for(;t;){let r=null;if(Vt(t))r=t[Sc];else{const i=t[dt];i&&(r=i)}if(!r){for(;t&&!t[tr]&&t!==e;)Vt(t)&&Lm(t[F],t),t=t[ut];null===t&&(t=e),Vt(t)&&Lm(t[F],t),r=t&&t[tr]}t=r}}(t)}}function Lm(e,t){if(256&t[ee])return;const r=me(null);try{t[ee]&=-129,t[ee]|=256,t[xs]&&function kb(e){if(mo(e),yc(e))for(let t=0;t=0?i[a]():i[-a].unsubscribe(),o+=2}else r[o].call(i[r[o+1]]);null!==i&&(t[Ao]=null);const s=t[ji];if(null!==s){t[ji]=null;for(let o=0;o-1){const{encapsulation:o}=e.data[i.directiveStart+s];if(o===Jn.None||o===Jn.Emulated)return null}return tn(i,r)}}(e,t.parent,r)}function Ls(e,t,r,i,s){e.insertBefore(t,r,i,s)}function CC(e,t,r){e.appendChild(t,r)}function SC(e,t,r,i,s){null!==i?Ls(e,t,r,i,s):CC(e,t,r)}function Gd(e,t){return e.parentNode(t)}let Bm,xC=function TC(e,t,r){return 40&e.type?tn(e,r):null};function Wd(e,t,r,i){const s=Fm(e,i,t),o=t[ie],c=function IC(e,t,r){return xC(e,t,r)}(i.parent||t[$t],i,t);if(null!=s)if(Array.isArray(r))for(let l=0;lfe&&PC(e,t,fe,!1),Sr(a?2:0,s),r(i,s)}finally{Rs(o),Sr(a?3:1,s)}}function Vm(e,t,r){if(Og(t)){const i=me(null);try{const o=t.directiveEnd;for(let a=t.directiveStart;anull;function $C(e,t,r,i,s){for(let o in t){if(!t.hasOwnProperty(o))continue;const a=t[o];if(void 0===a)continue;i??={};let c,l=Xn.None;Array.isArray(a)?(c=a[0],l=a[1]):c=a;let u=o;if(null!==s){if(!s.hasOwnProperty(o))continue;u=s[o]}0===e?VC(i,r,u,c,l):VC(i,r,u,c)}return i}function VC(e,t,r,i,s){let o;e.hasOwnProperty(r)?(o=e[r]).push(t,i):o=e[r]=[t,i],void 0!==s&&o.push(s)}function yn(e,t,r,i,s,o,a,c){const l=tn(t,r);let d,u=t.inputs;!c&&null!=u&&(d=u[i])?(Qm(e,r,d,i,s),As(t)&&function M3(e,t){const r=An(t,e);16&r[ee]||(r[ee]|=64)}(r,t.index)):3&t.type&&(i=function A3(e){return"class"===e?"className":"for"===e?"htmlFor":"formaction"===e?"formAction":"innerHtml"===e?"innerHTML":"readonly"===e?"readOnly":"tabindex"===e?"tabIndex":e}(i),s=null!=a?a(s,t.value||"",i):s,o.setProperty(l,i,s))}function Gm(e,t,r,i){if(VE()){const s=null===i?null:{"":-1},o=function L3(e,t){const r=e.directiveRegistry;let i=null,s=null;if(r)for(let o=0;o0;){const r=e[--t];if("number"==typeof r&&r<0)return r}return 0})(a)!=c&&a.push(c),a.push(r,i,o)}}(e,t,i,Kc(e,r,s.hostVars,he),s)}function Nr(e,t,r,i,s,o){const a=tn(e,t);!function Zm(e,t,r,i,s,o,a){if(null==o)e.removeAttribute(t,s,r);else{const c=null==a?de(o):a(o,i||"",s);e.setAttribute(t,s,c,r)}}(t[ie],a,o,e.value,r,i,s)}function V3(e,t,r,i,s,o){const a=o[t];if(null!==a)for(let c=0;c0&&(r[s-1][tr]=t),i{Nc(e.lView)},consumerOnSignalRead(){this.lView[xs]=this}},XC=100;function Jd(e,t=!0,r=0){const i=e[nr],s=i.rendererFactory;s.begin?.();try{!function Y3(e,t){Xm(e,t);let r=0;for(;jg(e);){if(r===XC)throw new M(103,!1);r++,Xm(e,1)}}(e,r)}catch(a){throw t&&Yd(e,a),a}finally{s.end?.(),i.inlineEffectRunner?.flush()}}function J3(e,t,r,i){const s=t[ee];if(!(256&~s))return;t[nr].inlineEffectRunner?.flush(),Zg(t);let a=null,c=null;(function X3(e){return 2!==e.type})(e)&&(c=function W3(e){return e[xs]??function Z3(e){const t=JC.pop()??Object.create(Q3);return t.lView=e,t}(e)}(t),a=function Rb(e){return e&&(e.nextProducerIndex=0),me(e)}(c));try{UE(t),function qE(e){return se.lFrame.bindingIndex=e}(e.bindingStartIndex),null!==r&&BC(e,t,r,2,i);const l=!(3&~s);if(l){const f=e.preOrderCheckHooks;null!==f&&bd(t,f,null)}else{const f=e.preOrderHooks;null!==f&&Ed(t,f,0,null),Qg(t,0)}if(function eB(e){for(let t=ND(e);null!==t;t=RD(t)){if(!(t[ee]&Rg.HasTransplantedViews))continue;const r=t[Ro];for(let i=0;ie.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}(c,a),function K3(e){e.lView[xs]!==e&&(e.lView=null,JC.push(e))}(c)),Kg()}}function eS(e,t){for(let r=ND(e);null!==r;r=RD(r))for(let i=dt;i-1&&(Gc(t,i),sd(r,i))}this._attachedToViewContainer=!1}qd(this._lView[F],this._lView)}onDestroy(t){vd(this._lView,t)}markForCheck(){Xc(this._cdRefInjectingView||this._lView)}detach(){this._lView[ee]&=-129}reattach(){$g(this._lView),this._lView[ee]|=128}detectChanges(){this._lView[ee]|=1024,Jd(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new M(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,bC(this._lView[F],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new M(902,!1);this._appRef=t,$g(this._lView)}}let pi=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=iB}return e})();const nB=pi,rB=class extends nB{constructor(t,r,i){super(),this._declarationLView=t,this._declarationTContainer=r,this.elementRef=i}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(t,r){return this.createEmbeddedViewImpl(t,r)}createEmbeddedViewImpl(t,r,i){const s=function Qc(e,t,r,i){const s=me(null);try{const o=t.tView,l=Kd(e,o,r,4096&e[ee]?4096:16,null,t,null,null,i?.injector??null,i?.embeddedViewInjector??null,i?.dehydratedView??null);l[Ic]=e[t.index];const d=e[ai];return null!==d&&(l[ai]=d.createEmbeddedView(o)),Ym(o,l,r),l}finally{me(s)}}(this._declarationLView,this._declarationTContainer,t,{embeddedViewInjector:r,dehydratedView:i});return new el(s)}};function iB(){return Xd(Be(),N())}function Xd(e,t){return 4&e.type?new rB(t,e,Uo(e,t)):null}class sf{}class xB{}class lS{}class MB{resolveComponentFactory(t){throw function AB(e){const t=Error(`No component factory found for ${bt(e)}.`);return t.ngComponent=e,t}(t)}}let sl=(()=>{class e{static#e=this.NULL=new MB}return e})();class sy{}let RB=(()=>{class e{static#e=this.\u0275prov=z({token:e,providedIn:"root",factory:()=>null})}return e})();const oy={},dS=new Set;function Rr(e){dS.has(e)||(dS.add(e),performance?.mark?.("mark_feature_usage",{detail:{feature:e}}))}function fS(...e){}class Ne{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new rn(!1),this.onMicrotaskEmpty=new rn(!1),this.onStable=new rn(!1),this.onError=new rn(!1),typeof Zone>"u")throw new M(908,!1);Zone.assertZonePatched();const s=this;s._nesting=0,s._outer=s._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(s._inner=s._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(s._inner=s._inner.fork(Zone.longStackTraceZoneSpec)),s.shouldCoalesceEventChangeDetection=!i&&r,s.shouldCoalesceRunChangeDetection=i,s.lastRequestAnimationFrameId=-1,s.nativeRequestAnimationFrame=function OB(){const e="function"==typeof Pe.requestAnimationFrame;let t=Pe[e?"requestAnimationFrame":"setTimeout"],r=Pe[e?"cancelAnimationFrame":"clearTimeout"];if(typeof Zone<"u"&&t&&r){const i=t[Zone.__symbol__("OriginalDelegate")];i&&(t=i);const s=r[Zone.__symbol__("OriginalDelegate")];s&&(r=s)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:r}}().nativeRequestAnimationFrame,function LB(e){const t=()=>{!function PB(e){e.isCheckStableRunning||-1!==e.lastRequestAnimationFrameId||(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(Pe,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,cy(e),e.isCheckStableRunning=!0,ay(e),e.isCheckStableRunning=!1},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),cy(e))}(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(r,i,s,o,a,c)=>{if(function FB(e){return!(!Array.isArray(e)||1!==e.length)&&!0===e[0].data?.__ignore_ng_zone__}(c))return r.invokeTask(s,o,a,c);try{return hS(e),r.invokeTask(s,o,a,c)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===o.type||e.shouldCoalesceRunChangeDetection)&&t(),pS(e)}},onInvoke:(r,i,s,o,a,c,l)=>{try{return hS(e),r.invoke(s,o,a,c,l)}finally{e.shouldCoalesceRunChangeDetection&&t(),pS(e)}},onHasTask:(r,i,s,o)=>{r.hasTask(s,o),i===s&&("microTask"==o.change?(e._hasPendingMicrotasks=o.microTask,cy(e),ay(e)):"macroTask"==o.change&&(e.hasPendingMacrotasks=o.macroTask))},onHandleError:(r,i,s,o)=>(r.handleError(s,o),e.runOutsideAngular(()=>e.onError.emit(o)),!1)})}(s)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Ne.isInAngularZone())throw new M(909,!1)}static assertNotInAngularZone(){if(Ne.isInAngularZone())throw new M(909,!1)}run(t,r,i){return this._inner.run(t,r,i)}runTask(t,r,i,s){const o=this._inner,a=o.scheduleEventTask("NgZoneEvent: "+s,t,kB,fS,fS);try{return o.runTask(a,r,i)}finally{o.cancelTask(a)}}runGuarded(t,r,i){return this._inner.runGuarded(t,r,i)}runOutsideAngular(t){return this._outer.run(t)}}const kB={};function ay(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function cy(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&-1!==e.lastRequestAnimationFrameId)}function hS(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function pS(e){e._nesting--,ay(e)}class gS{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new rn,this.onMicrotaskEmpty=new rn,this.onStable=new rn,this.onError=new rn}run(t,r,i){return t.apply(r,i)}runGuarded(t,r,i){return t.apply(r,i)}runOutsideAngular(t){return t()}runTask(t,r,i,s){return t.apply(r,i)}}var Fs=function(e){return e[e.EarlyRead=0]="EarlyRead",e[e.Write=1]="Write",e[e.MixedReadWrite=2]="MixedReadWrite",e[e.Read=3]="Read",e}(Fs||{});const mS={destroy(){}};function uy(e,t){!t&&function hd(e){if(!SE())throw new M(-203,!1)}();const r=t?.injector??P(qt);if(!function sr(e){return"browser"===(e??P(qt)).get(ks)}(r))return mS;Rr("NgAfterNextRender");const i=r.get(ol),s=i.handler??=new vS,o=t?.phase??Fs.MixedReadWrite,a=()=>{s.unregister(l),c()},c=r.get(Bo).onDestroy(a),l=oi(r,()=>new yS(o,()=>{a(),e()}));return s.register(l),{destroy:a}}class yS{constructor(t,r){this.phase=t,this.callbackFn=r,this.zone=P(Ne),this.errorHandler=P($n,{optional:!0}),P(sf,{optional:!0})?.notify(1)}invoke(){try{this.zone.runOutsideAngular(this.callbackFn)}catch(t){this.errorHandler?.handleError(t)}}}class vS{constructor(){this.executingCallbacks=!1,this.buckets={[Fs.EarlyRead]:new Set,[Fs.Write]:new Set,[Fs.MixedReadWrite]:new Set,[Fs.Read]:new Set},this.deferredCallbacks=new Set}register(t){(this.executingCallbacks?this.deferredCallbacks:this.buckets[t.phase]).add(t)}unregister(t){this.buckets[t.phase].delete(t),this.deferredCallbacks.delete(t)}execute(){this.executingCallbacks=!0;for(const t of Object.values(this.buckets))for(const r of t)r.invoke();this.executingCallbacks=!1;for(const t of this.deferredCallbacks)this.buckets[t.phase].add(t);this.deferredCallbacks.clear()}destroy(){for(const t of Object.values(this.buckets))t.clear();this.deferredCallbacks.clear()}}let ol=(()=>{class e{constructor(){this.handler=null,this.internalCallbacks=[]}execute(){this.executeInternalCallbacks(),this.handler?.execute()}executeInternalCallbacks(){const r=[...this.internalCallbacks];this.internalCallbacks.length=0;for(const i of r)i()}ngOnDestroy(){this.handler?.destroy(),this.handler=null,this.internalCallbacks.length=0}static#e=this.\u0275prov=z({token:e,providedIn:"root",factory:()=>new e})}return e})();function lf(e,t,r){let i=r?e.styles:null,s=r?e.classes:null,o=0;if(null!==t)for(let a=0;a0&&OC(e,r,o.join(" "))}}(p,D,m,i),void 0!==r&&function KB(e,t,r){const i=e.projection=[];for(let s=0;s{class e{static#e=this.__NG_ELEMENT_ID__=YB}return e})();function YB(){return SS(Be(),N())}const JB=or,DS=class extends JB{constructor(t,r,i){super(),this._lContainer=t,this._hostTNode=r,this._hostLView=i}get element(){return Uo(this._hostTNode,this._hostLView)}get injector(){return new Ct(this._hostTNode,this._hostLView)}get parentInjector(){const t=Sd(this._hostTNode,this._hostLView);if(Jg(t)){const r=Lc(t,this._hostLView),i=Pc(t);return new Ct(r[F].data[i+8],r)}return new Ct(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const r=CS(this._lContainer);return null!==r&&r[t]||null}get length(){return this._lContainer.length-dt}createEmbeddedView(t,r,i){let s,o;"number"==typeof i?s=i:null!=i&&(s=i.index,o=i.injector);const c=t.createEmbeddedViewImpl(r||{},o,null);return this.insertImpl(c,s,Go(this._hostTNode,null)),c}createComponent(t,r,i,s,o){const a=t&&!function Cc(e){return"function"==typeof e}(t);let c;if(a)c=r;else{const g=r||{};c=g.index,i=g.injector,s=g.projectableNodes,o=g.environmentInjector||g.ngModuleRef}const l=a?t:new ll(we(t)),u=i||this.parentInjector;if(!o&&null==l.ngModule){const m=(a?u:this.parentInjector).get(gn,null);m&&(o=m)}we(l.componentType??{});const p=l.create(u,s,null,o);return this.insertImpl(p.hostView,c,Go(this._hostTNode,null)),p}insert(t,r){return this.insertImpl(t,r,!0)}insertImpl(t,r,i){const s=t._lView;if(function WP(e){return Ht(e[ut])}(s)){const c=this.indexOf(t);if(-1!==c)this.detach(c);else{const l=s[ut],u=new DS(l,l[$t],l[ut]);u.detach(u.indexOf(t))}}const o=this._adjustIndex(r),a=this._lContainer;return Yc(a,s,o,i),t.attachToViewContainerRef(),cE(hy(a),o,t),t}move(t,r){return this.insert(t,r)}indexOf(t){const r=CS(this._lContainer);return null!==r?r.indexOf(t):-1}remove(t){const r=this._adjustIndex(t,-1),i=Gc(this._lContainer,r);i&&(sd(hy(this._lContainer),r),qd(i[F],i))}detach(t){const r=this._adjustIndex(t,-1),i=Gc(this._lContainer,r);return i&&null!=sd(hy(this._lContainer),r)?new el(i):null}_adjustIndex(t,r=0){return t??this.length+r}};function CS(e){return e[8]}function hy(e){return e[8]||(e[8]=[])}function SS(e,t){let r;const i=t[e.index];return Ht(i)?r=i:(r=qC(i,t,null,e),t[e.index]=r,Qd(t,r)),IS(r,t,e,i),new DS(r,e,t)}let IS=function xS(e,t,r,i){if(e[Cr])return;let s;s=8&r.type?je(i):function XB(e,t){const r=e[ie],i=r.createComment(""),s=tn(t,e);return Ls(r,Gd(r,s),i,function g3(e,t){return e.nextSibling(t)}(r,s),!1),i}(t,r),e[Cr]=s},py=()=>!1;class gy{constructor(t){this.queryList=t,this.matches=null}clone(){return new gy(this.queryList)}setDirty(){this.queryList.setDirty()}}class my{constructor(t=[]){this.queries=t}createEmbeddedView(t){const r=t.queries;if(null!==r){const i=null!==t.contentQueries?t.contentQueries[0]:r.length,s=[];for(let o=0;ot.trim())}(t):t}}class yy{constructor(t=[]){this.queries=t}elementStart(t,r){for(let i=0;i0)i.push(a[c/2]);else{const u=o[c+1],d=t[-l];for(let f=dt;f(Gp(t),t.value);return r[Er]=t,r}(e),i=r[Er];return t?.equal&&(i.equal=t.equal),r.set=s=>Ub(i,s),r.update=s=>function gk(e,t){Mb()||Bb(),Ub(e,t(e.value))}(i,s),r.asReadonly=FS.bind(r),r}function FS(){const e=this[Er];if(void 0===e.readonlyFn){const t=()=>this();t[Er]=e,e.readonlyFn=t}return e.readonlyFn}class Bs{}class tI{}class Dy extends Bs{constructor(t,r,i){super(),this._parent=r,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new bS(this);const s=jt(t);this._bootstrapComponents=Rn(s.bootstrap),this._r3Injector=yD(t,r,[{provide:Bs,useValue:this},{provide:sl,useValue:this.componentFactoryResolver},...i],bt(t),new Set(["environment"])),this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(t)}get injector(){return this._r3Injector}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(r=>r()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Cy extends tI{constructor(t){super(),this.moduleType=t}create(t){return new Dy(this.moduleType,t,[])}}class nI extends Bs{constructor(t){super(),this.componentFactoryResolver=new bS(this),this.instance=null;const r=new Io([...t.providers,{provide:Bs,useValue:this},{provide:sl,useValue:this.componentFactoryResolver}],t.parent||fd(),t.debugName,new Set(["environment"]));this.injector=r,t.runEnvironmentInitializers&&r.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function hf(e,t,r=null){return new nI({providers:e,parent:t,debugName:r,runEnvironmentInitializers:!0}).injector}let Ko=(()=>{class e{constructor(){this.taskId=0,this.pendingTasks=new Set,this.hasPendingTasks=new jn(!1)}get _hasPendingTasks(){return this.hasPendingTasks.value}add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);const r=this.taskId++;return this.pendingTasks.add(r),r}remove(r){this.pendingTasks.delete(r),0===this.pendingTasks.size&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function gf(e){return!!function Sy(e){return null!==e&&("function"==typeof e||"object"==typeof e)}(e)&&(Array.isArray(e)||!(e instanceof Map)&&Symbol.iterator in e)}function ft(e,t,r){return!Object.is(e[t],r)&&(e[t]=r,!0)}function Hn(e,t,r,i,s,o,a,c){const l=N(),u=De(),d=e+fe,f=u.firstCreatePass?function P8(e,t,r,i,s,o,a,c,l){const u=t.consts,d=qo(t,e,4,a||null,Ir(u,c));Gm(t,r,d,Ir(u,l)),_d(t,d);const f=d.tView=qm(2,d,i,s,o,t.directiveRegistry,t.pipeRegistry,null,t.schemas,u,null);return null!==t.queries&&(t.queries.template(t,d),f.queries=t.queries.embeddedTView(d)),d}(d,u,l,t,r,i,s,o,a):u.data[d];Tr(f,!1);const h=rI(u,l,f,e);Oc()&&Wd(u,l,h,f),Gt(h,l);const p=qC(h,l,h,f);return l[d]=p,Qd(l,p),function TS(e,t,r){return py(e,t,r)}(p,f,l),yd(f)&&Hm(u,l,f),null!=a&&zm(l,f,c),Hn}let rI=function iI(e,t,r,i){return xr(!0),t[ie].createComment("")};function kr(e,t,r,i){const s=N();return ft(s,ir(),t)&&(De(),Nr(Ze(),s,e,t,r,i)),kr}function Ef(e,t){return e<<17|t<<2}function Wi(e){return e>>17&32767}function Py(e){return 2|e}function $s(e){return(131068&e)>>2}function Ly(e,t){return-131069&e|t<<2}function Fy(e){return 1|e}function PI(e,t,r,i){const s=e[r+1],o=null===t;let a=i?Wi(s):$s(s),c=!1;for(;0!==a&&(!1===c||o);){const u=e[a+1];bU(e[a],t)&&(c=!0,e[a+1]=i?Fy(u):Py(u)),a=i?Wi(u):$s(u)}c&&(e[r+1]=i?Py(s):Fy(s))}function bU(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&Co(e,t)>=0}const St={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function LI(e){return e.substring(St.key,St.keyEnd)}function FI(e,t){const r=St.textEnd;return r===t?-1:(t=St.keyEnd=function SU(e,t,r){for(;t32;)t++;return t}(e,St.key=t,r),da(e,t,r))}function da(e,t,r){for(;t=0;r=FI(t,r))Tn(e,LI(t),!0)}function ar(e,t,r,i){const s=N(),o=De(),a=di(2);o.firstUpdatePass&&HI(o,e,a,i),t!==he&&ft(s,a,t)&&qI(o,o.data[zt()],s,s[ie],e,s[a+1]=function LU(e,t){return null==e||""===e||("string"==typeof t?e+=t:"object"==typeof e&&(e=bt(Mn(e)))),e}(t,r),i,a)}function VI(e,t){return t>=e.expandoStartIndex}function HI(e,t,r,i){const s=e.data;if(null===s[r+1]){const o=s[zt()],a=VI(e,r);WI(o,i)&&null===t&&!a&&(t=!1),t=function AU(e,t,r,i){const s=Gg(e);let o=i?t.residualClasses:t.residualStyles;if(null===s)0===(i?t.classBindings:t.styleBindings)&&(r=yl(r=jy(null,e,t,r,i),t.attrs,i),o=null);else{const a=t.directiveStylingLast;if(-1===a||e[a]!==s)if(r=jy(s,e,t,r,i),null===o){let l=function MU(e,t,r){const i=r?t.classBindings:t.styleBindings;if(0!==$s(i))return e[Wi(i)]}(e,t,i);void 0!==l&&Array.isArray(l)&&(l=jy(null,e,t,l[1],i),l=yl(l,t.attrs,i),function NU(e,t,r,i){e[Wi(r?t.classBindings:t.styleBindings)]=i}(e,t,i,l))}else o=function RU(e,t,r){let i;const s=t.directiveEnd;for(let o=1+t.directiveStylingLast;o0)&&(u=!0)):d=r,s)if(0!==l){const h=Wi(e[c+1]);e[i+1]=Ef(h,c),0!==h&&(e[h+1]=Ly(e[h+1],i)),e[c+1]=function yU(e,t){return 131071&e|t<<17}(e[c+1],i)}else e[i+1]=Ef(c,0),0!==c&&(e[c+1]=Ly(e[c+1],i)),c=i;else e[i+1]=Ef(l,0),0===c?c=i:e[l+1]=Ly(e[l+1],i),l=i;u&&(e[i+1]=Py(e[i+1])),PI(e,d,i,!0),PI(e,d,i,!1),function _U(e,t,r,i,s){const o=s?e.residualClasses:e.residualStyles;null!=o&&"string"==typeof t&&Co(o,t)>=0&&(r[i+1]=Fy(r[i+1]))}(t,d,e,i,o),a=Ef(c,l),o?t.classBindings=a:t.styleBindings=a}(s,o,t,r,a,i)}}function jy(e,t,r,i,s){let o=null;const a=r.directiveEnd;let c=r.directiveStylingLast;for(-1===c?c=r.directiveStart:c++;c0;){const l=e[s],u=Array.isArray(l),d=u?l[1]:l,f=null===d;let h=r[s+1];h===he&&(h=f?Me:void 0);let p=f?wg(h,i):d===i?h:void 0;if(u&&!Df(p)&&(p=wg(l,i)),Df(p)&&(c=p,a))return c;const g=e[s+1];s=a?Wi(g):$s(g)}if(null!==t){let l=o?t.residualClasses:t.residualStyles;null!=l&&(c=wg(l,i))}return c}function Df(e){return void 0!==e}function WI(e,t){return!!(e.flags&(t?8:16))}function Le(e,t,r,i){const s=N(),o=De(),a=fe+e,c=s[ie],l=o.firstCreatePass?function s4(e,t,r,i,s,o){const a=t.consts,l=qo(t,e,2,i,Ir(a,s));return Gm(t,r,l,Ir(a,o)),null!==l.attrs&&lf(l,l.attrs,!1),null!==l.mergedAttrs&&lf(l,l.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,l),l}(a,o,s,t,r,i):o.data[a],u=YI(o,s,l,c,t,e);s[a]=u;const d=yd(l);return Tr(l,!0),kC(c,u,l),!function hl(e){return!(32&~e.flags)}(l)&&Oc()&&Wd(o,s,u,l),0===function KP(){return se.lFrame.elementDepthCount}()&&Gt(u,s),function QP(){se.lFrame.elementDepthCount++}(),d&&(Hm(o,s,l),Vm(o,l,s)),null!==i&&zm(s,l),Le}function Qe(){let e=Be();Hg()?zg():(e=e.parent,Tr(e,!1));const t=e;(function JP(e){return se.skipHydrationRootTNode===e})(t)&&function nL(){se.skipHydrationRootTNode=null}(),function YP(){se.lFrame.elementDepthCount--}();const r=De();return r.firstCreatePass&&(_d(r,e),Og(e)&&r.queries.elementEnd(e)),null!=t.classesWithoutHost&&function yL(e){return!!(8&e.flags)}(t)&&By(r,t,N(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function vL(e){return!!(16&e.flags)}(t)&&By(r,t,N(),t.stylesWithoutHost,!1),Qe}function mi(e,t,r,i){return Le(e,t,r,i),Qe(),mi}let YI=(e,t,r,i,s,o)=>(xr(!0),zd(i,s,function JE(){return se.lFrame.currentNamespace}()));function ha(e,t,r){const i=N(),s=De(),o=e+fe,a=s.firstCreatePass?function c4(e,t,r,i,s){const o=t.consts,a=Ir(o,i),c=qo(t,e,8,"ng-container",a);return null!==a&&lf(c,a,!0),Gm(t,r,c,Ir(o,s)),null!==t.queries&&t.queries.elementStart(t,c),c}(o,s,i,t,r):s.data[o];Tr(a,!0);const c=XI(s,i,a,e);return i[o]=c,Oc()&&Wd(s,i,c,a),Gt(c,i),yd(a)&&(Hm(s,i,a),Vm(s,a,i)),null!=r&&zm(i,a),ha}function pa(){let e=Be();const t=De();return Hg()?zg():(e=e.parent,Tr(e,!1)),t.firstCreatePass&&(_d(t,e),Og(e)&&t.queries.elementEnd(e)),pa}let XI=(e,t,r,i)=>(xr(!0),Pm(t[ie],""));function Vs(){return N()}function qy(e,t,r){const i=N();if(ft(i,ir(),t)){const o=De(),a=Ze();yn(o,a,i,e,t,KC(Gg(o.data),a,i),r,!0)}return qy}const ma="en-US";let rT=ma;function kn(e,t,r,i){const s=N(),o=De(),a=Be();return function Zy(e,t,r,i,s,o,a){const c=yd(i),u=e.firstCreatePass&&ZC(e),d=t[We],f=WC(t);let h=!0;if(3&i.type||a){const m=tn(i,t),y=a?a(m):m,v=f.length,w=a?b=>a(je(b[i.index])):i.index;let _=null;if(!a&&c&&(_=function lj(e,t,r,i){const s=e.cleanup;if(null!=s)for(let o=0;ol?c[l]:null}"string"==typeof a&&(o+=2)}return null}(e,t,s,i.index)),null!==_)(_.__ngLastListenerFn__||_).__ngNextListenerFn__=o,_.__ngLastListenerFn__=o,h=!1;else{o=NT(i,t,d,o,!1);const b=r.listen(y,s,o);f.push(o,b),u&&u.push(s,w,v,v+1)}}else o=NT(i,t,d,o,!1);const p=i.outputs;let g;if(h&&null!==p&&(g=p[s])){const m=g.length;if(m)for(let y=0;y-1?An(e.index,t):t);let l=MT(t,r,i,a),u=o.__ngNextListenerFn__;for(;u;)l=MT(t,r,u,a)&&l,u=u.__ngNextListenerFn__;return s&&!1===l&&a.preventDefault(),l}}function It(e=1){return function cL(e){return(se.lFrame.contextLView=function jE(e,t){for(;e>0;)t=t[Mo],e--;return t}(e,se.lFrame.contextLView))[We]}(e)}function Yy(){return function _y(e,t){return e[ai].queries[t].queryList}(N(),Wg())}function xf(e){return Oo(function rL(){return se.lFrame.contextLView}(),fe+e)}function at(e,t=""){const r=N(),i=De(),s=e+fe,o=i.firstCreatePass?qo(i,s,1,t,null):i.data[s],a=JT(i,r,o,t,e);r[s]=a,Oc()&&Wd(i,r,a,o),Tr(o,!1)}let JT=(e,t,r,i,s)=>(xr(!0),function km(e,t){return e.createText(t)}(t[ie],i));function Af(e){return Fr("",e,""),Af}function Fr(e,t,r){const i=N(),s=function ra(e,t,r,i){return ft(e,ir(),r)?t+de(r)+i:he}(i,e,t,r);return s!==he&&function hi(e,t,r){const i=Ac(t,e);!function _C(e,t,r){e.setValue(t,r)}(e[ie],i,r)}(i,zt(),s),Fr}let kj=(()=>{class e{constructor(r){this._injector=r,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(r){if(!r.standalone)return null;if(!this.cachedInjectors.has(r)){const i=Dg(0,r.type),s=i.length>0?hf([i],this._injector,`Standalone[${r.type.name}]`):null;this.cachedInjectors.set(r,s)}return this.cachedInjectors.get(r)}ngOnDestroy(){try{for(const r of this.cachedInjectors.values())null!==r&&r.destroy()}finally{this.cachedInjectors.clear()}}static#e=this.\u0275prov=z({token:e,providedIn:"environment",factory:()=>new e(G(gn))})}return e})();function Mf(e){Rr("NgStandalone"),e.getStandaloneInjector=t=>t.get(kj).getOrCreateStandaloneInjector(e)}function d1(e,t,r,i,s,o){const a=t+r;return ft(e,a,s)?function Or(e,t,r){return e[t]=r}(e,a+1,o?i.call(o,s):i(s)):function Cl(e,t){const r=e[t];return r===he?void 0:r}(e,a+1)}function y1(e,t,r){const i=e+fe,s=N(),o=Oo(s,i);return function Sl(e,t){return e[F].data[t].pure}(s,i)?d1(s,function nn(){const e=se.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}(),t,o.transform,r,o):o.transform(r)}let O1=(()=>{class e{log(r){console.log(r)}warn(r){console.warn(r)}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();const B1=new K(""),Pf=new K("");let lv,av=(()=>{class e{constructor(r,i,s){this._ngZone=r,this.registry=i,this._pendingCount=0,this._isZoneStable=!0,this._callbacks=[],this.taskTrackingZone=null,lv||(function q6(e){lv=e}(s),s.addToWindow(i)),this._watchAngularEvents(),r.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Ne.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;0!==this._callbacks.length;){let r=this._callbacks.pop();clearTimeout(r.timeoutId),r.doneCb()}});else{let r=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(r)||(clearTimeout(i.timeoutId),!1))}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(r=>({source:r.source,creationLocation:r.creationLocation,data:r.data})):[]}addCallback(r,i,s){let o=-1;i&&i>0&&(o=setTimeout(()=>{this._callbacks=this._callbacks.filter(a=>a.timeoutId!==o),r()},i)),this._callbacks.push({doneCb:r,timeoutId:o,updateCb:s})}whenStable(r,i,s){if(s&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(r,i,s),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}registerApplication(r){this.registry.registerApplication(r,this)}unregisterApplication(r){this.registry.unregisterApplication(r)}findProviders(r,i,s){return[]}static#e=this.\u0275fac=function(i){return new(i||e)(G(Ne),G(cv),G(Pf))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})(),cv=(()=>{class e{constructor(){this._applications=new Map}registerApplication(r,i){this._applications.set(r,i)}unregisterApplication(r){this._applications.delete(r)}unregisterAllApplications(){this._applications.clear()}getTestability(r){return this._applications.get(r)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(r,i=!0){return lv?.findTestabilityInTree(this,r,i)??null}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();function Lf(e){return!!e&&"function"==typeof e.then}function U1(e){return!!e&&"function"==typeof e.subscribe}const uv=new K("");let dv=(()=>{class e{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,i)=>{this.resolve=r,this.reject=i}),this.appInits=P(uv,{optional:!0})??[]}runInitializers(){if(this.initialized)return;const r=[];for(const s of this.appInits){const o=s();if(Lf(o))r.push(o);else if(U1(o)){const a=new Promise((c,l)=>{o.subscribe({complete:c,error:l})});r.push(a)}}const i=()=>{this.done=!0,this.resolve()};Promise.all(r).then(()=>{i()}).catch(s=>{this.reject(s)}),0===r.length&&i(),this.initialized=!0}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const fv=new K("");function V1(e,t){return Array.isArray(t)?t.reduce(V1,e):{...e,...t}}let Br=(()=>{class e{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=P(wD),this.afterRenderEffectManager=P(ol),this.externalTestViews=new Set,this.beforeRender=new ot,this.afterTick=new ot,this.componentTypes=[],this.components=[],this.isStable=P(Ko).hasPendingTasks.pipe(Ue(r=>!r)),this._injector=P(gn)}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(r,i){const s=r instanceof lS;if(!this._injector.get(dv).done)throw!s&&function Ui(e){const t=we(e)||Et(e)||kt(e);return null!==t&&t.standalone}(r),new M(405,!1);let a;a=s?r:this._injector.get(sl).resolveComponentFactory(r),this.componentTypes.push(a.componentType);const c=function G6(e){return e.isBoundToModule}(a)?void 0:this._injector.get(Bs),u=a.create(qt.NULL,[],i||a.selector,c),d=u.location.nativeElement,f=u.injector.get(B1,null);return f?.registerApplication(d),u.onDestroy(()=>{this.detachView(u.hostView),Ff(this.components,u),f?.unregisterApplication(d)}),this._loadComponent(u),u}tick(){this._tick(!0)}_tick(r){if(this._runningTick)throw new M(101,!1);const i=me(null);try{this._runningTick=!0,this.detectChangesInAttachedViews(r)}catch(s){this.internalErrorHandler(s)}finally{this.afterTick.next(),this._runningTick=!1,me(i)}}detectChangesInAttachedViews(r){let i=0;const s=this.afterRenderEffectManager;for(;;){if(i===XC)throw new M(103,!1);if(r){const o=0===i;this.beforeRender.next(o);for(let{_lView:a,notifyErrorHandler:c}of this._views)Z6(a,o,c)}if(i++,s.executeInternalCallbacks(),![...this.externalTestViews.keys(),...this._views].some(({_lView:o})=>hv(o))&&(s.execute(),![...this.externalTestViews.keys(),...this._views].some(({_lView:o})=>hv(o))))break}}attachView(r){const i=r;this._views.push(i),i.attachToAppRef(this)}detachView(r){const i=r;Ff(this._views,i),i.detachFromAppRef()}_loadComponent(r){this.attachView(r.hostView),this.tick(),this.components.push(r);const i=this._injector.get(fv,[]);[...this._bootstrapListeners,...i].forEach(s=>s(r))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(r=>r()),this._views.slice().forEach(r=>r.destroy())}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(r){return this._destroyListeners.push(r),()=>Ff(this._destroyListeners,r)}destroy(){if(this._destroyed)throw new M(406,!1);const r=this._injector;r.destroy&&!r.destroyed&&r.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Ff(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}function Z6(e,t,r){!t&&!hv(e)||function K6(e,t,r){let i;r?(i=0,e[ee]|=1024):i=64&e[ee]?0:1,Jd(e,t,i)}(e,r,t)}function hv(e){return jg(e)}class Q6{constructor(t,r){this.ngModuleFactory=t,this.componentFactories=r}}let H1=(()=>{class e{compileModuleSync(r){return new Cy(r)}compileModuleAsync(r){return Promise.resolve(this.compileModuleSync(r))}compileModuleAndAllComponentsSync(r){const i=this.compileModuleSync(r),o=Rn(jt(r).declarations).reduce((a,c)=>{const l=we(c);return l&&a.push(new ll(l)),a},[]);return new Q6(i,o)}compileModuleAndAllComponentsAsync(r){return Promise.resolve(this.compileModuleAndAllComponentsSync(r))}clearCache(){}clearCacheFor(r){}getModuleId(r){}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),X6=(()=>{class e{constructor(){this.zone=P(Ne),this.applicationRef=P(Br)}initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function e$(){const e=P(Ne),t=P($n);return r=>e.runOutsideAngular(()=>t.handleError(r))}let n$=(()=>{class e{constructor(){this.subscription=new Rt,this.initialized=!1,this.zone=P(Ne),this.pendingTasks=P(Ko)}initialize(){if(this.initialized)return;this.initialized=!0;let r=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(r=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{Ne.assertNotInAngularZone(),queueMicrotask(()=>{null!==r&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(r),r=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{Ne.assertInAngularZone(),r??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const yi=new K("",{providedIn:"root",factory:()=>P(yi,Ee.Optional|Ee.SkipSelf)||function r$(){return typeof $localize<"u"&&$localize.locale||ma}()}),pv=new K("");let W1=(()=>{class e{constructor(r){this._injector=r,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(r,i){const s=function BB(e="zone.js",t){return"noop"===e?new gS:"zone.js"===e?new Ne(t):e}(i?.ngZone,function G1(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:e?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:e?.runCoalescing??!1}}({eventCoalescing:i?.ngZoneEventCoalescing,runCoalescing:i?.ngZoneRunCoalescing}));return s.run(()=>{const o=function A8(e,t,r){return new Dy(e,t,r)}(r.moduleType,this.injector,function q1(e){return[{provide:Ne,useFactory:e},{provide:Is,multi:!0,useFactory:()=>{const t=P(X6,{optional:!0});return()=>t.initialize()}},{provide:Is,multi:!0,useFactory:()=>{const t=P(n$);return()=>{t.initialize()}}},{provide:wD,useFactory:e$}]}(()=>s)),a=o.injector.get($n,null);return s.runOutsideAngular(()=>{const c=s.onError.subscribe({next:l=>{a.handleError(l)}});o.onDestroy(()=>{Ff(this._modules,o),c.unsubscribe()})}),function $1(e,t,r){try{const i=r();return Lf(i)?i.catch(s=>{throw t.runOutsideAngular(()=>e.handleError(s)),s}):i}catch(i){throw t.runOutsideAngular(()=>e.handleError(i)),i}}(a,s,()=>{const c=o.injector.get(dv);return c.runInitializers(),c.donePromise.then(()=>(function iT(e){"string"==typeof e&&(rT=e.toLowerCase().replace(/_/g,"-"))}(o.injector.get(yi,ma)||ma),this._moduleDoBootstrap(o),o))})})}bootstrapModule(r,i=[]){const s=V1({},i);return function J6(e,t,r){const i=new Cy(r);return Promise.resolve(i)}(0,0,r).then(o=>this.bootstrapModuleFactory(o,s))}_moduleDoBootstrap(r){const i=r.injector.get(Br);if(r._bootstrapComponents.length>0)r._bootstrapComponents.forEach(s=>i.bootstrap(s));else{if(!r.instance.ngDoBootstrap)throw new M(-403,!1);r.instance.ngDoBootstrap(i)}this._modules.push(r)}onDestroy(r){this._destroyListeners.push(r)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new M(404,!1);this._modules.slice().forEach(i=>i.destroy()),this._destroyListeners.forEach(i=>i());const r=this._injector.get(pv,null);r&&(r.forEach(i=>i()),r.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}static#e=this.\u0275fac=function(i){return new(i||e)(G(qt))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})(),Zi=null;const Z1=new K("");function K1(e,t,r=[]){const i=`Platform: ${t}`,s=new K(i);return(o=[])=>{let a=gv();if(!a||a.injector.get(Z1,!1)){const c=[...r,...o,{provide:s,useValue:!0}];e?e(c):function o$(e){if(Zi&&!Zi.get(Z1,!1))throw new M(400,!1);(function j1(){!function hk(e){Fb=e}(()=>{throw new M(600,!1)})})(),Zi=e;const t=e.get(W1);(function Y1(e){e.get($D,null)?.forEach(r=>r())})(e)}(function Q1(e=[],t){return qt.create({name:t,providers:[{provide:Ig,useValue:"platform"},{provide:pv,useValue:new Set([()=>Zi=null])},...e]})}(c,i))}return function a$(e){const t=gv();if(!t)throw new M(401,!1);return t}()}}function gv(){return Zi?.get(W1)??null}let Uf=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=l$}return e})();function l$(e){return function u$(e,t,r){if(As(e)&&!r){const i=An(e.index,t);return new el(i,i)}return 47&e.type?new el(t[it],t):null}(Be(),N(),!(16&~e))}class nx{constructor(){}supports(t){return gf(t)}create(t){return new g$(t)}}const p$=(e,t)=>t;class g${constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||p$}forEachItem(t){let r;for(r=this._itHead;null!==r;r=r._next)t(r)}forEachOperation(t){let r=this._itHead,i=this._removalsHead,s=0,o=null;for(;r||i;){const a=!i||r&&r.currentIndex{a=this._trackByFn(s,c),null!==r&&Object.is(r.trackById,a)?(i&&(r=this._verifyReinsertion(r,c,a,s)),Object.is(r.item,c)||this._addIdentityChange(r,c)):(r=this._mismatch(r,c,a,s),i=!0),r=r._next,s++}),this.length=s;return this._truncate(r),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,r,i,s){let o;return null===t?o=this._itTail:(o=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(t.item,r)||this._addIdentityChange(t,r),this._reinsertAfter(t,o,s)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(i,s))?(Object.is(t.item,r)||this._addIdentityChange(t,r),this._moveAfter(t,o,s)):t=this._addAfter(new m$(r,i),o,s),t}_verifyReinsertion(t,r,i,s){let o=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==o?t=this._reinsertAfter(o,t._prev,s):t.currentIndex!=s&&(t.currentIndex=s,this._addToMoves(t,s)),t}_truncate(t){for(;null!==t;){const r=t._next;this._addToRemovals(this._unlink(t)),t=r}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,r,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const s=t._prevRemoved,o=t._nextRemoved;return null===s?this._removalsHead=o:s._nextRemoved=o,null===o?this._removalsTail=s:o._prevRemoved=s,this._insertAfter(t,r,i),this._addToMoves(t,i),t}_moveAfter(t,r,i){return this._unlink(t),this._insertAfter(t,r,i),this._addToMoves(t,i),t}_addAfter(t,r,i){return this._insertAfter(t,r,i),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,r,i){const s=null===r?this._itHead:r._next;return t._next=s,t._prev=r,null===s?this._itTail=t:s._prev=t,null===r?this._itHead=t:r._next=t,null===this._linkedRecords&&(this._linkedRecords=new rx),this._linkedRecords.put(t),t.currentIndex=i,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const r=t._prev,i=t._next;return null===r?this._itHead=i:r._next=i,null===i?this._itTail=r:i._prev=r,t}_addToMoves(t,r){return t.previousIndex===r||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new rx),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,r){return t.item=r,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class m${constructor(t,r){this.item=t,this.trackById=r,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class y${constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,r){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===r||r<=i.currentIndex)&&Object.is(i.trackById,t))return i;return null}remove(t){const r=t._prevDup,i=t._nextDup;return null===r?this._head=i:r._nextDup=i,null===i?this._tail=r:i._prevDup=r,null===this._head}}class rx{constructor(){this.map=new Map}put(t){const r=t.trackById;let i=this.map.get(r);i||(i=new y$,this.map.set(r,i)),i.add(t)}get(t,r){const s=this.map.get(t);return s?s.get(t,r):null}remove(t){const r=t.trackById;return this.map.get(r).remove(t)&&this.map.delete(r),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function ix(e,t,r){const i=e.previousIndex;if(null===i)return i;let s=0;return r&&i{class e{static#e=this.\u0275prov=z({token:e,providedIn:"root",factory:ox});constructor(r){this.factories=r}static create(r,i){if(null!=i){const s=i.factories.slice();r=r.concat(s)}return new e(r)}static extend(r){return{provide:e,useFactory:i=>e.create(r,i||ox()),deps:[[e,new id,new rd]]}}find(r){const i=this.factories.find(s=>s.supports(r));if(null!=i)return i;throw new M(901,!1)}}return e})();const E$=K1(null,"core",[]);let D$=(()=>{class e{constructor(r){}static#e=this.\u0275fac=function(i){return new(i||e)(G(Br))};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({})}return e})(),Mx=null;function _a(){return Mx}class oV{}const Wt=new K("");let Cv=(()=>{class e{historyGo(r){throw new Error("")}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>P(cV),providedIn:"platform"})}return e})();const aV=new K("");let cV=(()=>{class e extends Cv{constructor(){super(),this._doc=P(Wt),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return _a().getBaseHref(this._doc)}onPopState(r){const i=_a().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",r,!1),()=>i.removeEventListener("popstate",r)}onHashChange(r){const i=_a().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",r,!1),()=>i.removeEventListener("hashchange",r)}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(r){this._location.pathname=r}pushState(r,i,s){this._history.pushState(r,i,s)}replaceState(r,i,s){this._history.replaceState(r,i,s)}forward(){this._history.forward()}back(){this._history.back()}historyGo(r=0){this._history.go(r)}getState(){return this._history.state}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>new e,providedIn:"platform"})}return e})();function Sv(e,t){if(0==e.length)return t;if(0==t.length)return e;let r=0;return e.endsWith("/")&&r++,t.startsWith("/")&&r++,2==r?e+t.substring(1):1==r?e+t:e+"/"+t}function Nx(e){const t=e.match(/#|\?|$/),r=t&&t.index||e.length;return e.slice(0,r-("/"===e[r-1]?1:0))+e.slice(r)}function vi(e){return e&&"?"!==e[0]?"?"+e:e}let qs=(()=>{class e{historyGo(r){throw new Error("")}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>P(Ox),providedIn:"root"})}return e})();const Rx=new K("");let Ox=(()=>{class e extends qs{constructor(r,i){super(),this._platformLocation=r,this._removeListenerFns=[],this._baseHref=i??this._platformLocation.getBaseHrefFromDOM()??P(Wt).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(r){this._removeListenerFns.push(this._platformLocation.onPopState(r),this._platformLocation.onHashChange(r))}getBaseHref(){return this._baseHref}prepareExternalUrl(r){return Sv(this._baseHref,r)}path(r=!1){const i=this._platformLocation.pathname+vi(this._platformLocation.search),s=this._platformLocation.hash;return s&&r?`${i}${s}`:i}pushState(r,i,s,o){const a=this.prepareExternalUrl(s+vi(o));this._platformLocation.pushState(r,i,a)}replaceState(r,i,s,o){const a=this.prepareExternalUrl(s+vi(o));this._platformLocation.replaceState(r,i,a)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}static#e=this.\u0275fac=function(i){return new(i||e)(G(Cv),G(Rx,8))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),lV=(()=>{class e extends qs{constructor(r,i){super(),this._platformLocation=r,this._baseHref="",this._removeListenerFns=[],null!=i&&(this._baseHref=i)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(r){this._removeListenerFns.push(this._platformLocation.onPopState(r),this._platformLocation.onHashChange(r))}getBaseHref(){return this._baseHref}path(r=!1){const i=this._platformLocation.hash??"#";return i.length>0?i.substring(1):i}prepareExternalUrl(r){const i=Sv(this._baseHref,r);return i.length>0?"#"+i:i}pushState(r,i,s,o){let a=this.prepareExternalUrl(s+vi(o));0==a.length&&(a=this._platformLocation.pathname),this._platformLocation.pushState(r,i,a)}replaceState(r,i,s,o){let a=this.prepareExternalUrl(s+vi(o));0==a.length&&(a=this._platformLocation.pathname),this._platformLocation.replaceState(r,i,a)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}static#e=this.\u0275fac=function(i){return new(i||e)(G(Cv),G(Rx,8))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})(),Ml=(()=>{class e{constructor(r){this._subject=new rn,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=r;const i=this._locationStrategy.getBaseHref();this._basePath=function fV(e){if(new RegExp("^(https?:)?//").test(e)){const[,r]=e.split(/\/\/[^\/]+/);return r}return e}(Nx(kx(i))),this._locationStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(r=!1){return this.normalize(this._locationStrategy.path(r))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(r,i=""){return this.path()==this.normalize(r+vi(i))}normalize(r){return e.stripTrailingSlash(function dV(e,t){if(!e||!t.startsWith(e))return t;const r=t.substring(e.length);return""===r||["/",";","?","#"].includes(r[0])?r:t}(this._basePath,kx(r)))}prepareExternalUrl(r){return r&&"/"!==r[0]&&(r="/"+r),this._locationStrategy.prepareExternalUrl(r)}go(r,i="",s=null){this._locationStrategy.pushState(s,"",r,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+vi(i)),s)}replaceState(r,i="",s=null){this._locationStrategy.replaceState(s,"",r,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+vi(i)),s)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(r=0){this._locationStrategy.historyGo?.(r)}onUrlChange(r){return this._urlChangeListeners.push(r),this._urlChangeSubscription??=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}),()=>{const i=this._urlChangeListeners.indexOf(r);this._urlChangeListeners.splice(i,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(r="",i){this._urlChangeListeners.forEach(s=>s(r,i))}subscribe(r,i,s){return this._subject.subscribe({next:r,error:i,complete:s})}static#e=this.normalizeQueryParams=vi;static#t=this.joinWithSlash=Sv;static#r=this.stripTrailingSlash=Nx;static#h=this.\u0275fac=function(i){return new(i||e)(G(qs))};static#T=this.\u0275prov=z({token:e,factory:()=>function uV(){return new Ml(G(qs))}(),providedIn:"root"})}return e})();function kx(e){return e.replace(/\/index.html$/,"")}class XV{constructor(t,r,i,s){this.$implicit=t,this.ngForOf=r,this.index=i,this.count=s}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let qx=(()=>{class e{set ngForOf(r){this._ngForOf=r,this._ngForOfDirty=!0}set ngForTrackBy(r){this._trackByFn=r}get ngForTrackBy(){return this._trackByFn}constructor(r,i,s){this._viewContainer=r,this._template=i,this._differs=s,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForTemplate(r){r&&(this._template=r)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const r=this._ngForOf;!this._differ&&r&&(this._differ=this._differs.find(r).create(this.ngForTrackBy))}if(this._differ){const r=this._differ.diff(this._ngForOf);r&&this._applyChanges(r)}}_applyChanges(r){const i=this._viewContainer;r.forEachOperation((s,o,a)=>{if(null==s.previousIndex)i.createEmbeddedView(this._template,new XV(s.item,this._ngForOf,-1,-1),null===a?void 0:a);else if(null==a)i.remove(null===o?void 0:o);else if(null!==o){const c=i.get(o);i.move(c,a),Gx(c,s)}});for(let s=0,o=i.length;s{Gx(i.get(s.currentIndex),s)})}static ngTemplateContextGuard(r,i){return!0}static#e=this.\u0275fac=function(i){return new(i||e)(X(or),X(pi),X(_v))};static#t=this.\u0275dir=Xt({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0})}return e})();function Gx(e,t){e.context.$implicit=t.item}let sh=(()=>{class e{constructor(r,i){this._viewContainer=r,this._context=new e5,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(r){this._context.$implicit=this._context.ngIf=r,this._updateView()}set ngIfThen(r){Wx("ngIfThen",r),this._thenTemplateRef=r,this._thenViewRef=null,this._updateView()}set ngIfElse(r){Wx("ngIfElse",r),this._elseTemplateRef=r,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 ngTemplateContextGuard(r,i){return!0}static#e=this.\u0275fac=function(i){return new(i||e)(X(or),X(pi))};static#t=this.\u0275dir=Xt({type:e,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},standalone:!0})}return e})();class e5{constructor(){this.$implicit=null,this.ngIf=null}}function Wx(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${bt(t)}'.`)}let Ea=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({})}return e})();const Qx="browser";function Yx(e){return"server"===e}let M5=(()=>{class e{static#e=this.\u0275prov=z({token:e,providedIn:"root",factory:()=>function A5(e){return e===Qx}(P(ks))?new N5(P(Wt),window):new O5})}return e})();class N5{constructor(t,r){this.document=t,this.window=r,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return[this.window.scrollX,this.window.scrollY]}scrollToPosition(t){this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){const r=function R5(e,t){const r=e.getElementById(t)||e.getElementsByName(t)[0];if(r)return r;if("function"==typeof e.createTreeWalker&&e.body&&"function"==typeof e.body.attachShadow){const i=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT);let s=i.currentNode;for(;s;){const o=s.shadowRoot;if(o){const a=o.getElementById(t)||o.querySelector(`[name="${t}"]`);if(a)return a}s=i.nextNode()}}return null}(this.document,t);r&&(this.scrollToElement(r),r.focus())}setHistoryScrollRestoration(t){this.window.history.scrollRestoration=t}scrollToElement(t){const r=t.getBoundingClientRect(),i=r.left+this.window.pageXOffset,s=r.top+this.window.pageYOffset,o=this.offset();this.window.scrollTo(i-o[0],s-o[1])}}class O5{setOffset(t){}getScrollPosition(){return[0,0]}scrollToPosition(t){}scrollToAnchor(t){}setHistoryScrollRestoration(t){}}class cH extends oV{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class $v extends cH{static makeCurrent(){!function sV(e){Mx??=e}(new $v)}onAndCancel(t,r,i){return t.addEventListener(r,i),()=>{t.removeEventListener(r,i)}}dispatchEvent(t,r){t.dispatchEvent(r)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,r){return(r=r||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,r){return"window"===r?window:"document"===r?t:"body"===r?t.body:null}getBaseHref(t){const r=function lH(){return kl=kl||document.querySelector("base"),kl?kl.getAttribute("href"):null}();return null==r?null:function uH(e){return new URL(e,document.baseURI).pathname}(r)}resetBaseElement(){kl=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return function QV(e,t){t=encodeURIComponent(t);for(const r of e.split(";")){const i=r.indexOf("="),[s,o]=-1==i?[r,""]:[r.slice(0,i),r.slice(i+1)];if(s.trim()===t)return decodeURIComponent(o)}return null}(document.cookie,t)}}let kl=null,fH=(()=>{class e{build(){return new XMLHttpRequest}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();const Vv=new K("");let oA=(()=>{class e{constructor(r,i){this._zone=i,this._eventNameToPlugin=new Map,r.forEach(s=>{s.manager=this}),this._plugins=r.slice().reverse()}addEventListener(r,i,s){return this._findPluginFor(i).addEventListener(r,i,s)}getZone(){return this._zone}_findPluginFor(r){let i=this._eventNameToPlugin.get(r);if(i)return i;if(i=this._plugins.find(o=>o.supports(r)),!i)throw new M(5101,!1);return this._eventNameToPlugin.set(r,i),i}static#e=this.\u0275fac=function(i){return new(i||e)(G(Vv),G(Ne))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();class aA{constructor(t){this._doc=t}}const Hv="ng-app-id";let cA=(()=>{class e{constructor(r,i,s,o={}){this.doc=r,this.appId=i,this.nonce=s,this.platformId=o,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=Yx(o),this.resetHostNodes()}addStyles(r){for(const i of r)1===this.changeUsageCount(i,1)&&this.onStyleAdded(i)}removeStyles(r){for(const i of r)this.changeUsageCount(i,-1)<=0&&this.onStyleRemoved(i)}ngOnDestroy(){const r=this.styleNodesInDOM;r&&(r.forEach(i=>i.remove()),r.clear());for(const i of this.getAllStyles())this.onStyleRemoved(i);this.resetHostNodes()}addHost(r){this.hostNodes.add(r);for(const i of this.getAllStyles())this.addStyleToHost(r,i)}removeHost(r){this.hostNodes.delete(r)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(r){for(const i of this.hostNodes)this.addStyleToHost(i,r)}onStyleRemoved(r){const i=this.styleRef;i.get(r)?.elements?.forEach(s=>s.remove()),i.delete(r)}collectServerRenderedStyles(){const r=this.doc.head?.querySelectorAll(`style[${Hv}="${this.appId}"]`);if(r?.length){const i=new Map;return r.forEach(s=>{null!=s.textContent&&i.set(s.textContent,s)}),i}return null}changeUsageCount(r,i){const s=this.styleRef;if(s.has(r)){const o=s.get(r);return o.usage+=i,o.usage}return s.set(r,{usage:i,elements:[]}),i}getStyleElement(r,i){const s=this.styleNodesInDOM,o=s?.get(i);if(o?.parentNode===r)return s.delete(i),o.removeAttribute(Hv),o;{const a=this.doc.createElement("style");return this.nonce&&a.setAttribute("nonce",this.nonce),a.textContent=i,this.platformIsServer&&a.setAttribute(Hv,this.appId),r.appendChild(a),a}}addStyleToHost(r,i){const s=this.getStyleElement(r,i),o=this.styleRef,a=o.get(i)?.elements;a?a.push(s):o.set(i,{elements:[s],usage:1})}resetHostNodes(){const r=this.hostNodes;r.clear(),r.add(this.doc.head)}static#e=this.\u0275fac=function(i){return new(i||e)(G(Wt),G(Nd),G(HD,8),G(ks))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();const zv={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/MathML/"},qv=/%COMP%/g,mH=new K("",{providedIn:"root",factory:()=>!0});function uA(e,t){return t.map(r=>r.replace(qv,e))}let Gv=(()=>{class e{constructor(r,i,s,o,a,c,l,u=null){this.eventManager=r,this.sharedStylesHost=i,this.appId=s,this.removeStylesOnCompDestroy=o,this.doc=a,this.platformId=c,this.ngZone=l,this.nonce=u,this.rendererByCompId=new Map,this.platformIsServer=Yx(c),this.defaultRenderer=new Wv(r,a,l,this.platformIsServer)}createRenderer(r,i){if(!r||!i)return this.defaultRenderer;this.platformIsServer&&i.encapsulation===Jn.ShadowDom&&(i={...i,encapsulation:Jn.Emulated});const s=this.getOrCreateRenderer(r,i);return s instanceof fA?s.applyToHost(r):s instanceof Zv&&s.applyStyles(),s}getOrCreateRenderer(r,i){const s=this.rendererByCompId;let o=s.get(i.id);if(!o){const a=this.doc,c=this.ngZone,l=this.eventManager,u=this.sharedStylesHost,d=this.removeStylesOnCompDestroy,f=this.platformIsServer;switch(i.encapsulation){case Jn.Emulated:o=new fA(l,u,i,this.appId,d,a,c,f);break;case Jn.ShadowDom:return new _H(l,u,r,i,a,c,this.nonce,f);default:o=new Zv(l,u,i,d,a,c,f)}s.set(i.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}static#e=this.\u0275fac=function(i){return new(i||e)(G(oA),G(cA),G(Nd),G(mH),G(Wt),G(ks),G(Ne),G(HD))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();class Wv{constructor(t,r,i,s){this.eventManager=t,this.doc=r,this.ngZone=i,this.platformIsServer=s,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(t,r){return r?this.doc.createElementNS(zv[r]||r,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,r){(dA(t)?t.content:t).appendChild(r)}insertBefore(t,r,i){t&&(dA(t)?t.content:t).insertBefore(r,i)}removeChild(t,r){t&&t.removeChild(r)}selectRootElement(t,r){let i="string"==typeof t?this.doc.querySelector(t):t;if(!i)throw new M(-5104,!1);return r||(i.textContent=""),i}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,r,i,s){if(s){r=s+":"+r;const o=zv[s];o?t.setAttributeNS(o,r,i):t.setAttribute(r,i)}else t.setAttribute(r,i)}removeAttribute(t,r,i){if(i){const s=zv[i];s?t.removeAttributeNS(s,r):t.removeAttribute(`${i}:${r}`)}else t.removeAttribute(r)}addClass(t,r){t.classList.add(r)}removeClass(t,r){t.classList.remove(r)}setStyle(t,r,i,s){s&(Hi.DashCase|Hi.Important)?t.style.setProperty(r,i,s&Hi.Important?"important":""):t.style[r]=i}removeStyle(t,r,i){i&Hi.DashCase?t.style.removeProperty(r):t.style[r]=""}setProperty(t,r,i){null!=t&&(t[r]=i)}setValue(t,r){t.nodeValue=r}listen(t,r,i){if("string"==typeof t&&!(t=_a().getGlobalEventTarget(this.doc,t)))throw new Error(`Unsupported event target ${t} for event ${r}`);return this.eventManager.addEventListener(t,r,this.decoratePreventDefault(i))}decoratePreventDefault(t){return r=>{if("__ngUnwrap__"===r)return t;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>t(r)):t(r))&&r.preventDefault()}}}function dA(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}class _H extends Wv{constructor(t,r,i,s,o,a,c,l){super(t,o,a,l),this.sharedStylesHost=r,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const u=uA(s.id,s.styles);for(const d of u){const f=document.createElement("style");c&&f.setAttribute("nonce",c),f.textContent=d,this.shadowRoot.appendChild(f)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,r){return super.appendChild(this.nodeOrShadowRoot(t),r)}insertBefore(t,r,i){return super.insertBefore(this.nodeOrShadowRoot(t),r,i)}removeChild(t,r){return super.removeChild(this.nodeOrShadowRoot(t),r)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class Zv extends Wv{constructor(t,r,i,s,o,a,c,l){super(t,o,a,c),this.sharedStylesHost=r,this.removeStylesOnCompDestroy=s,this.styles=l?uA(l,i.styles):i.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}}class fA extends Zv{constructor(t,r,i,s,o,a,c,l){const u=s+"-"+i.id;super(t,r,i,o,a,c,l,u),this.contentAttr=function yH(e){return"_ngcontent-%COMP%".replace(qv,e)}(u),this.hostAttr=function vH(e){return"_nghost-%COMP%".replace(qv,e)}(u)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,r){const i=super.createElement(t,r);return super.setAttribute(i,this.contentAttr,""),i}}let bH=(()=>{class e extends aA{constructor(r){super(r)}supports(r){return!0}addEventListener(r,i,s){return r.addEventListener(i,s,!1),()=>this.removeEventListener(r,i,s)}removeEventListener(r,i,s){return r.removeEventListener(i,s)}static#e=this.\u0275fac=function(i){return new(i||e)(G(Wt))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();const hA=["alt","control","meta","shift"],EH={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},DH={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let CH=(()=>{class e extends aA{constructor(r){super(r)}supports(r){return null!=e.parseEventName(r)}addEventListener(r,i,s){const o=e.parseEventName(i),a=e.eventCallback(o.fullKey,s,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>_a().onAndCancel(r,o.domEventName,a))}static parseEventName(r){const i=r.toLowerCase().split("."),s=i.shift();if(0===i.length||"keydown"!==s&&"keyup"!==s)return null;const o=e._normalizeKey(i.pop());let a="",c=i.indexOf("code");if(c>-1&&(i.splice(c,1),a="code."),hA.forEach(u=>{const d=i.indexOf(u);d>-1&&(i.splice(d,1),a+=u+".")}),a+=o,0!=i.length||0===o.length)return null;const l={};return l.domEventName=s,l.fullKey=a,l}static matchEventFullKeyCode(r,i){let s=EH[r.key]||r.key,o="";return i.indexOf("code.")>-1&&(s=r.code,o="code."),!(null==s||!s)&&(s=s.toLowerCase()," "===s?s="space":"."===s&&(s="dot"),hA.forEach(a=>{a!==s&&(0,DH[a])(r)&&(o+=a+".")}),o+=s,o===i)}static eventCallback(r,i,s){return o=>{e.matchEventFullKeyCode(o,r)&&s.runGuarded(()=>i(o))}}static _normalizeKey(r){return"esc"===r?"escape":r}static#e=this.\u0275fac=function(i){return new(i||e)(G(Wt))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();const gA=[{provide:ks,useValue:Qx},{provide:$D,useValue:function SH(){$v.makeCurrent()},multi:!0},{provide:Wt,useFactory:function TH(){return function sF(e){dm=e}(document),document},deps:[]}],xH=K1(E$,"browser",gA),AH=new K(""),mA=[{provide:Pf,useClass:class dH{addToWindow(t){Pe.getAngularTestability=(i,s=!0)=>{const o=t.findTestabilityInTree(i,s);if(null==o)throw new M(5103,!1);return o},Pe.getAllAngularTestabilities=()=>t.getAllTestabilities(),Pe.getAllAngularRootElements=()=>t.getAllRootElements(),Pe.frameworkStabilizers||(Pe.frameworkStabilizers=[]),Pe.frameworkStabilizers.push(i=>{const s=Pe.getAllAngularTestabilities();let o=s.length;const a=function(){o--,0==o&&i()};s.forEach(c=>{c.whenStable(a)})})}findTestabilityInTree(t,r,i){return null==r?null:t.getTestability(r)??(i?_a().isShadowRoot(r)?this.findTestabilityInTree(t,r.host,!0):this.findTestabilityInTree(t,r.parentElement,!0):null)}},deps:[]},{provide:B1,useClass:av,deps:[Ne,cv,Pf]},{provide:av,useClass:av,deps:[Ne,cv,Pf]}],yA=[{provide:Ig,useValue:"root"},{provide:$n,useFactory:function IH(){return new $n},deps:[]},{provide:Vv,useClass:bH,multi:!0,deps:[Wt,Ne,ks]},{provide:Vv,useClass:CH,multi:!0,deps:[Wt]},Gv,cA,oA,{provide:sy,useExisting:Gv},{provide:class k5{},useClass:fH,deps:[]},[]];let vA=(()=>{class e{constructor(r){}static withServerTransition(r){return{ngModule:e,providers:[{provide:Nd,useValue:r.appId}]}}static#e=this.\u0275fac=function(i){return new(i||e)(G(AH,12))};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({providers:[...yA,...mA],imports:[Ea,D$]})}return e})(),MH=(()=>{class e{constructor(r){this._doc=r}getTitle(){return this._doc.title}setTitle(r){this._doc.title=r||""}static#e=this.\u0275fac=function(i){return new(i||e)(G(Wt))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),bA=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:function(i){let s=null;return s=i?new(i||e):G(kH),s},providedIn:"root"})}return e})(),kH=(()=>{class e extends bA{constructor(r){super(),this._doc=r}sanitize(r,i){if(null==i)return null;switch(r){case Nn.NONE:return i;case Nn.HTML:return Mr(i,"HTML")?Mn(i):cC(this._doc,String(i)).toString();case Nn.STYLE:return Mr(i,"Style")?Mn(i):i;case Nn.SCRIPT:if(Mr(i,"Script"))return Mn(i);throw new M(5200,!1);case Nn.URL:return Mr(i,"URL")?Mn(i):jd(String(i));case Nn.RESOURCE_URL:if(Mr(i,"ResourceURL"))return Mn(i);throw new M(5201,!1);default:throw new M(5202,!1)}}bypassSecurityTrustHtml(r){return function IF(e){return new _F(e)}(r)}bypassSecurityTrustStyle(r){return function TF(e){return new bF(e)}(r)}bypassSecurityTrustScript(r){return function xF(e){return new EF(e)}(r)}bypassSecurityTrustUrl(r){return function AF(e){return new DF(e)}(r)}bypassSecurityTrustResourceUrl(r){return function MF(e){return new CF(e)}(r)}static#e=this.\u0275fac=function(i){return new(i||e)(G(Wt))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Kv=(()=>{class e{constructor(){this.wannachatStatusDefaultTimeoutInSeconds=20}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})(),PH=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({providers:[Kv],imports:[Ea]})}return e})();function Qv(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Yv(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Ll(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const Jv="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Xv=e=>e instanceof Uint8Array,e0=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Ur=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function Fl(e){if("string"==typeof e&&(e=function UH(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!Xv(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class SA{clone(){return this._cloneInto()}}function VH(e){const t=i=>e().update(Fl(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function IA(e=32){if(Jv&&"function"==typeof Jv.getRandomValues)return Jv.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}class zH extends SA{constructor(t,r,i,s){super(),this.blockLen=t,this.outputLen=r,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=e0(this.buffer)}update(t){Ll(this);const{view:r,buffer:i,blockLen:s}=this,o=(t=Fl(t)).length;for(let a=0;as-a&&(this.process(i,0),a=0);for(let f=a;f>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)})(i,s-8,BigInt(8*this.length),o),this.process(i,0);const c=e0(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&r,GH=(e,t,r)=>e&t^e&r^t&r,WH=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ki=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Qi=new Uint32Array(64);class TA extends zH{constructor(){super(64,32,8,!1),this.A=0|Ki[0],this.B=0|Ki[1],this.C=0|Ki[2],this.D=0|Ki[3],this.E=0|Ki[4],this.F=0|Ki[5],this.G=0|Ki[6],this.H=0|Ki[7]}get(){const{A:t,B:r,C:i,D:s,E:o,F:a,G:c,H:l}=this;return[t,r,i,s,o,a,c,l]}set(t,r,i,s,o,a,c,l){this.A=0|t,this.B=0|r,this.C=0|i,this.D=0|s,this.E=0|o,this.F=0|a,this.G=0|c,this.H=0|l}process(t,r){for(let f=0;f<16;f++,r+=4)Qi[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=Qi[f-15],p=Qi[f-2],g=Ur(h,7)^Ur(h,18)^h>>>3,m=Ur(p,17)^Ur(p,19)^p>>>10;Qi[f]=m+Qi[f-7]+g+Qi[f-16]|0}let{A:i,B:s,C:o,D:a,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const p=d+(Ur(c,6)^Ur(c,11)^Ur(c,25))+qH(c,l,u)+WH[f]+Qi[f]|0,m=(Ur(i,2)^Ur(i,13)^Ur(i,22))+GH(i,s,o)|0;d=u,u=l,l=c,c=a+p|0,a=o,o=s,s=i,i=p+m|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(i,s,o,a,c,l,u,d)}roundClean(){Qi.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const n0=VH(()=>new TA),lh=(BigInt(0),BigInt(1)),ZH=BigInt(2),uh=e=>e instanceof Uint8Array,KH=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Da(e){if(!uh(e))throw new Error("Uint8Array expected");let t="";for(let r=0;ri+s.length,0));let r=0;return e.forEach(i=>{if(!uh(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}const o0=e=>(ZH<new Uint8Array(e),MA=e=>Uint8Array.from(e);function NA(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let i=a0(e),s=a0(e),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},c=(...f)=>r(s,i,...f),l=(f=a0())=>{s=c(MA([0]),f),i=c(),0!==f.length&&(s=c(MA([1]),f),i=c())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{let p;for(a(),l(f);!(p=h(u()));)l();return a(),p}}const YH={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function Bl(e,t,r={}){const i=(s,o,a)=>{const c=YH[o];if("function"!=typeof c)throw new Error(`Invalid validator "${o}", expected function`);const l=e[s];if(!(a&&void 0===l||c(l,e)))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${o}`)};for(const[s,o]of Object.entries(t))i(s,o,!1);for(const[s,o]of Object.entries(r))i(s,o,!0);return e}const xt=BigInt(0),ze=BigInt(1),Ji=BigInt(2),JH=BigInt(3),c0=BigInt(4),RA=BigInt(5),OA=BigInt(8);function At(e,t){const r=e%t;return r>=xt?r:t+r}function t9(e,t,r){if(r<=xt||t 0");if(r===ze)return xt;let i=ze;for(;t>xt;)t&ze&&(i=i*e%r),e=e*e%r,t>>=ze;return i}function Gn(e,t,r){let i=e;for(;t-- >xt;)i*=i,i%=r;return i}function dh(e,t){if(e===xt||t<=xt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=At(e,t),i=t,s=xt,o=ze,a=ze,c=xt;for(;r!==xt;){const u=i/r,d=i%r,f=s-a*u,h=o-c*u;i=r,r=d,s=a,o=c,a=f,c=h}if(i!==ze)throw new Error("invert: does not exist");return At(s,t)}BigInt(9),BigInt(16);const i9=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function l0(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function kA(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function PA(e){const t=kA(e);return t+Math.ceil(t/2)}class LA extends SA{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,function DA(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Qv(e.outputLen),Qv(e.blockLen)}(t);const i=Fl(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?t.create().update(i).digest():i);for(let a=0;anew LA(e,t).update(r).digest();FA.create=(e,t)=>new LA(e,t);const u9=BigInt(0),u0=BigInt(1);function BA(e){return function s9(e){Bl(e,i9.reduce((i,s)=>(i[s]="function",i),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(e.Fp),Bl(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...l0(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:h9,aT:p9}=gc,Ws={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Ws;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const r=e[1],i=e.subarray(2,r+2);if(!r||i.length!==r)throw new t("Invalid signature integer: wrong length");if(128&i[0])throw new t("Invalid signature integer: negative");if(0===i[0]&&!(128&i[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:h9(i),l:e.subarray(r+2)}},toSig(e){const{Err:t}=Ws,r="string"==typeof e?p9(e):e;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let i=r.length;if(i<2||48!=r[0])throw new t("Invalid signature tag");if(r[1]!==i-2)throw new t("Invalid signature: incorrect length");const{d:s,l:o}=Ws._parseInt(r.subarray(2)),{d:a,l:c}=Ws._parseInt(o);if(c.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(e){const t=u=>8&Number.parseInt(u[0],16)?"00"+u:u,r=u=>{const d=u.toString(16);return 1&d.length?`0${d}`:d},i=t(r(e.s)),s=t(r(e.r)),o=i.length/2,a=s.length/2,c=r(o),l=r(a);return`30${r(a+o+4)}02${l}${s}02${c}${i}`}},dr=BigInt(0),ct=BigInt(1),fh=(BigInt(2),BigInt(3));function y9(e){const t=function m9(e){const t=BA(e);return Bl(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:i}=t,s=r.BYTES+1,o=2*r.BYTES+1;function c(I){return At(I,i)}function l(I){return dh(I,i)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:h}=function g9(e){const t=function f9(e){const t=BA(e);Bl(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:i,a:s}=t;if(r){if(!i.eql(s,i.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,i=t.toBytes||((g,m,y)=>{const v=m.toAffine();return Gs(Uint8Array.from([4]),r.toBytes(v.x),r.toBytes(v.y))}),s=t.fromBytes||(g=>{const m=g.subarray(1);return{x:r.fromBytes(m.subarray(0,r.BYTES)),y:r.fromBytes(m.subarray(r.BYTES,2*r.BYTES))}});function o(g){const{a:m,b:y}=t,v=r.sqr(g),w=r.mul(v,g);return r.add(r.add(w,r.mul(g,m)),y)}if(!r.eql(r.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function a(g){return"bigint"==typeof g&&drr.eql(_,r.ZERO);return w(y)&&w(v)?f.ZERO:new f(y,v,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const y=r.invertBatch(m.map(v=>v.pz));return m.map((v,w)=>v.toAffine(y[w])).map(f.fromAffine)}static fromHex(m){const y=f.fromAffine(s(Zt("pointHex",m)));return y.assertValidity(),y}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:m,y}=this.toAffine();if(!r.isValid(m)||!r.isValid(y))throw new Error("bad point: x or y not FE");const v=r.sqr(y),w=o(m);if(!r.eql(v,w))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(r.isOdd)return!r.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){d(m);const{px:y,py:v,pz:w}=this,{px:_,py:b,pz:C}=m,D=r.eql(r.mul(y,C),r.mul(_,w)),S=r.eql(r.mul(v,C),r.mul(b,w));return D&&S}negate(){return new f(this.px,r.neg(this.py),this.pz)}double(){const{a:m,b:y}=t,v=r.mul(y,fh),{px:w,py:_,pz:b}=this;let C=r.ZERO,D=r.ZERO,S=r.ZERO,T=r.mul(w,w),O=r.mul(_,_),U=r.mul(b,b),B=r.mul(w,_);return B=r.add(B,B),S=r.mul(w,b),S=r.add(S,S),C=r.mul(m,S),D=r.mul(v,U),D=r.add(C,D),C=r.sub(O,D),D=r.add(O,D),D=r.mul(C,D),C=r.mul(B,C),S=r.mul(v,S),U=r.mul(m,U),B=r.sub(T,U),B=r.mul(m,B),B=r.add(B,S),S=r.add(T,T),T=r.add(S,T),T=r.add(T,U),T=r.mul(T,B),D=r.add(D,T),U=r.mul(_,b),U=r.add(U,U),T=r.mul(U,B),C=r.sub(C,T),S=r.mul(U,O),S=r.add(S,S),S=r.add(S,S),new f(C,D,S)}add(m){d(m);const{px:y,py:v,pz:w}=this,{px:_,py:b,pz:C}=m;let D=r.ZERO,S=r.ZERO,T=r.ZERO;const O=t.a,U=r.mul(t.b,fh);let B=r.mul(y,_),j=r.mul(v,b),Y=r.mul(w,C),k=r.add(y,v),I=r.add(_,b);k=r.mul(k,I),I=r.add(B,j),k=r.sub(k,I),I=r.add(y,w);let E=r.add(_,C);return I=r.mul(I,E),E=r.add(B,Y),I=r.sub(I,E),E=r.add(v,w),D=r.add(b,C),E=r.mul(E,D),D=r.add(j,Y),E=r.sub(E,D),T=r.mul(O,I),D=r.mul(U,Y),T=r.add(D,T),D=r.sub(j,T),T=r.add(j,T),S=r.mul(D,T),j=r.add(B,B),j=r.add(j,B),Y=r.mul(O,Y),I=r.mul(U,I),j=r.add(j,Y),Y=r.sub(B,Y),Y=r.mul(O,Y),I=r.add(I,Y),B=r.mul(j,I),S=r.add(S,B),B=r.mul(E,I),D=r.mul(k,D),D=r.sub(D,B),B=r.mul(k,j),T=r.mul(E,T),T=r.add(T,B),new f(D,S,T)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return p.wNAFCached(this,u,m,y=>{const v=r.invertBatch(y.map(w=>w.pz));return y.map((w,_)=>w.toAffine(v[_])).map(f.fromAffine)})}multiplyUnsafe(m){const y=f.ZERO;if(m===dr)return y;if(c(m),m===ct)return this;const{endo:v}=t;if(!v)return p.unsafeLadder(this,m);let{k1neg:w,k1:_,k2neg:b,k2:C}=v.splitScalar(m),D=y,S=y,T=this;for(;_>dr||C>dr;)_&ct&&(D=D.add(T)),C&ct&&(S=S.add(T)),T=T.double(),_>>=ct,C>>=ct;return w&&(D=D.negate()),b&&(S=S.negate()),S=new f(r.mul(S.px,v.beta),S.py,S.pz),D.add(S)}multiply(m){c(m);let v,w,y=m;const{endo:_}=t;if(_){const{k1neg:b,k1:C,k2neg:D,k2:S}=_.splitScalar(y);let{p:T,f:O}=this.wNAF(C),{p:U,f:B}=this.wNAF(S);T=p.constTimeNegate(b,T),U=p.constTimeNegate(D,U),U=new f(r.mul(U.px,_.beta),U.py,U.pz),v=T.add(U),w=O.add(B)}else{const{p:b,f:C}=this.wNAF(y);v=b,w=C}return f.normalizeZ([v,w])[0]}multiplyAndAddUnsafe(m,y,v){const w=f.BASE,_=(C,D)=>D!==dr&&D!==ct&&C.equals(w)?C.multiply(D):C.multiplyUnsafe(D),b=_(this,y).add(_(m,v));return b.is0()?void 0:b}toAffine(m){const{px:y,py:v,pz:w}=this,_=this.is0();null==m&&(m=_?r.ONE:r.inv(w));const b=r.mul(y,m),C=r.mul(v,m),D=r.mul(w,m);if(_)return{x:r.ZERO,y:r.ZERO};if(!r.eql(D,r.ONE))throw new Error("invZ was invalid");return{x:b,y:C}}isTorsionFree(){const{h:m,isTorsionFree:y}=t;if(m===ct)return!0;if(y)return y(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:y}=t;return m===ct?this:y?y(f,this):this.multiplyUnsafe(t.h)}toRawBytes(m=!0){return this.assertValidity(),i(f,this,m)}toHex(m=!0){return Da(this.toRawBytes(m))}}f.BASE=new f(t.Gx,t.Gy,r.ONE),f.ZERO=new f(r.ZERO,r.ONE,r.ZERO);const h=t.nBitLength,p=function d9(e,t){const r=(s,o)=>{const a=o.negate();return s?a:o},i=s=>({windows:Math.ceil(t/s)+1,windowSize:2**(s-1)});return{constTimeNegate:r,unsafeLadder(s,o){let a=e.ZERO,c=s;for(;o>u9;)o&u0&&(a=a.add(c)),c=c.double(),o>>=u0;return a},precomputeWindow(s,o){const{windows:a,windowSize:c}=i(o),l=[];let u=s,d=u;for(let f=0;f>=p,y>l&&(y-=h,a+=u0);const v=m,w=m+Math.abs(y)-1,b=y<0;0===y?d=d.add(r(g%2!=0,o[v])):u=u.add(r(b,o[w]))}return{p:u,f:d}},wNAFCached(s,o,a,c){const l=s._WINDOW_SIZE||1;let u=o.get(s);return u||(u=this.precomputeWindow(s,l),1!==l&&o.set(s,c(u))),this.wNAF(l,u,a)}}}(f,t.endo?Math.ceil(h/2):h);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:a}}({...t,toBytes(I,E,x){const R=E.toAffine(),A=r.toBytes(R.x),H=Gs;return x?H(Uint8Array.from([E.hasEvenY()?2:3]),A):H(Uint8Array.from([4]),A,r.toBytes(R.y))},fromBytes(I){const E=I.length,x=I[0],R=I.subarray(1);if(E!==s||2!==x&&3!==x){if(E===o&&4===x)return{x:r.fromBytes(R.subarray(0,r.BYTES)),y:r.fromBytes(R.subarray(r.BYTES,2*r.BYTES))};throw new Error(`Point of length ${E} was invalid. Expected ${s} compressed bytes or ${o} uncompressed bytes`)}{const A=wn(R);if(!function a(I){return drDa(Yi(I,t.nByteLength));function g(I){return I>i>>ct}const y=(I,E,x)=>wn(I.slice(E,x));class v{constructor(E,x,R){this.r=E,this.s=x,this.recovery=R,this.assertValidity()}static fromCompact(E){const x=t.nByteLength;return E=Zt("compactSignature",E,2*x),new v(y(E,0,x),y(E,x,2*x))}static fromDER(E){const{r:x,s:R}=Ws.toSig(Zt("DER",E));return new v(x,R)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(E){return new v(this.r,this.s,E)}recoverPublicKey(E){const{r:x,s:R,recovery:A}=this,H=S(Zt("msgHash",E));if(null==A||![0,1,2,3].includes(A))throw new Error("recovery id invalid");const Q=2===A||3===A?x+t.n:x;if(Q>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const _e=u.fromHex((1&A?"03":"02")+p(Q)),le=l(Q),lt=c(-H*le),st=c(R*le),Se=u.BASE.multiplyAndAddUnsafe(_e,lt,st);if(!Se)throw new Error("point at infinify");return Se.assertValidity(),Se}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new v(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return Ca(this.toDERHex())}toDERHex(){return Ws.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Ca(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}const w={isValidPrivateKey(I){try{return d(I),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const I=PA(t.n);return function l9(e,t,r=!1){const i=e.length,s=kA(t),o=PA(t);if(i<16||i1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const c=At(r?wn(e):r0(e),t-ze)+ze;return r?s0(c,s):Yi(c,s)}(t.randomBytes(I),t.n)},precompute:(I=8,E=u.BASE)=>(E._setWindowSize(I),E.multiply(BigInt(3)),E)};function b(I){const E=I instanceof Uint8Array,x="string"==typeof I,R=(E||x)&&I.length;return E?R===s||R===o:x?R===2*s||R===2*o:I instanceof u}const D=t.bits2int||function(I){const E=wn(I),x=8*I.length-t.nBitLength;return x>0?E>>BigInt(x):E},S=t.bits2int_modN||function(I){return c(D(I))},T=o0(t.nBitLength);function O(I){if("bigint"!=typeof I)throw new Error("bigint expected");if(!(dr<=I&&IAe in x))throw new Error("sign() legacy options not supported");const{hash:R,randomBytes:A}=t;let{lowS:H,prehash:Q,extraEntropy:J}=x;null==H&&(H=!0),I=Zt("msgHash",I),Q&&(I=Zt("prehashed msgHash",R(I)));const _e=S(I),le=d(E),lt=[O(le),O(_e)];if(null!=J){const Ae=!0===J?A(r.BYTES):J;lt.push(Zt("extraEntropy",Ae))}const st=Gs(...lt),Se=_e;return{seed:st,k2sig:function tt(Ae){const Cn=D(Ae);if(!h(Cn))return;const Bt=l(Cn),Ut=u.BASE.multiply(Cn).toAffine(),br=c(Ut.x);if(br===dr)return;const go=c(Bt*c(Se+br*le));if(go===dr)return;let Vu=(Ut.x===br?0:2)|Number(Ut.y&ct),sk=go;return H&&g(go)&&(sk=function m(I){return g(I)?c(-I):I}(go),Vu^=1),new v(br,sk,Vu)}}}(I,E,x);return NA(t.hash.outputLen,t.nByteLength,t.hmac)(R,A)},verify:function k(I,E,x,R=j){const A=I;if(E=Zt("msgHash",E),x=Zt("publicKey",x),"strict"in R)throw new Error("options.strict was renamed to lowS");const{lowS:H,prehash:Q}=R;let J,_e;try{if("string"==typeof A||A instanceof Uint8Array)try{J=v.fromDER(A)}catch(Ut){if(!(Ut instanceof Ws.Err))throw Ut;J=v.fromCompact(A)}else{if("object"!=typeof A||"bigint"!=typeof A.r||"bigint"!=typeof A.s)throw new Error("PARSE");{const{r:Ut,s:br}=A;J=new v(Ut,br)}}_e=u.fromHex(x)}catch(Ut){if("PARSE"===Ut.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&J.hasHighS())return!1;Q&&(E=t.hash(E));const{r:le,s:lt}=J,st=S(E),Se=l(lt),tt=c(st*Se),Ae=c(le*Se),Cn=u.BASE.multiplyAndAddUnsafe(_e,tt,Ae)?.toAffine();return!!Cn&&c(Cn.x)===le},ProjectivePoint:u,Signature:v,utils:w}}function w9(e){return{hash:e,hmac:(t,...r)=>FA(e,t,function jH(...e){const t=new Uint8Array(e.reduce((i,s)=>i+s.length,0));let r=0;return e.forEach(i=>{if(!Xv(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}(...r)),randomBytes:IA}}BigInt(4);const hh=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),ph=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),jA=BigInt(1),gh=BigInt(2),$A=(e,t)=>(e+t/gh)/t;function VA(e){const t=hh,r=BigInt(3),i=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),c=BigInt(44),l=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=Gn(d,r,t)*d%t,h=Gn(f,r,t)*d%t,p=Gn(h,gh,t)*u%t,g=Gn(p,s,t)*p%t,m=Gn(g,o,t)*g%t,y=Gn(m,c,t)*m%t,v=Gn(y,l,t)*y%t,w=Gn(v,c,t)*m%t,_=Gn(w,r,t)*d%t,b=Gn(_,a,t)*g%t,C=Gn(b,i,t)*u%t,D=Gn(C,gh,t);if(!d0.eql(d0.sqr(D),e))throw new Error("Cannot find square root");return D}const d0=function c9(e,t,r=!1,i={}){if(e<=xt)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:o}=l0(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=function r9(e){if(e%c0===JH){const t=(e+ze)/c0;return function(i,s){const o=i.pow(s,t);if(!i.eql(i.sqr(o),s))throw new Error("Cannot find square root");return o}}if(e%OA===RA){const t=(e-RA)/OA;return function(i,s){const o=i.mul(s,Ji),a=i.pow(o,t),c=i.mul(s,a),l=i.mul(i.mul(c,Ji),a),u=i.mul(c,i.sub(l,i.ONE));if(!i.eql(i.sqr(u),s))throw new Error("Cannot find square root");return u}}return function n9(e){const t=(e-ze)/Ji;let r,i,s;for(r=e-ze,i=0;r%Ji===xt;r/=Ji,i++);for(s=Ji;sAt(l,e),isValid:l=>{if("bigint"!=typeof l)throw new Error("Invalid field element: expected bigint, got "+typeof l);return xt<=l&&ll===xt,isOdd:l=>(l&ze)===ze,neg:l=>At(-l,e),eql:(l,u)=>l===u,sqr:l=>At(l*l,e),add:(l,u)=>At(l+u,e),sub:(l,u)=>At(l-u,e),mul:(l,u)=>At(l*u,e),pow:(l,u)=>function o9(e,t,r){if(r 0");if(r===xt)return e.ONE;if(r===ze)return t;let i=e.ONE,s=t;for(;r>xt;)r&ze&&(i=e.mul(i,s)),s=e.sqr(s),r>>=ze;return i}(c,l,u),div:(l,u)=>At(l*dh(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>dh(l,e),sqrt:i.sqrt||(l=>a(c,l)),invertBatch:l=>function a9(e,t){const r=new Array(t.length),i=t.reduce((o,a,c)=>e.is0(a)?o:(r[c]=o,e.mul(o,a)),e.ONE),s=e.inv(i);return t.reduceRight((o,a,c)=>e.is0(a)?o:(r[c]=e.mul(o,r[c]),e.mul(o,a)),s),r}(c,l),cmov:(l,u,d)=>d?u:l,toBytes:l=>r?s0(l,o):Yi(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?r0(l):wn(l)}});return Object.freeze(c)}(hh,void 0,void 0,{sqrt:VA}),Sa=function _9(e,t){const r=i=>y9({...e,...w9(i)});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:d0,n:ph,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=ph,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-jA*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=$A(o*e,t),l=$A(-i*e,t);let u=At(e-c*r-l*s,t),d=At(-c*i-l*o,t);const f=u>a,h=d>a;if(f&&(u=t-u),h&&(d=t-d),u>a||d>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:h,k2:d}}}},n0),mh=BigInt(0),HA=e=>"bigint"==typeof e&&mhs.charCodeAt(0)));r=Gs(i,i),zA[e]=r}return n0(Gs(r,...t))}const f0=e=>e.toRawBytes(!0).slice(1),h0=e=>Yi(e,32),p0=e=>At(e,hh),Ul=e=>At(e,ph),g0=Sa.ProjectivePoint;function m0(e){let t=Sa.utils.normPrivateKeyToScalar(e),r=g0.fromPrivateKey(t);return{scalar:r.hasEvenY()?t:Ul(-t),bytes:f0(r)}}function qA(e){if(!HA(e))throw new Error("bad x: need 0 < x < p");const t=p0(e*e);let i=VA(p0(t*e+BigInt(7)));i%gh!==mh&&(i=p0(-i));const s=new g0(e,i,jA);return s.assertValidity(),s}function GA(...e){return Ul(wn(yh("BIP0340/challenge",...e)))}function WA(e,t,r){const i=Zt("signature",e,64),s=Zt("message",t),o=Zt("publicKey",r,32);try{const a=qA(wn(o)),c=wn(i.subarray(0,32));if(!HA(c))return!1;const l=wn(i.subarray(32,64));if(!(e=>"bigint"==typeof e&&mhg0.BASE.multiplyAndAddUnsafe(e,t,r))(a,l,Ul(-u));return!(!d||!d.hasEvenY()||d.toAffine().x!==c)}catch{return!1}}const jl={getPublicKey:function D9(e){return m0(e).bytes},sign:function C9(e,t,r=IA(32)){const i=Zt("message",e),{bytes:s,scalar:o}=m0(t),a=Zt("auxRand",r,32),c=h0(o^wn(yh("BIP0340/aux",a))),l=yh("BIP0340/nonce",c,s,i),u=Ul(wn(l));if(u===mh)throw new Error("sign failed: k is zero");const{bytes:d,scalar:f}=m0(u),h=GA(d,s,i),p=new Uint8Array(64);if(p.set(d,0),p.set(h0(Ul(f+h*o)),32),!WA(p,i,s))throw new Error("sign: Invalid signature produced");return p},verify:WA,utils:{randomPrivateKey:Sa.utils.randomPrivateKey,lift_x:qA,pointToBytes:f0,numberToBytesBE:Yi,bytesToNumberBE:wn,taggedHash:yh,mod:At}},y0="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,v0=e=>e instanceof Uint8Array,w0=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),jr=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");const S9=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function _n(e){if(!v0(e))throw new Error("Uint8Array expected");let t="";for(let r=0;ri+s.length,0));let r=0;return e.forEach(i=>{if(!v0(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}class ZA{clone(){return this._cloneInto()}}function KA(e){const t=i=>e().update(Zs(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function QA(e=32){if(y0&&"function"==typeof y0.getRandomValues)return y0.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function b0(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function YA(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}const $r={number:b0,bool:function A9(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},bytes:YA,hash:function M9(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");b0(e.outputLen),b0(e.blockLen)},exists:function N9(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},output:function R9(e,t){YA(e);const r=t.outputLen;if(e.lengths-a&&(this.process(i,0),a=0);for(let f=a;f>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)})(i,s-8,BigInt(8*this.length),o),this.process(i,0);const c=w0(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&r,L9=(e,t,r)=>e&t^e&r^t&r,F9=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),es=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ts=new Uint32Array(64);class JA extends k9{constructor(){super(64,32,8,!1),this.A=0|es[0],this.B=0|es[1],this.C=0|es[2],this.D=0|es[3],this.E=0|es[4],this.F=0|es[5],this.G=0|es[6],this.H=0|es[7]}get(){const{A:t,B:r,C:i,D:s,E:o,F:a,G:c,H:l}=this;return[t,r,i,s,o,a,c,l]}set(t,r,i,s,o,a,c,l){this.A=0|t,this.B=0|r,this.C=0|i,this.D=0|s,this.E=0|o,this.F=0|a,this.G=0|c,this.H=0|l}process(t,r){for(let f=0;f<16;f++,r+=4)ts[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=ts[f-15],p=ts[f-2],g=jr(h,7)^jr(h,18)^h>>>3,m=jr(p,17)^jr(p,19)^p>>>10;ts[f]=m+ts[f-7]+g+ts[f-16]|0}let{A:i,B:s,C:o,D:a,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const p=d+(jr(c,6)^jr(c,11)^jr(c,25))+P9(c,l,u)+F9[f]+ts[f]|0,m=(jr(i,2)^jr(i,13)^jr(i,22))+L9(i,s,o)|0;d=u,u=l,l=c,c=a+p|0,a=o,o=s,s=i,i=p+m|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(i,s,o,a,c,l,u,d)}roundClean(){ts.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class B9 extends JA{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const $l=KA(()=>new JA);function Ks(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function fr(...e){const t=(s,o)=>a=>s(o(a));return{encode:Array.from(e).reverse().reduce((s,o)=>s?t(s,o.encode):o.encode,void 0),decode:e.reduce((s,o)=>s?t(s,o.decode):o.decode,void 0)}}function Vr(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map(r=>{if(Ks(r),r<0||r>=e.length)throw new Error(`Digit index outside alphabet: ${r} (alphabet: ${e.length})`);return e[r]})},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map(r=>{if("string"!=typeof r)throw new Error(`alphabet.decode: not string element=${r}`);const i=e.indexOf(r);if(-1===i)throw new Error(`Unknown letter: "${r}". Allowed: ${e}`);return i})}}}function Hr(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let r of t)if("string"!=typeof r)throw new Error(`join.encode: non-string input=${r}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function Vl(e,t="="){if(Ks(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let i of r)if("string"!=typeof i)throw new Error(`padding.encode: non-string input=${i}`);for(;r.length*e%8;)r.push(t);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let s of r)if("string"!=typeof s)throw new Error(`padding.decode: non-string input=${s}`);let i=r.length;if(i*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;i>0&&r[i-1]===t;i--)if(!((i-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,i)}}}function XA(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>e(t)}}function eM(e,t,r){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let i=0;const s=[],o=Array.from(e);for(o.forEach(a=>{if(Ks(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,c=!0;for(let l=i;lnew B9);const tM=(e,t)=>t?tM(t,e%t):e,wh=(e,t)=>e+(t-tM(e,t));function E0(e,t,r,i){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(wh(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${wh(t,r)}`);let s=0,o=0;const a=2**r-1,c=[];for(const l of e){if(Ks(l),l>=2**t)throw new Error(`convertRadix2: invalid data word=${l} from=${t}`);if(s=s<32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=r;o-=r)c.push((s>>o-r&a)>>>0);s&=2**o-1}if(s=s<=t)throw new Error("Excess padding");if(!i&&s)throw new Error(`Non-zero padding: ${s}`);return i&&o>0&&c.push(s>>>0),c}function bi(e,t=!1){if(Ks(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(wh(8,e)>32||wh(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!(r instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return E0(Array.from(r),8,e,!t)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(E0(r,e,8,t))}}}function rM(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch{}}}fr(bi(4),Vr("0123456789ABCDEF"),Hr("")),fr(bi(5),Vr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Vl(5),Hr("")),fr(bi(5),Vr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Vl(5),Hr("")),fr(bi(5),Vr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Hr(""),XA(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const Ei=fr(bi(6),Vr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Vl(6),Hr("")),D0=(fr(bi(6),Vr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Vl(6),Hr("")),e=>fr(function nM(e){return Ks(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return eM(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of strings");return Uint8Array.from(eM(t,e,256))}}}(58),Vr(e),Hr(""))),C0=(D0("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),D0("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),D0("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),fr(Vr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Hr(""))),oM=[996825010,642813549,513874426,1027748829,705979059];function Hl(e){const t=e>>25;let r=(33554431&e)<<5;for(let i=0;i>i&1)&&(r^=oM[i]);return r}function aM(e,t,r=1){const i=e.length;let s=1;for(let o=0;o126)throw new Error(`Invalid prefix (${e})`);s=Hl(s)^a>>5}s=Hl(s);for(let o=0;of)throw new TypeError(`Wrong string length: ${d.length} (${d}). Expected (8..${f})`);const h=d.toLowerCase();if(d!==h&&d!==d.toUpperCase())throw new Error("String must be lowercase or uppercase");const p=(d=h).lastIndexOf("1");if(0===p||-1===p)throw new Error('Letter "1" must be present between prefix and data only');const g=d.slice(0,p),m=d.slice(p+1);if(m.length<6)throw new Error("Data must be at least 6 characters long");const y=C0.decode(m).slice(0,-6),v=aM(g,y,t);if(!m.endsWith(v))throw new Error(`Invalid checksum in ${d}: expected "${v}"`);return{prefix:g,words:y}}return{encode:function a(d,f,h=90){if("string"!=typeof d)throw new Error("bech32.encode prefix should be string, not "+typeof d);if(!Array.isArray(f)||f.length&&"number"!=typeof f[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof f);const p=d.length+7+f.length;if(!1!==h&&p>h)throw new TypeError(`Length ${p} exceeds limit ${h}`);return`${d=d.toLowerCase()}1${C0.encode(f)}${aM(d,f,t)}`},decode:c,decodeToBytes:function u(d){const{prefix:f,words:h}=c(d,!1);return{prefix:f,words:h,bytes:i(h)}},decodeUnsafe:rM(c),fromWords:i,fromWordsUnsafe:o,toWords:s}}const Ta=cM("bech32");function xa(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function S0(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function uM(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function Ce(e,...t){if(!uM(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Qs(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Eh(e,t){Ce(e);const r=t.outputLen;if(e.length{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));const be=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Aa=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function ns(e){if("string"==typeof e)e=function Y9(e){if("string"!=typeof e)throw new Error("string expected, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e);else{if(!uM(e))throw new Error("Uint8Array expected, got "+typeof e);e=e.slice()}return e}function Dh(e,t){if(e.length!==t.length)return!1;let r=0;for(let i=0;i(Object.assign(t,e),t);function Ys(e,t,r,i){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,i);const s=BigInt(32),o=BigInt(4294967295),a=Number(r>>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)}const x0=new Uint8Array(16),zr=be(x0),e7=(e,t,r,i)=>({s3:r<<31|i>>>1,s2:t<<31|r>>>1,s1:e<<31|t>>>1,s0:e>>>1^225<<24&-(1&i)}),Wn=e=>(e>>>0&255)<<24|(e>>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255;class fM{constructor(t,r){this.blockLen=16,this.outputLen=16,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,Ce(t=ns(t),16);const i=Aa(t);let s=i.getUint32(0,!1),o=i.getUint32(4,!1),a=i.getUint32(8,!1),c=i.getUint32(12,!1);const l=[];for(let g=0;g<128;g++)l.push({s0:Wn(s),s1:Wn(o),s2:Wn(a),s3:Wn(c)}),({s0:s,s1:o,s2:a,s3:c}=e7(s,o,a,c));const u=(e=r||1024)>65536?8:e>1024?4:2;var e;if(![1,2,4,8].includes(u))throw new Error(`ghash: wrong window size=${u}, should be 2, 4 or 8`);this.W=u;const f=128/u,h=this.windowSize=2**u,p=[];for(let g=0;g>>u-b-1&1))continue;const{s0:D,s1:S,s2:T,s3:O}=l[u*g+b];y^=D,v^=S,w^=T,_^=O}p.push({s0:y,s1:v,s2:w,s3:_})}this.t=p}_updateBlock(t,r,i,s){t^=this.s0,r^=this.s1,i^=this.s2,s^=this.s3;const{W:o,t:a,windowSize:c}=this;let l=0,u=0,d=0,f=0;const h=(1<>>8*m&255;for(let v=8/o-1;v>=0;v--){const w=y>>>o*v&h,{s0:_,s1:b,s2:C,s3:D}=a[p*c+w];l^=_,u^=b,d^=C,f^=D,p+=1}}this.s0=l,this.s1=u,this.s2=d,this.s3=f}update(t){t=ns(t),Qs(this);const r=be(t),i=Math.floor(t.length/16),s=t.length%16;for(let o=0;o>>1|r,r=(1&s)<<7}return e[0]^=225&-t,e}((t=ns(t)).slice());super(i,r),i.fill(0)}update(t){t=ns(t),Qs(this);const r=be(t),i=t.length%16,s=Math.floor(t.length/16);for(let o=0;oe(s,i.length).update(ns(i)).digest(),r=e(new Uint8Array(16),0);return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=(i,s)=>e(i,s),t}hM((e,t)=>new fM(e,t)),hM((e,t)=>new r7(e,t)),new Uint8Array(16);const s7=283;function M0(e){return e<<1^s7&-(e>>7)}function Ma(e,t){let r=0;for(;t>0;t>>=1)r^=e&-(1&t),e=M0(e);return r}const N0=(()=>{let e=new Uint8Array(256);for(let r=0,i=1;r<256;r++,i^=M0(i))e[r]=i;const t=new Uint8Array(256);t[0]=99;for(let r=0;r<255;r++){let i=e[255-r];i|=i<<8,t[e[r]]=255&(i^i>>4^i>>5^i>>6^i>>7^99)}return t})(),o7=N0.map((e,t)=>N0.indexOf(t)),a7=e=>e<<24|e>>>8,R0=e=>e<<8|e>>>24;function gM(e,t){if(256!==e.length)throw new Error("Wrong sbox length");const r=new Uint32Array(256).map((u,d)=>t(e[d])),i=r.map(R0),s=i.map(R0),o=s.map(R0),a=new Uint32Array(65536),c=new Uint32Array(65536),l=new Uint16Array(65536);for(let u=0;u<256;u++)for(let d=0;d<256;d++){const f=256*u+d;a[f]=r[u]^i[d],c[f]=s[u]^o[d],l[f]=e[u]<<8|e[d]}return{sbox:e,sbox2:l,T0:r,T1:i,T2:s,T3:o,T01:a,T23:c}}const O0=gM(N0,e=>Ma(e,3)<<24|e<<16|e<<8|Ma(e,2)),mM=gM(o7,e=>Ma(e,11)<<24|Ma(e,13)<<16|Ma(e,9)<<8|Ma(e,14)),c7=(()=>{const e=new Uint8Array(16);for(let t=0,r=1;t<16;t++,r=M0(r))e[t]=r;return e})();function Si(e){Ce(e);const t=e.length;if(![16,24,32].includes(t))throw new Error(`aes: wrong key size: should be 16, 24 or 32, got: ${t}`);const{sbox2:r}=O0,i=be(e),s=i.length,o=c=>qr(r,c,c,c,c),a=new Uint32Array(t+28);a.set(i);for(let c=s;c6&&c%s==4&&(l=o(l)),a[c]=a[c-s]^l}return a}function is(e,t,r,i,s,o){return e[r<<8&65280|i>>>8&255]^t[s>>>8&65280|o>>>24&255]}function qr(e,t,r,i,s){return e[255&t|65280&r]|e[i>>>16&255|s>>>16&65280]<<16}function bn(e,t,r,i,s){const{sbox2:o,T01:a,T23:c}=O0;let l=0;t^=e[l++],r^=e[l++],i^=e[l++],s^=e[l++];const u=e.length/4-2;for(let g=0;g{const c=Si(t),{b:l,o:u,out:d}=function wM(e,t,r){let i=e.length;const s=i%16;if(!t&&0!==s)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");const o=be(e);if(t){let l=16-s;l||(l=16),i+=l}const a=Na(i,r);return{b:o,o:be(a),out:a}}(o,s,a),f=be(r);let h=f[0],p=f[1],g=f[2],m=f[3],y=0;for(;y+4<=l.length;)h^=l[y+0],p^=l[y+1],g^=l[y+2],m^=l[y+3],({s0:h,s1:p,s2:g,s3:m}=bn(c,h,p,g,m)),u[y++]=h,u[y++]=p,u[y++]=g,u[y++]=m;if(s){const v=function bM(e){const t=new Uint8Array(16),r=be(t);t.set(e);const i=16-e.length;for(let s=16-i;s<16;s++)t[s]=i;return r}(o.subarray(4*y));h^=v[0],p^=v[1],g^=v[2],m^=v[3],({s0:h,s1:p,s2:g,s3:m}=bn(c,h,p,g,m)),u[y++]=h,u[y++]=p,u[y++]=g,u[y++]=m}return c.fill(0),d},decrypt:(o,a)=>{!function vM(e){if(Ce(e),e.length%16!=0)throw new Error("aes/(cbc-ecb).decrypt ciphertext should consist of blocks with size 16")}(o);const c=function k0(e){const t=Si(e),r=t.slice(),i=t.length,{sbox2:s}=O0,{T0:o,T1:a,T2:c,T3:l}=mM;for(let u=0;u>>8&255]^c[f>>>16&255]^l[f>>>24]}return r}(t),l=be(r),u=Na(o.length,a),d=be(o),f=be(u);let h=l[0],p=l[1],g=l[2],m=l[3];for(let y=0;y+4<=d.length;){const v=h,w=p,_=g,b=m;h=d[y+0],p=d[y+1],g=d[y+2],m=d[y+3];const{s0:C,s1:D,s2:S,s3:T}=Sh(c,h,p,g,m);f[y++]=C^v,f[y++]=D^w,f[y++]=S^_,f[y++]=T^b}return c.fill(0),function _M(e,t){if(!t)return e;const r=e.length;if(!r)throw new Error("aes/pcks5: empty ciphertext not allowed");const i=e[r-1];if(i<=0||i>16)throw new Error(`aes/pcks5: wrong padding byte: ${i}`);const s=e.subarray(0,-i);for(let o=0;o255&e[t++]|(255&e[t++])<<8;class d7{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,Ce(t=ns(t),32);const r=Pt(t,0),i=Pt(t,2),s=Pt(t,4),o=Pt(t,6),a=Pt(t,8),c=Pt(t,10),l=Pt(t,12),u=Pt(t,14);this.r[0]=8191&r,this.r[1]=8191&(r>>>13|i<<3),this.r[2]=7939&(i>>>10|s<<6),this.r[3]=8191&(s>>>7|o<<9),this.r[4]=255&(o>>>4|a<<12),this.r[5]=a>>>1&8190,this.r[6]=8191&(a>>>14|c<<2),this.r[7]=8065&(c>>>11|l<<5),this.r[8]=8191&(l>>>8|u<<8),this.r[9]=u>>>5&127;for(let d=0;d<8;d++)this.pad[d]=Pt(t,16+2*d)}process(t,r,i=!1){const s=i?0:2048,{h:o,r:a}=this,c=a[0],l=a[1],u=a[2],d=a[3],f=a[4],h=a[5],p=a[6],g=a[7],m=a[8],y=a[9],v=Pt(t,r+0),w=Pt(t,r+2),_=Pt(t,r+4),b=Pt(t,r+6),C=Pt(t,r+8),D=Pt(t,r+10),S=Pt(t,r+12),T=Pt(t,r+14);let O=o[0]+(8191&v),U=o[1]+(8191&(v>>>13|w<<3)),B=o[2]+(8191&(w>>>10|_<<6)),j=o[3]+(8191&(_>>>7|b<<9)),Y=o[4]+(8191&(b>>>4|C<<12)),k=o[5]+(C>>>1&8191),I=o[6]+(8191&(C>>>14|D<<2)),E=o[7]+(8191&(D>>>11|S<<5)),x=o[8]+(8191&(S>>>8|T<<8)),R=o[9]+(T>>>5|s),A=0,H=A+O*c+U*(5*y)+B*(5*m)+j*(5*g)+Y*(5*p);A=H>>>13,H&=8191,H+=k*(5*h)+I*(5*f)+E*(5*d)+x*(5*u)+R*(5*l),A+=H>>>13,H&=8191;let Q=A+O*l+U*c+B*(5*y)+j*(5*m)+Y*(5*g);A=Q>>>13,Q&=8191,Q+=k*(5*p)+I*(5*h)+E*(5*f)+x*(5*d)+R*(5*u),A+=Q>>>13,Q&=8191;let J=A+O*u+U*l+B*c+j*(5*y)+Y*(5*m);A=J>>>13,J&=8191,J+=k*(5*g)+I*(5*p)+E*(5*h)+x*(5*f)+R*(5*d),A+=J>>>13,J&=8191;let _e=A+O*d+U*u+B*l+j*c+Y*(5*y);A=_e>>>13,_e&=8191,_e+=k*(5*m)+I*(5*g)+E*(5*p)+x*(5*h)+R*(5*f),A+=_e>>>13,_e&=8191;let le=A+O*f+U*d+B*u+j*l+Y*c;A=le>>>13,le&=8191,le+=k*(5*y)+I*(5*m)+E*(5*g)+x*(5*p)+R*(5*h),A+=le>>>13,le&=8191;let lt=A+O*h+U*f+B*d+j*u+Y*l;A=lt>>>13,lt&=8191,lt+=k*c+I*(5*y)+E*(5*m)+x*(5*g)+R*(5*p),A+=lt>>>13,lt&=8191;let st=A+O*p+U*h+B*f+j*d+Y*u;A=st>>>13,st&=8191,st+=k*l+I*c+E*(5*y)+x*(5*m)+R*(5*g),A+=st>>>13,st&=8191;let Se=A+O*g+U*p+B*h+j*f+Y*d;A=Se>>>13,Se&=8191,Se+=k*u+I*l+E*c+x*(5*y)+R*(5*m),A+=Se>>>13,Se&=8191;let tt=A+O*m+U*g+B*p+j*h+Y*f;A=tt>>>13,tt&=8191,tt+=k*d+I*u+E*l+x*c+R*(5*y),A+=tt>>>13,tt&=8191;let Ae=A+O*y+U*m+B*g+j*p+Y*h;A=Ae>>>13,Ae&=8191,Ae+=k*f+I*d+E*u+x*l+R*c,A+=Ae>>>13,Ae&=8191,A=(A<<2)+A|0,A=A+H|0,H=8191&A,A>>>=13,Q+=A,o[0]=H,o[1]=Q,o[2]=J,o[3]=_e,o[4]=le,o[5]=lt,o[6]=st,o[7]=Se,o[8]=tt,o[9]=Ae}finalize(){const{h:t,pad:r}=this,i=new Uint16Array(10);let s=t[1]>>>13;t[1]&=8191;for(let c=2;c<10;c++)t[c]+=s,s=t[c]>>>13,t[c]&=8191;t[0]+=5*s,s=t[0]>>>13,t[0]&=8191,t[1]+=s,s=t[1]>>>13,t[1]&=8191,t[2]+=s,i[0]=t[0]+5,s=i[0]>>>13,i[0]&=8191;for(let c=1;c<10;c++)i[c]=t[c]+s,s=i[c]>>>13,i[c]&=8191;i[9]-=8192;let o=(1^s)-1;for(let c=0;c<10;c++)i[c]&=o;o=~o;for(let c=0;c<10;c++)t[c]=t[c]&o|i[c];t[0]=65535&(t[0]|t[1]<<13),t[1]=65535&(t[1]>>>3|t[2]<<10),t[2]=65535&(t[2]>>>6|t[3]<<7),t[3]=65535&(t[3]>>>9|t[4]<<4),t[4]=65535&(t[4]>>>12|t[5]<<1|t[6]<<14),t[5]=65535&(t[6]>>>2|t[7]<<11),t[6]=65535&(t[7]>>>5|t[8]<<8),t[7]=65535&(t[8]>>>8|t[9]<<5);let a=t[0]+r[0];t[0]=65535&a;for(let c=1;c<8;c++)a=(t[c]+r[c]|0)+(a>>>16)|0,t[c]=65535&a}update(t){Qs(this);const{buffer:r,blockLen:i}=this,s=(t=ns(t)).length;for(let o=0;o>>0,t[o++]=i[a]>>>8;return t}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const i=t.slice(0,r);return this.destroy(),i}}const h7=function f7(e){const t=(i,s)=>e(s).update(ns(i)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=i=>e(i),t}(e=>new d7(e)),SM=e=>Uint8Array.from(e.split("").map(t=>t.charCodeAt(0))),p7=SM("expand 16-byte k"),g7=SM("expand 32-byte k"),m7=be(p7),IM=be(g7);function Z(e,t){return e<>>32-t}function P0(e){return e.byteOffset%4==0}IM.slice();const TM=2**32-1,xM=new Uint32Array;function zl(e,t){const{allowShortKeys:r,extendNonceFn:i,counterLength:s,counterRight:o,rounds:a}=function J9(e,t){if(null==t||"object"!=typeof t)throw new Error("options must be defined");return Object.assign(e,t)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw new Error("core must be a function");return xa(s),xa(a),S0(o),S0(r),(c,l,u,d,f=0)=>{Ce(c),Ce(l),Ce(u);const h=u.length;if(d||(d=new Uint8Array(h)),Ce(d),xa(f),f<0||f>=TM)throw new Error("arx: counter overflow");if(d.length=TM)throw new Error("arx: counter overflow");const m=Math.min(64,l-g);if(f&&64===m){const y=g/4;if(g%4!=0)throw new Error("arx: invalid block position");for(let w,v=0;v<16;v++)w=y+v,p[w]=h[w]^d[v];g+=64}else{for(let v,y=0;y0;)p.pop().fill(0);return d}}function ql(e,t,r,i,s,o=20){let a=e[0],c=e[1],l=e[2],u=e[3],d=t[0],f=t[1],h=t[2],p=t[3],g=t[4],m=t[5],y=t[6],v=t[7],w=s,_=r[0],b=r[1],C=r[2],D=a,S=c,T=l,O=u,U=d,B=f,j=h,Y=p,k=g,I=m,E=y,x=v,R=w,A=_,H=b,Q=C;for(let _e=0;_e{e.update(t);const r=t.length%16;r&&e.update(b7.subarray(r))},E7=new Uint8Array(32);function MM(e,t,r,i,s){const o=e(t,r,E7),a=h7.create(o);s&&AM(a,s),AM(a,i);const c=new Uint8Array(16),l=Aa(c);Ys(l,0,BigInt(s?s.length:0),!0),Ys(l,8,BigInt(i.length),!0),a.update(c);const u=a.digest();return o.fill(0),u}const NM=e=>(t,r,i)=>(Ce(t,32),Ce(r),{encrypt:(o,a)=>{const c=o.length,l=c+16;a?Ce(a,l):a=new Uint8Array(l),e(t,r,o,a,1);const u=MM(e,t,r,a.subarray(0,-16),i);return a.set(u,c),a},decrypt:(o,a)=>{const c=o.length,l=c-16;if(c<16)throw new Error("encrypted data must be at least 16 bytes");a?Ce(a,l):a=new Uint8Array(l);const u=o.subarray(0,-16);if(!Dh(o.subarray(-16),MM(e,t,r,u,i)))throw new Error("invalid tag");return e(t,r,u,a,1),a}});NM(L0),NM(_7);class RM extends ZA{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,$r.hash(t);const i=Zs(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?t.create().update(i).digest():i);for(let a=0;anew RM(e,t).update(r).digest();xh.create=(e,t)=>new RM(e,t);const F0=new Uint8Array([0]),kM=new Uint8Array;var D7=Object.defineProperty,gt=(e,t)=>{for(var r in t)D7(e,r,{get:t[r],enumerable:!0})},Js=Symbol("verified"),C7=e=>e instanceof Object;function LM(e){if(!C7(e)||"number"!=typeof e.kind||"string"!=typeof e.content||"number"!=typeof e.created_at||"string"!=typeof e.pubkey||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let t=0;tBM,QueueNode:()=>FM,binarySearch:()=>B0,insertEventIntoAscendingList:()=>T7,insertEventIntoDescendingList:()=>I7,normalizeURL:()=>Oa,utf8Decoder:()=>Gr,utf8Encoder:()=>hr});var Gr=new TextDecoder("utf-8"),hr=new TextEncoder;function Oa(e){-1===e.indexOf("://")&&(e="wss://"+e);let t=new URL(e);return t.pathname=t.pathname.replace(/\/+/g,"/"),t.pathname.endsWith("/")&&(t.pathname=t.pathname.slice(0,-1)),("80"===t.port&&"ws:"===t.protocol||"443"===t.port&&"wss:"===t.protocol)&&(t.port=""),t.searchParams.sort(),t.hash="",t.toString()}function I7(e,t){const[r,i]=B0(e,s=>t.id===s.id?0:t.created_at===s.created_at?-1:s.created_at-t.created_at);return i||e.splice(r,0,t),e}function T7(e,t){const[r,i]=B0(e,s=>t.id===s.id?0:t.created_at===s.created_at?-1:t.created_at-s.created_at);return i||e.splice(r,0,t),e}function B0(e,t){let r=0,i=e.length-1;for(;r<=i;){const s=Math.floor((r+i)/2),o=t(e[s]);if(0===o)return[s,!0];o<0?i=s-1:r=s+1}return[r,!1]}var FM=class{value;next=null;prev=null;constructor(e){this.value=e}},BM=class{first;last;constructor(){this.first=null,this.last=null}enqueue(e){const t=new FM(e);return this.last?this.last===this.first?(this.last=t,this.last.prev=this.first,this.first.next=t):(t.prev=this.last,this.last.next=t,this.last=t):(this.first=t,this.last=t),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){const t=this.first;return this.first=null,this.last=null,t.value}const e=this.first;return this.first=e.next,e.value}};function Ah(e){let t=$l(hr.encode(function A7(e){if(!LM(e))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}(e)));return _n(t)}var Mh=new class{generateSecretKey(){return jl.utils.randomPrivateKey()}getPublicKey(e){return _n(jl.getPublicKey(e))}finalizeEvent(e,t){const r=e;return r.pubkey=_n(jl.getPublicKey(t)),r.id=Ah(r),r.sig=_n(jl.sign(Ah(r),t)),r[Js]=!0,r}verifyEvent(e){if("boolean"==typeof e[Js])return e[Js];const t=Ah(e);if(t!==e.id)return e[Js]=!1,!1;try{const r=jl.verify(e.sig,t,e.pubkey);return e[Js]=r,r}catch{return e[Js]=!1,!1}}},M7=Mh.generateSecretKey,UM=Mh.getPublicKey,Zn=Mh.finalizeEvent,ka=Mh.verifyEvent,Kt={};function jM(e){return 1e3<=e&&e<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(e)}function U0(e){return[0,3].includes(e)||1e4<=e&&e<2e4}function $M(e){return 2e4<=e&&e<3e4}function j0(e){return 3e4<=e&&e<4e4}function N7(e){return jM(e)?"regular":U0(e)?"replaceable":$M(e)?"ephemeral":j0(e)?"parameterized":"unknown"}gt(Kt,{Application:()=>Mz,BadgeAward:()=>U7,BadgeDefinition:()=>Dz,BlockedRelaysList:()=>cz,BookmarkList:()=>sz,Bookmarksets:()=>_z,Calendar:()=>Fz,CalendarEventRSVP:()=>Bz,ChannelCreation:()=>VM,ChannelHideMessage:()=>qM,ChannelMessage:()=>zM,ChannelMetadata:()=>HM,ChannelMuteUser:()=>GM,ClassifiedListing:()=>Oz,ClientAuth:()=>WM,CommunitiesList:()=>oz,CommunityDefinition:()=>$z,CommunityPostApproval:()=>Z7,Contacts:()=>P7,CreateOrUpdateProduct:()=>Iz,CreateOrUpdateStall:()=>Sz,Curationsets:()=>bz,Date:()=>Pz,DraftClassifiedListing:()=>kz,DraftLong:()=>xz,Emojisets:()=>Az,EncryptedDirectMessage:()=>L7,EncryptedDirectMessages:()=>F7,EventDeletion:()=>B7,FileMetadata:()=>V7,FileServerPreference:()=>fz,Followsets:()=>yz,GenericRepost:()=>j7,Genericlists:()=>vz,HTTPAuth:()=>H0,Handlerinformation:()=>jz,Handlerrecommendation:()=>Uz,Highlights:()=>tz,InterestsList:()=>uz,Interestsets:()=>Cz,JobFeedback:()=>Y7,JobRequest:()=>K7,JobResult:()=>Q7,Label:()=>W7,LightningPubRPC:()=>pz,LiveChatMessage:()=>H7,LiveEvent:()=>Nz,LongFormArticle:()=>Tz,Metadata:()=>R7,Mutelist:()=>nz,NWCWalletInfo:()=>hz,NWCWalletRequest:()=>ZM,NWCWalletResponse:()=>gz,NostrConnect:()=>mz,OpenTimestamps:()=>$7,Pinlist:()=>rz,ProblemTracker:()=>z7,ProfileBadges:()=>Ez,PublicChatsList:()=>az,Reaction:()=>V0,RecommendRelay:()=>k7,RelayList:()=>iz,Relaysets:()=>wz,Report:()=>q7,Reporting:()=>G7,Repost:()=>$0,SearchRelaysList:()=>lz,ShortTextNote:()=>O7,Time:()=>Lz,UserEmojiList:()=>dz,UserStatuses:()=>Rz,Zap:()=>ez,ZapGoal:()=>J7,ZapRequest:()=>X7,classifyKind:()=>N7,isEphemeralKind:()=>$M,isParameterizedReplaceableKind:()=>j0,isRegularKind:()=>jM,isReplaceableKind:()=>U0});var R7=0,O7=1,k7=2,P7=3,L7=4,F7=4,B7=5,$0=6,V0=7,U7=8,j7=16,VM=40,HM=41,zM=42,qM=43,GM=44,$7=1040,V7=1063,H7=1311,z7=1971,q7=1984,G7=1984,W7=1985,Z7=4550,K7=5999,Q7=6999,Y7=7e3,J7=9041,X7=9734,ez=9735,tz=9802,nz=1e4,rz=10001,iz=10002,sz=10003,oz=10004,az=10005,cz=10006,lz=10007,uz=10015,dz=10030,fz=10096,hz=13194,pz=21e3,WM=22242,ZM=23194,gz=23195,mz=24133,H0=27235,yz=3e4,vz=30001,wz=30002,_z=30003,bz=30004,Ez=30008,Dz=30009,Cz=30015,Sz=30017,Iz=30018,Tz=30023,xz=30024,Az=30030,Mz=30078,Nz=30311,Rz=30315,Oz=30402,kz=30403,Pz=31922,Lz=31923,Fz=31924,Bz=31925,Uz=31989,jz=31990,$z=34550;function Vz(e,t){if(e.ids&&-1===e.ids.indexOf(t.id)||e.kinds&&-1===e.kinds.indexOf(t.kind)||e.authors&&-1===e.authors.indexOf(t.pubkey))return!1;for(let r in e)if("#"===r[0]){let s=e[`#${r.slice(1)}`];if(s&&!t.tags.find(([o,a])=>o===r.slice(1)&&-1!==s.indexOf(a)))return!1}return!(e.since&&t.created_ate.until)}function Nh(e,t){for(let r=0;rU0(t))?e.authors.length*e.kinds.length:1/0,e.authors?.length&&e.kinds?.every(t=>j0(t))&&e["#d"]?.length?e.authors.length*e.kinds.length*e["#d"].length:1/0)}function Rh(e,t){let r=t.length+3,i=e.indexOf(`"${t}":`)+r,s=e.slice(i).indexOf('"')+i+1;return e.slice(s,s+64)}function QM(e,t){let r=t.length,i=e.indexOf(`"${t}":`)+r+3,s=e.slice(i),o=Math.min(s.indexOf(","),s.indexOf("}"));return parseInt(s.slice(0,o),10)}function YM(e){let t=e.slice(0,22).indexOf('"EVENT"');if(-1===t)return null;let r=e.slice(t+7+1).indexOf('"');if(-1===r)return null;let i=t+7+1+r,s=e.slice(i+1,80).indexOf('"');return-1===s?null:e.slice(i+1,i+1+s)}function zz(e,t){return t===Rh(e,"id")}function qz(e,t){return t===Rh(e,"pubkey")}function Gz(e,t){return t===QM(e,"kind")}function JM(e,t){return{kind:WM,created_at:Math.floor(Date.now()/1e3),tags:[["relay",e],["challenge",t]],content:""}}gt({},{getHex64:()=>Rh,getInt:()=>QM,getSubscriptionId:()=>YM,matchEventId:()=>zz,matchEventKind:()=>Gz,matchEventPubkey:()=>qz}),gt({},{makeAuthEvent:()=>JM});try{WebSocket}catch{}try{WebSocket}catch{}var Gl={};gt(Gl,{BECH32_REGEX:()=>tN,Bech32MaxSize:()=>G0,decode:()=>Wl,encodeBytes:()=>kh,naddrEncode:()=>sq,neventEncode:()=>iq,noteEncode:()=>nq,nprofileEncode:()=>rq,npubEncode:()=>tq,nrelayEncode:()=>oq,nsecEncode:()=>eq});var G0=5e3,tN=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function Wl(e){let{prefix:t,words:r}=Ta.decode(e,G0),i=new Uint8Array(Ta.fromWords(r));switch(t){case"nprofile":{let s=Oh(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for nprofile");if(32!==s[0][0].length)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:_n(s[0][0]),relays:s[1]?s[1].map(o=>Gr.decode(o)):[]}}}case"nevent":{let s=Oh(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for nevent");if(32!==s[0][0].length)throw new Error("TLV 0 should be 32 bytes");if(s[2]&&32!==s[2][0].length)throw new Error("TLV 2 should be 32 bytes");if(s[3]&&4!==s[3][0].length)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:_n(s[0][0]),relays:s[1]?s[1].map(o=>Gr.decode(o)):[],author:s[2]?.[0]?_n(s[2][0]):void 0,kind:s[3]?.[0]?parseInt(_n(s[3][0]),16):void 0}}}case"naddr":{let s=Oh(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for naddr");if(!s[2]?.[0])throw new Error("missing TLV 2 for naddr");if(32!==s[2][0].length)throw new Error("TLV 2 should be 32 bytes");if(!s[3]?.[0])throw new Error("missing TLV 3 for naddr");if(4!==s[3][0].length)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:Gr.decode(s[0][0]),pubkey:_n(s[2][0]),kind:parseInt(_n(s[3][0]),16),relays:s[1]?s[1].map(o=>Gr.decode(o)):[]}}}case"nrelay":{let s=Oh(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for nrelay");return{type:"nrelay",data:Gr.decode(s[0][0])}}case"nsec":return{type:t,data:i};case"npub":case"note":return{type:t,data:_n(i)};default:throw new Error(`unknown prefix ${t}`)}}function Oh(e){let t={},r=e;for(;r.length>0;){let i=r[0],s=r[1],o=r.slice(2,2+s);if(r=r.slice(2+s),o.lengthhr.encode(r))}))}function iq(e){let t;return void 0!==e.kind&&(t=function Xz(e){const t=new Uint8Array(4);return t[0]=e>>24&255,t[1]=e>>16&255,t[2]=e>>8&255,t[3]=255&e,t}(e.kind)),Zl("nevent",Ph({0:[Ia(e.id)],1:(e.relays||[]).map(i=>hr.encode(i)),2:e.author?[Ia(e.author)]:[],3:t?[new Uint8Array(t)]:[]}))}function sq(e){let t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e.kind,!1),Zl("naddr",Ph({0:[hr.encode(e.identifier)],1:(e.relays||[]).map(i=>hr.encode(i)),2:[Ia(e.pubkey)],3:[new Uint8Array(t)]}))}function oq(e){return Zl("nrelay",Ph({0:[hr.encode(e)]}))}function Ph(e){let t=[];return Object.entries(e).reverse().forEach(([r,i])=>{i.forEach(s=>{let o=new Uint8Array(s.length+2);o.set([parseInt(r)],0),o.set([s.length],1),o.set(s,2),t.push(o)})}),vh(...t)}var Kl={};function nN(e,t,r){return W0.apply(this,arguments)}function W0(){return(W0=$(function*(e,t,r){const i=e instanceof Uint8Array?_n(e):e,o=rN(Sa.getSharedSecret(i,"02"+t));let a=Uint8Array.from(QA(16)),c=hr.encode(r),l=EM(o,a).encrypt(c);return`${Ei.encode(new Uint8Array(l))}?iv=${Ei.encode(new Uint8Array(a.buffer))}`})).apply(this,arguments)}function cq(e,t,r){return Z0.apply(this,arguments)}function Z0(){return(Z0=$(function*(e,t,r){const i=e instanceof Uint8Array?_n(e):e;let[s,o]=r.split("?iv="),c=rN(Sa.getSharedSecret(i,"02"+t)),l=Ei.decode(o),u=Ei.decode(s),d=EM(c,l).decrypt(u);return Gr.decode(d)})).apply(this,arguments)}function rN(e){return e.slice(1,33)}gt(Kl,{decrypt:()=>cq,encrypt:()=>nN}),gt({},{NIP05_REGEX:()=>iN,isValid:()=>fq,queryProfile:()=>sN,searchDomain:()=>dq,useFetchImplementation:()=>uq});var Lh,iN=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/;try{Lh=fetch}catch{}function uq(e){Lh=e}function dq(e){return K0.apply(this,arguments)}function K0(){return(K0=$(function*(e,t=""){try{const r=`https://${e}/.well-known/nostr.json?name=${t}`;return(yield(yield Lh(r,{redirect:"error"})).json()).names}catch{return{}}})).apply(this,arguments)}function sN(e){return Q0.apply(this,arguments)}function Q0(){return(Q0=$(function*(e){const t=e.match(iN);if(!t)return null;const[r,i="_",s]=t;try{const o=`https://${s}/.well-known/nostr.json?name=${i}`,a=yield(yield Lh(o,{redirect:"error"})).json();let c=a.names[i];return c?{pubkey:c,relays:a.relays?.[c]}:null}catch{return null}})).apply(this,arguments)}function fq(e,t){return Y0.apply(this,arguments)}function Y0(){return(Y0=$(function*(e,t){let r=yield sN(t);return!!r&&r.pubkey===e})).apply(this,arguments)}function pq(e){const t={reply:void 0,root:void 0,mentions:[],profiles:[]},r=[];for(const i of e.tags)"e"===i[0]&&i[1]&&r.push(i),"p"===i[0]&&i[1]&&t.profiles.push({pubkey:i[1],relays:i[2]?[i[2]]:[]});for(let i=0;ipq}),gt({},{fetchRelayInformation:()=>yq,useFetchImplementation:()=>mq});try{fetch}catch{}function mq(e){}function yq(e){return J0.apply(this,arguments)}function J0(){return(J0=$(function*(e){return yield(yield fetch(e.replace("ws://","http://").replace("wss://","https://"),{headers:{Accept:"application/nostr+json"}})).json()})).apply(this,arguments)}function aN(e){let t=0;for(let r=0;r=t)break}return i}function bq(e,t,r,i){return Zn({kind:$0,tags:[...e.tags??[],["e",t.id,r],["p",t.pubkey]],content:""===e.content?"":JSON.stringify(t),created_at:e.created_at},i)}function cN(e){if(e.kind!==$0)return;let t,r;for(let i=e.tags.length-1;i>=0&&(void 0===t||void 0===r);i--){const s=e.tags[i];s.length>=2&&("e"===s[0]&&void 0===t?t=s:"p"===s[0]&&void 0===r&&(r=s))}return void 0!==t?{id:t[1],relays:[t[2],r?.[2]].filter(i=>"string"==typeof i),author:r?.[1]}:void 0}function Eq(e,{skipVerification:t}={}){const r=cN(e);if(void 0===r||""===e.content)return;let i;try{i=JSON.parse(e.content)}catch{return}return i.id===r.id&&(t||ka(i))?i:void 0}gt({},{getPow:()=>aN,minePow:()=>wq}),gt({},{finishRepostEvent:()=>bq,getRepostedEvent:()=>Eq,getRepostedEventPointer:()=>cN}),gt({},{NOSTR_URI_REGEX:()=>Fh,parse:()=>Sq,test:()=>Cq});var Fh=new RegExp(`nostr:(${tN.source})`);function Cq(e){return"string"==typeof e&&new RegExp(`^${Fh.source}$`).test(e)}function Sq(e){const t=e.match(new RegExp(`^${Fh.source}$`));if(!t)throw new Error(`Invalid Nostr URI: ${e}`);return{uri:t[0],value:t[1],decoded:Wl(t[1])}}function Tq(e,t,r){const i=t.tags.filter(s=>s.length>=2&&("e"===s[0]||"p"===s[0]));return Zn({...e,kind:V0,tags:[...e.tags??[],...i,["e",t.id],["p",t.pubkey]],content:e.content??"+"},r)}function xq(e){if(e.kind!==V0)return;let t,r;for(let i=e.tags.length-1;i>=0&&(void 0===t||void 0===r);i--){const s=e.tags[i];s.length>=2&&("e"===s[0]&&void 0===t?t=s:"p"===s[0]&&void 0===r&&(r=s))}return void 0!==t&&void 0!==r?{id:t[1],relays:[t[2],r[2]].filter(i=>void 0!==i),author:r[1]}:void 0}gt({},{finishReactionEvent:()=>Tq,getReactedEventPointer:()=>xq}),gt({},{matchAll:()=>Mq,regex:()=>X0,replaceAll:()=>Nq});var X0=()=>new RegExp(`\\b${Fh.source}\\b`,"g");function*Mq(e){const t=e.matchAll(X0());for(const r of t)try{const[i,s]=r;yield{uri:i,value:s,decoded:Wl(s),start:r.index,end:r.index+i.length}}catch{}}function Nq(e,t){return e.replaceAll(X0(),(r,i)=>t({uri:r,value:i,decoded:Wl(i)}))}gt({},{channelCreateEvent:()=>Oq,channelHideMessageEvent:()=>Lq,channelMessageEvent:()=>Pq,channelMetadataEvent:()=>kq,channelMuteUserEvent:()=>Fq});var Oq=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Zn({kind:VM,tags:[...e.tags??[]],content:r,created_at:e.created_at},t)},kq=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Zn({kind:HM,tags:[["e",e.channel_create_event_id],...e.tags??[]],content:r,created_at:e.created_at},t)},Pq=(e,t)=>{const r=[["e",e.channel_create_event_id,e.relay_url,"root"]];return e.reply_to_channel_message_event_id&&r.push(["e",e.reply_to_channel_message_event_id,e.relay_url,"reply"]),Zn({kind:zM,tags:[...r,...e.tags??[]],content:e.content,created_at:e.created_at},t)},Lq=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Zn({kind:qM,tags:[["e",e.channel_message_event_id],...e.tags??[]],content:r,created_at:e.created_at},t)},Fq=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Zn({kind:GM,tags:[["p",e.pubkey_to_mute],...e.tags??[]],content:r,created_at:e.created_at},t)};gt({},{EMOJI_SHORTCODE_REGEX:()=>lN,matchAll:()=>Uq,regex:()=>ew,replaceAll:()=>jq});var tw,lN=/:(\w+):/,ew=()=>new RegExp(`\\B${lN.source}\\B`,"g");function*Uq(e){const t=e.matchAll(ew());for(const r of t)try{const[i,s]=r;yield{shortcode:i,name:s,start:r.index,end:r.index+i.length}}catch{}}function jq(e,t){return e.replaceAll(ew(),(r,i)=>t({shortcode:r,name:i}))}gt({},{useFetchImplementation:()=>Vq,validateGithub:()=>Hq});try{tw=fetch}catch{}function Vq(e){tw=e}function Hq(e,t,r){return nw.apply(this,arguments)}function nw(){return(nw=$(function*(e,t,r){try{return(yield(yield tw(`https://gist.github.com/${t}/${r}/raw`)).text())===`Verifying that I control the following Nostr public key: ${e}`}catch{return!1}})).apply(this,arguments)}gt({},{decrypt:()=>mN,encrypt:()=>gN,getConversationKey:()=>fN,v2:()=>Zq});var uN=1,dN=65535;function fN(e,t){const r=Sa.getSharedSecret(e,"02"+t).subarray(1,33);return function OM(e,t,r){return $r.hash(e),void 0===r&&(r=new Uint8Array(e.outputLen)),xh(e,Zs(r),Zs(t))}($l,r,"nip44-v2")}function hN(e,t){const r=function PM(e,t,r,i=32){if($r.hash(e),$r.number(i),i>255*e.outputLen)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(i/e.outputLen);void 0===r&&(r=kM);const o=new Uint8Array(s*e.outputLen),a=xh.create(e,t),c=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let u=0;udN)throw new Error("invalid plaintext size: must be between 1 and 65535 bytes");const t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!1),t}(r);return vh(i,t,new Uint8Array(rw(r)-r))}(e),c=L0(i,s,a),l=pN(o,c,r);return Ei.encode(vh(new Uint8Array([2]),r,c,l))}function mN(e,t){const{nonce:r,ciphertext:i,mac:s}=function Wq(e){if("string"!=typeof e)throw new Error("payload must be a valid string");const t=e.length;if(t<132||t>87472)throw new Error("invalid payload length: "+t);if("#"===e[0])throw new Error("unknown encryption version");let r;try{r=Ei.decode(e)}catch(o){throw new Error("invalid base64: "+o.message)}const i=r.length;if(i<99||i>65603)throw new Error("invalid data length: "+i);const s=r[0];if(2!==s)throw new Error("unknown encryption version "+s);return{nonce:r.subarray(1,33),ciphertext:r.subarray(33,-32),mac:r.subarray(-32)}}(e),{chacha_key:o,chacha_nonce:a,hmac_key:c}=hN(t,r);if(!Dh(pN(c,i,r),s))throw new Error("invalid MAC");return function Gq(e){const t=new DataView(e.buffer).getUint16(0),r=e.subarray(2,2+t);if(tdN||r.length!==t||e.length!==2+rw(t))throw new Error("invalid padding");return Gr.decode(r)}(L0(o,a,i))}var sw,Zq={utils:{getConversationKey:fN,calcPaddedLen:rw},encrypt:gN,decrypt:mN};function Qq(e){const{pathname:t,searchParams:r}=new URL(e),i=t,s=r.get("relay"),o=r.get("secret");if(!i||!s||!o)throw new Error("invalid connection string");return{pubkey:i,relay:s,secret:o}}function Yq(e,t,r){return iw.apply(this,arguments)}function iw(){return(iw=$(function*(e,t,r){const s=yield nN(t,e,JSON.stringify({method:"pay_invoice",params:{invoice:r}})),o={kind:ZM,created_at:Math.round(Date.now()/1e3),content:s,tags:[["p",e]]};return Zn(o,t)})).apply(this,arguments)}gt({},{makeNwcRequestEvent:()=>Yq,parseConnectionString:()=>Qq}),gt({},{getZapEndpoint:()=>eG,makeZapReceipt:()=>rG,makeZapRequest:()=>tG,useFetchImplementation:()=>Xq,validateZapRequest:()=>nG});try{sw=fetch}catch{}function Xq(e){sw=e}function eG(e){return ow.apply(this,arguments)}function ow(){return(ow=$(function*(e){try{let t="",{lud06:r,lud16:i}=JSON.parse(e.content);if(r){let{words:a}=Ta.decode(r,1e3),c=Ta.fromWords(a);t=Gr.decode(c)}else{if(!i)return null;{let[a,c]=i.split("@");t=new URL(`/.well-known/lnurlp/${a}`,`https://${c}`).toString()}}let o=yield(yield sw(t)).json();if(o.allowsNostr&&o.nostrPubkey)return o.callback}catch{}return null})).apply(this,arguments)}function tG({profile:e,event:t,amount:r,relays:i,comment:s=""}){if(!r)throw new Error("amount not given");if(!e)throw new Error("profile not given");let o={kind:9734,created_at:Math.round(Date.now()/1e3),content:s,tags:[["p",e],["amount",r.toString()],["relays",...i]]};return t&&o.tags.push(["e",t]),o}function nG(e){let t;try{t=JSON.parse(e)}catch{return"Invalid zap request JSON."}if(!LM(t))return"Zap request is not a valid Nostr event.";if(!ka(t))return"Invalid signature on zap request.";let r=t.tags.find(([o,a])=>"p"===o&&a);if(!r)return"Zap request doesn't have a 'p' tag.";if(!r[1].match(/^[a-f0-9]{64}$/))return"Zap request 'p' tag is not valid hex.";let i=t.tags.find(([o,a])=>"e"===o&&a);return i&&!i[1].match(/^[a-f0-9]{64}$/)?"Zap request 'e' tag is not valid hex.":t.tags.find(([o,a])=>"relays"===o&&a)?null:"Zap request doesn't have a 'relays' tag."}function rG({zapRequest:e,preimage:t,bolt11:r,paidAt:i}){let s=JSON.parse(e),o=s.tags.filter(([c])=>"e"===c||"p"===c||"a"===c),a={kind:9735,created_at:Math.round(i.getTime()/1e3),content:"",tags:[...o,["P",s.pubkey],["bolt11",r],["description",e]]};return t&&a.tags.push(["preimage",t]),a}gt({},{getToken:()=>sG,hashPayload:()=>uw,unpackEventFromToken:()=>vN,validateEvent:()=>CN,validateEventKind:()=>_N,validateEventMethodTag:()=>EN,validateEventPayloadTag:()=>DN,validateEventTimestamp:()=>wN,validateEventUrlTag:()=>bN,validateToken:()=>oG});var yN="Nostr ";function sG(e,t,r){return aw.apply(this,arguments)}function aw(){return(aw=$(function*(e,t,r,i=!1,s){const o={kind:H0,tags:[["u",e],["method",t]],created_at:Math.round((new Date).getTime()/1e3),content:""};s&&o.tags.push(["payload",uw(s)]);const a=yield r(o);return(i?yN:"")+Ei.encode(hr.encode(JSON.stringify(a)))})).apply(this,arguments)}function oG(e,t,r){return cw.apply(this,arguments)}function cw(){return(cw=$(function*(e,t,r){const i=yield vN(e).catch(o=>{throw o});return yield CN(i,t,r).catch(o=>{throw o})})).apply(this,arguments)}function vN(e){return lw.apply(this,arguments)}function lw(){return(lw=$(function*(e){if(!e)throw new Error("Missing token");e=e.replace(yN,"");const t=Gr.decode(Ei.decode(e));if(!t||0===t.length||!t.startsWith("{"))throw new Error("Invalid token");return JSON.parse(t)})).apply(this,arguments)}function wN(e){return!!e.created_at&&Math.round((new Date).getTime()/1e3)-e.created_at<60}function _N(e){return e.kind===H0}function bN(e,t){const r=e.tags.find(i=>"u"===i[0]);return!!r&&r.length>0&&r[1]===t}function EN(e,t){const r=e.tags.find(i=>"method"===i[0]);return!!r&&r.length>0&&r[1].toLowerCase()===t.toLowerCase()}function uw(e){return _n($l(hr.encode(JSON.stringify(e))))}function DN(e,t){const r=e.tags.find(s=>"payload"===s[0]);if(!r)return!1;const i=uw(t);return r.length>0&&r[1]===i}function CN(e,t,r,i){return dw.apply(this,arguments)}function dw(){return(dw=$(function*(e,t,r,i){if(!ka(e))throw new Error("Invalid nostr event, signature invalid");if(!_N(e))throw new Error("Invalid nostr event, kind invalid");if(!wN(e))throw new Error("Invalid nostr event, created_at timestamp invalid");if(!bN(e,t))throw new Error("Invalid nostr event, url tag invalid");if(!EN(e,r))throw new Error("Invalid nostr event, method tag invalid");if(i&&"object"==typeof i&&Object.keys(i).length>0&&!DN(e,i))throw new Error("Invalid nostr event, payload tag does not match request body hash");return!0})).apply(this,arguments)}function ss(e){var t,r,i,s=2;for(typeof Symbol<"u"&&(r=Symbol.asyncIterator,i=Symbol.iterator);s--;){if(r&&null!=(t=e[r]))return t.call(e);if(i&&null!=(t=e[i]))return new Uh(t.call(e));r="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function Uh(e){function t(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var i=r.done;return Promise.resolve(r.value).then(function(s){return{value:s,done:i}})}return(Uh=function(i){this.s=i,this.n=i.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(i){var s=this.s.return;return void 0===s?Promise.resolve({value:i,done:!0}):t(s.apply(this.s,arguments))},throw:function(i){var s=this.s.return;return void 0===s?Promise.reject(i):t(s.apply(this.s,arguments))}},new Uh(e)}"object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date;const fw="object"==typeof process&&process?process:{};let jh=globalThis.AbortController,TN=globalThis.AbortSignal;if(typeof jh>"u"){TN=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},jh=class{constructor(){t()}signal=new TN;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let e="1"!==fw.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,((e,t,r,i)=>{"function"==typeof fw.emitWarning?fw.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)})("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var AN,MN;Symbol("type"),Symbol,Symbol,AN=Symbol.iterator,MN=Symbol.toStringTag;class Kn{cache;constructor(t){this.cache=t??new Map}get size(){return this.cache.size}add(t){this.#e(t);for(const r of this){if(Kn.deletes(r,t)||Kn.replaces(r,t))return this;Kn.replaces(t,r)&&this.delete(r)}return this.cache.set(t.id,t),this}#e(t){if(5===t.kind)for(const r of t.tags)if("e"===r[0]){const i=this.cache.get(r[1]);i&&i.pubkey===t.pubkey&&this.delete(i)}}clear(){this.cache.clear()}delete(t){return this.cache.delete(t.id)}forEach(t,r){return this.cache.forEach((i,s)=>t(i,i,this),r)}has(t){return this.cache.has(t.id)}*entries(){for(const t of this.values())yield[t,t]}keys(){return this.values()}*values(){for(const t of Kn.sortEvents([...this.cache.values()]))yield t}[AN](){return this.values()}[MN]="NSet";static isReplaceable(t){return[0,3].includes(t)||1e4<=t&&t<2e4}static isParameterizedReplaceable(t){return 3e4<=t&&t<4e4}static replaces(t,r){const{kind:i,pubkey:s}=t;if(Kn.isReplaceable(i))return i===r.kind&&s===r.pubkey&&Kn.sortEvents([t,r])[0]===t;if(Kn.isParameterizedReplaceable(i)){const o=t.tags.find(([c])=>"d"===c)?.[1]||"",a=r.tags.find(([c])=>"d"===c)?.[1]||"";return i===r.kind&&s===r.pubkey&&Kn.sortEvents([t,r])[0]===t&&o===a}return!1}static deletes(t,r){const{kind:i,pubkey:s,tags:o}=t;if(5===i&&s===r.pubkey)for(const[a,c]of o)if("e"===a&&c===r.id)return!0;return!1}static sortEvents(t){return t.sort((r,i)=>r.created_at!==i.created_at?i.created_at-r.created_at:r.id.localeCompare(i.id))}union(t){throw new Error("Method not implemented.")}intersection(t){throw new Error("Method not implemented.")}difference(t){throw new Error("Method not implemented.")}symmetricDifference(t){throw new Error("Method not implemented.")}isSubsetOf(t){throw new Error("Method not implemented.")}isSupersetOf(t){throw new Error("Method not implemented.")}isDisjointFrom(t){throw new Error("Method not implemented.")}}function Fa(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function pr(e,...t){if(!function lG(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Ql(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}Symbol;const Ba="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Xs=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Wr=(e,t)=>e<<32-t|e>>>t;function kN(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function eo(e){return"string"==typeof e&&(e=kN(e)),pr(e),e}new Uint8Array(new Uint32Array([287454020]).buffer);class PN{clone(){return this._cloneInto()}}function mw(e){const t=i=>e().update(eo(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function yG(e=32){if(Ba&&"function"==typeof Ba.getRandomValues)return Ba.getRandomValues(new Uint8Array(e));if(Ba&&"function"==typeof Ba.randomBytes)return Ba.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}class LN extends PN{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,function pw(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Fa(e.outputLen),Fa(e.blockLen)}(t);const i=eo(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?t.create().update(i).digest():i);for(let a=0;anew LN(e,t).update(r).digest();Jl.create=(e,t)=>new LN(e,t);const wG=(e,t,r)=>e&t^~e&r,_G=(e,t,r)=>e&t^e&r^t&r;class yw extends PN{constructor(t,r,i,s){super(),this.blockLen=t,this.outputLen=r,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Xs(this.buffer)}update(t){Ql(this);const{view:r,buffer:i,blockLen:s}=this,o=(t=eo(t)).length;for(let a=0;as-a&&(this.process(i,0),a=0);for(let f=a;f>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)})(i,s-8,BigInt(8*this.length),o),this.process(i,0);const c=Xs(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft)),EG=FN.map(e=>(9*e+5)%16);let vw=[FN],ww=[EG];for(let e=0;e<4;e++)for(let t of[vw,ww])t.push(t[e].map(r=>bG[r]));const AG=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),as=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),cs=new Uint32Array(64);class jN extends yw{constructor(){super(64,32,8,!1),this.A=0|as[0],this.B=0|as[1],this.C=0|as[2],this.D=0|as[3],this.E=0|as[4],this.F=0|as[5],this.G=0|as[6],this.H=0|as[7]}get(){const{A:t,B:r,C:i,D:s,E:o,F:a,G:c,H:l}=this;return[t,r,i,s,o,a,c,l]}set(t,r,i,s,o,a,c,l){this.A=0|t,this.B=0|r,this.C=0|i,this.D=0|s,this.E=0|o,this.F=0|a,this.G=0|c,this.H=0|l}process(t,r){for(let f=0;f<16;f++,r+=4)cs[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=cs[f-15],p=cs[f-2],g=Wr(h,7)^Wr(h,18)^h>>>3,m=Wr(p,17)^Wr(p,19)^p>>>10;cs[f]=m+cs[f-7]+g+cs[f-16]|0}let{A:i,B:s,C:o,D:a,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const p=d+(Wr(c,6)^Wr(c,11)^Wr(c,25))+wG(c,l,u)+AG[f]+cs[f]|0,m=(Wr(i,2)^Wr(i,13)^Wr(i,22))+_G(i,s,o)|0;d=u,u=l,l=c,c=a+p|0,a=o,o=s,s=i,i=p+m|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(i,s,o,a,c,l,u,d)}roundClean(){cs.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const _w=mw(()=>new jN),zh=BigInt(2**32-1),bw=BigInt(32);function $N(e,t=!1){return t?{h:Number(e&zh),l:Number(e>>bw&zh)}:{h:0|Number(e>>bw&zh),l:0|Number(e&zh)}}const ye_split=function MG(e,t=!1){let r=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let s=0;sBigInt(e))),Dw=BigInt(0),Gh=BigInt(1),WG=BigInt(2);function to(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function Xl(e){if(!to(e))throw new Error("Uint8Array expected")}function Ua(e,t){if("boolean"!=typeof t)throw new Error(`${e} must be valid boolean, got "${t}".`)}const ZG=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ja(e){Xl(e);let t="";for(let r=0;r=Ti._0&&e<=Ti._9?e-Ti._0:e>=Ti._A&&e<=Ti._F?e-(Ti._A-10):e>=Ti._a&&e<=Ti._f?e-(Ti._a-10):void 0}function Va(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(r);for(let s=0,o=0;s"bigint"==typeof e&&Dw<=e;function Wh(e,t,r){return Iw(e)&&Iw(t)&&Iw(r)&&t<=e&&eDw;e>>=Gh,t+=1);return t}const Tw=e=>(WG<new Uint8Array(e),qN=e=>Uint8Array.from(e);function GN(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let i=xw(e),s=xw(e),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},c=(...f)=>r(s,i,...f),l=(f=xw())=>{s=c(qN([0]),f),i=c(),0!==f.length&&(s=c(qN([1]),f),i=c())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{let p;for(a(),l(f);!(p=h(u()));)l();return a(),p}}const KG={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||to(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function tu(e,t,r={}){const i=(s,o,a)=>{const c=KG[o];if("function"!=typeof c)throw new Error(`Invalid validator "${o}", expected function`);const l=e[s];if(!(a&&void 0===l||c(l,e)))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${o}`)};for(const[s,o]of Object.entries(t))i(s,o,!1);for(const[s,o]of Object.entries(r))i(s,o,!0);return e}function Aw(e){const t=new WeakMap;return(r,...i)=>{const s=t.get(r);if(void 0!==s)return s;const o=e(r,...i);return t.set(r,o),o}}const Mt=BigInt(0),qe=BigInt(1),ds=BigInt(2),QG=BigInt(3),Mw=BigInt(4),WN=BigInt(5),ZN=BigInt(8);function Lt(e,t){const r=e%t;return r>=Mt?r:t+r}function XG(e,t,r){if(r<=Mt||t 0");if(r===qe)return Mt;let i=qe;for(;t>Mt;)t&qe&&(i=i*e%r),e=e*e%r,t>>=qe;return i}function Qn(e,t,r){let i=e;for(;t-- >Mt;)i*=i,i%=r;return i}function Zh(e,t){if(e===Mt||t<=Mt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Lt(e,t),i=t,s=Mt,o=qe,a=qe,c=Mt;for(;r!==Mt;){const u=i/r,d=i%r,f=s-a*u,h=o-c*u;i=r,r=d,s=a,o=c,a=f,c=h}if(i!==qe)throw new Error("invert: does not exist");return Lt(s,t)}BigInt(9),BigInt(16);const nW=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Nw(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function KN(e,t,r=!1,i={}){if(e<=Mt)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:o}=Nw(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=function tW(e){if(e%Mw===QG){const t=(e+qe)/Mw;return function(i,s){const o=i.pow(s,t);if(!i.eql(i.sqr(o),s))throw new Error("Cannot find square root");return o}}if(e%ZN===WN){const t=(e-WN)/ZN;return function(i,s){const o=i.mul(s,ds),a=i.pow(o,t),c=i.mul(s,a),l=i.mul(i.mul(c,ds),a),u=i.mul(c,i.sub(l,i.ONE));if(!i.eql(i.sqr(u),s))throw new Error("Cannot find square root");return u}}return function eW(e){const t=(e-qe)/ds;let r,i,s;for(r=e-qe,i=0;r%ds===Mt;r/=ds,i++);for(s=ds;sLt(l,e),isValid:l=>{if("bigint"!=typeof l)throw new Error("Invalid field element: expected bigint, got "+typeof l);return Mt<=l&&ll===Mt,isOdd:l=>(l&qe)===qe,neg:l=>Lt(-l,e),eql:(l,u)=>l===u,sqr:l=>Lt(l*l,e),add:(l,u)=>Lt(l+u,e),sub:(l,u)=>Lt(l-u,e),mul:(l,u)=>Lt(l*u,e),pow:(l,u)=>function iW(e,t,r){if(r 0");if(r===Mt)return e.ONE;if(r===qe)return t;let i=e.ONE,s=t;for(;r>Mt;)r&qe&&(i=e.mul(i,s)),s=e.sqr(s),r>>=qe;return i}(c,l,u),div:(l,u)=>Lt(l*Zh(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Zh(l,e),sqrt:i.sqrt||(l=>a(c,l)),invertBatch:l=>function sW(e,t){const r=new Array(t.length),i=t.reduce((o,a,c)=>e.is0(a)?o:(r[c]=o,e.mul(o,a)),e.ONE),s=e.inv(i);return t.reduceRight((o,a,c)=>e.is0(a)?o:(r[c]=e.mul(o,r[c]),e.mul(o,a)),s),r}(c,l),cmov:(l,u,d)=>d?u:l,toBytes:l=>r?Sw(l,o):Ha(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?Cw(l):no(l)}});return Object.freeze(c)}function QN(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function YN(e){const t=QN(e);return t+Math.ceil(t/2)}const cW=BigInt(0),Rw=BigInt(1),Ow=new WeakMap,JN=new WeakMap;function XN(e){return function rW(e){tu(e,nW.reduce((i,s)=>(i[s]="function",i),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(e.Fp),tu(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Nw(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function eR(e){void 0!==e.lowS&&Ua("lowS",e.lowS),void 0!==e.prehash&&Ua("prehash",e.prehash)}const{Ph:fW,aT:hW}=qp,xi={Err:class extends Error{constructor(t=""){super(t)}},_tlv:{encode:(e,t)=>{const{Err:r}=xi;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");const i=t.length/2,s=$a(i);if(s.length/2&128)throw new r("tlv.encode: long form length too big");const o=i>127?$a(s.length/2|128):"";return`${$a(e)}${o}${s}${t}`},decode(e,t){const{Err:r}=xi;let i=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new r("tlv.decode: wrong tlv");const s=t[i++];let a=0;if(128&s){const l=127&s;if(!l)throw new r("tlv.decode(long): indefinite length not supported");if(l>4)throw new r("tlv.decode(long): byte length is too big");const u=t.subarray(i,i+l);if(u.length!==l)throw new r("tlv.decode: length bytes not complete");if(0===u[0])throw new r("tlv.decode(long): zero leftmost byte");for(const d of u)a=a<<8|d;if(i+=l,a<128)throw new r("tlv.decode(long): not minimal encoding")}else a=s;const c=t.subarray(i,i+a);if(c.length!==a)throw new r("tlv.decode: wrong value length");return{v:c,l:t.subarray(i+a)}}},_int:{encode(e){const{Err:t}=xi;if(e{const w=y.toAffine();return eu(Uint8Array.from([4]),r.toBytes(w.x),r.toBytes(w.y))}),o=t.fromBytes||(m=>{const y=m.subarray(1);return{x:r.fromBytes(y.subarray(0,r.BYTES)),y:r.fromBytes(y.subarray(r.BYTES,2*r.BYTES))}});function a(m){const{a:y,b:v}=t,w=r.sqr(m),_=r.mul(w,m);return r.add(r.add(_,r.mul(m,y)),v)}if(!r.eql(r.sqr(t.Gy),a(t.Gx)))throw new Error("bad generator point: equation left != right");function l(m){const{allowedPrivateKeyLengths:y,nByteLength:v,wrapPrivateKey:w,n:_}=t;if(y&&"bigint"!=typeof m){if(to(m)&&(m=ja(m)),"string"!=typeof m||!y.includes(m.length))throw new Error("Invalid key");m=m.padStart(2*v,"0")}let b;try{b="bigint"==typeof m?m:no(gr("private key",m,v))}catch{throw new Error(`private key must be ${v} bytes, hex or bigint, not ${typeof m}`)}return w&&(b=Lt(b,_)),ro("private key",b,$e,_),b}function u(m){if(!(m instanceof h))throw new Error("ProjectivePoint expected")}const d=Aw((m,y)=>{const{px:v,py:w,pz:_}=m;if(r.eql(_,r.ONE))return{x:v,y:w};const b=m.is0();null==y&&(y=b?r.ONE:r.inv(_));const C=r.mul(v,y),D=r.mul(w,y),S=r.mul(_,y);if(b)return{x:r.ZERO,y:r.ZERO};if(!r.eql(S,r.ONE))throw new Error("invZ was invalid");return{x:C,y:D}}),f=Aw(m=>{if(m.is0()){if(t.allowInfinityPoint&&!r.is0(m.py))return;throw new Error("bad point: ZERO")}const{x:y,y:v}=m.toAffine();if(!r.isValid(y)||!r.isValid(v))throw new Error("bad point: x or y not FE");const w=r.sqr(v),_=a(y);if(!r.eql(w,_))throw new Error("bad point: equation left != right");if(!m.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class h{constructor(y,v,w){if(this.px=y,this.py=v,this.pz=w,null==y||!r.isValid(y))throw new Error("x required");if(null==v||!r.isValid(v))throw new Error("y required");if(null==w||!r.isValid(w))throw new Error("z required");Object.freeze(this)}static fromAffine(y){const{x:v,y:w}=y||{};if(!y||!r.isValid(v)||!r.isValid(w))throw new Error("invalid affine point");if(y instanceof h)throw new Error("projective point not allowed");const _=b=>r.eql(b,r.ZERO);return _(v)&&_(w)?h.ZERO:new h(v,w,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(y){const v=r.invertBatch(y.map(w=>w.pz));return y.map((w,_)=>w.toAffine(v[_])).map(h.fromAffine)}static fromHex(y){const v=h.fromAffine(o(gr("pointHex",y)));return v.assertValidity(),v}static fromPrivateKey(y){return h.BASE.multiply(l(y))}static msm(y,v){return function uW(e,t,r,i){if(!Array.isArray(r)||!Array.isArray(i)||i.length!==r.length)throw new Error("arrays of points and scalars must have equal length");i.forEach((d,f)=>{if(!t.isValid(d))throw new Error(`wrong scalar at index ${f}`)}),r.forEach((d,f)=>{if(!(d instanceof e))throw new Error(`wrong point at index ${f}`)});const s=zN(BigInt(r.length)),o=s>12?s-3:s>4?s-2:s?2:1,a=(1<=0;d-=o){c.fill(e.ZERO);for(let h=0;h>BigInt(d)&BigInt(a));c[g]=c[g].add(r[h])}let f=e.ZERO;for(let h=c.length-1,p=e.ZERO;h>0;h--)p=p.add(c[h]),f=f.add(p);if(u=u.add(f),0!==d)for(let h=0;hmr||D>mr;)b&$e&&(S=S.add(O)),D&$e&&(T=T.add(O)),O=O.double(),b>>=$e,D>>=$e;return _&&(S=S.negate()),C&&(T=T.negate()),T=new h(r.mul(T.px,w.beta),T.py,T.pz),S.add(T)}multiply(y){const{endo:v,n:w}=t;let _,b;if(ro("scalar",y,$e,w),v){const{k1neg:C,k1:D,k2neg:S,k2:T}=v.splitScalar(y);let{p:O,f:U}=this.wNAF(D),{p:B,f:j}=this.wNAF(T);O=g.constTimeNegate(C,O),B=g.constTimeNegate(S,B),B=new h(r.mul(B.px,v.beta),B.py,B.pz),_=O.add(B),b=U.add(j)}else{const{p:C,f:D}=this.wNAF(y);_=C,b=D}return h.normalizeZ([_,b])[0]}multiplyAndAddUnsafe(y,v,w){const _=h.BASE,b=(D,S)=>S!==mr&&S!==$e&&D.equals(_)?D.multiply(S):D.multiplyUnsafe(S),C=b(this,v).add(b(y,w));return C.is0()?void 0:C}toAffine(y){return d(this,y)}isTorsionFree(){const{h:y,isTorsionFree:v}=t;if(y===$e)return!0;if(v)return v(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:y,clearCofactor:v}=t;return y===$e?this:v?v(h,this):this.multiplyUnsafe(t.h)}toRawBytes(y=!0){return Ua("isCompressed",y),this.assertValidity(),s(h,this,y)}toHex(y=!0){return Ua("isCompressed",y),ja(this.toRawBytes(y))}}h.BASE=new h(t.Gx,t.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);const p=t.nBitLength,g=function lW(e,t){const r=(o,a)=>{const c=a.negate();return o?c:a},i=o=>{if(!Number.isSafeInteger(o)||o<=0||o>t)throw new Error(`Wrong window size=${o}, should be [1..${t}]`)},s=o=>(i(o),{windows:Math.ceil(t/o)+1,windowSize:2**(o-1)});return{constTimeNegate:r,unsafeLadder(o,a){let c=e.ZERO,l=o;for(;a>cW;)a&Rw&&(c=c.add(l)),l=l.double(),a>>=Rw;return c},precomputeWindow(o,a){const{windows:c,windowSize:l}=s(a),u=[];let d=o,f=d;for(let h=0;h>=g,v>u&&(v-=p,c+=Rw);const w=y,_=y+Math.abs(v)-1,C=v<0;0===v?f=f.add(r(m%2!=0,a[w])):d=d.add(r(C,a[_]))}return{p:d,f}},wNAFCached(o,a,c){const l=JN.get(o)||1;let u=Ow.get(o);return u||(u=this.precomputeWindow(o,l),1!==l&&Ow.set(o,c(u))),this.wNAF(l,u,a)},setWindowSize(o,a){i(a),JN.set(o,a),Ow.delete(o)}}}(h,t.endo?Math.ceil(p/2):p);return{CURVE:t,ProjectivePoint:h,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:function c(m){return Wh(m,$e,t.n)}}}({...t,toBytes(k,I,E){const x=I.toAffine(),R=r.toBytes(x.x),A=eu;return Ua("isCompressed",E),E?A(Uint8Array.from([I.hasEvenY()?2:3]),R):A(Uint8Array.from([4]),R,r.toBytes(x.y))},fromBytes(k){const I=k.length,E=k[0],x=k.subarray(1);if(I!==s||2!==E&&3!==E){if(I===o&&4===E)return{x:r.fromBytes(x.subarray(0,r.BYTES)),y:r.fromBytes(x.subarray(r.BYTES,2*r.BYTES))};throw new Error(`Point of length ${I} was invalid. Expected ${s} compressed bytes or ${o} uncompressed bytes`)}{const R=no(x);if(!Wh(R,$e,r.ORDER))throw new Error("Point is not on curve");const A=d(R);let H;try{H=r.sqrt(A)}catch(_e){const le=_e instanceof Error?": "+_e.message:"";throw new Error("Point is not on curve"+le)}return!(1&~E)!=((H&$e)===$e)&&(H=r.neg(H)),{x:R,y:H}}}}),h=k=>ja(Ha(k,t.nByteLength));function p(k){return k>i>>$e}const m=(k,I,E)=>no(k.slice(I,E));class y{constructor(I,E,x){this.r=I,this.s=E,this.recovery=x,this.assertValidity()}static fromCompact(I){const E=t.nByteLength;return I=gr("compactSignature",I,2*E),new y(m(I,0,E),m(I,E,2*E))}static fromDER(I){const{r:E,s:x}=xi.toSig(gr("DER",I));return new y(E,x)}assertValidity(){ro("r",this.r,$e,i),ro("s",this.s,$e,i)}addRecoveryBit(I){return new y(this.r,this.s,I)}recoverPublicKey(I){const{r:E,s:x,recovery:R}=this,A=D(gr("msgHash",I));if(null==R||![0,1,2,3].includes(R))throw new Error("recovery id invalid");const H=2===R||3===R?E+t.n:E;if(H>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const J=l.fromHex((1&R?"03":"02")+h(H)),_e=c(H),le=a(-A*_e),lt=a(x*_e),st=l.BASE.multiplyAndAddUnsafe(J,le,lt);if(!st)throw new Error("point at infinify");return st.assertValidity(),st}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Va(this.toDERHex())}toDERHex(){return xi.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Va(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(k){try{return u(k),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const k=YN(t.n);return function aW(e,t,r=!1){const i=e.length,s=QN(t),o=YN(t);if(i<16||i1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const c=Lt(r?no(e):Cw(e),t-qe)+qe;return r?Sw(c,s):Ha(c,s)}(t.randomBytes(k),t.n)},precompute:(k=8,I=l.BASE)=>(I._setWindowSize(k),I.multiply(BigInt(3)),I)};function _(k){const I=to(k),E="string"==typeof k,x=(I||E)&&k.length;return I?x===s||x===o:E?x===2*s||x===2*o:k instanceof l}const C=t.bits2int||function(k){const I=no(k),E=8*k.length-t.nBitLength;return E>0?I>>BigInt(E):I},D=t.bits2int_modN||function(k){return a(C(k))},S=Tw(t.nBitLength);function T(k){return ro(`num < 2^${t.nBitLength}`,k,mr,S),Ha(k,t.nByteLength)}const U={lowS:t.lowS,prehash:!1},B={lowS:t.lowS,prehash:!1};return l.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function w(k,I=!0){return l.fromPrivateKey(k).toRawBytes(I)},getSharedSecret:function b(k,I,E=!0){if(_(k))throw new Error("first arg must be private key");if(!_(I))throw new Error("second arg must be public key");return l.fromHex(I).multiply(u(k)).toRawBytes(E)},sign:function j(k,I,E=U){const{seed:x,k2sig:R}=function O(k,I,E=U){if(["recovered","canonical"].some(tt=>tt in E))throw new Error("sign() legacy options not supported");const{hash:x,randomBytes:R}=t;let{lowS:A,prehash:H,extraEntropy:Q}=E;null==A&&(A=!0),k=gr("msgHash",k),eR(E),H&&(k=gr("prehashed msgHash",x(k)));const J=D(k),_e=u(I),le=[T(_e),T(J)];if(null!=Q&&!1!==Q){const tt=!0===Q?R(r.BYTES):Q;le.push(gr("extraEntropy",tt))}const lt=eu(...le),st=J;return{seed:lt,k2sig:function Se(tt){const Ae=C(tt);if(!f(Ae))return;const Cn=c(Ae),Bt=l.BASE.multiply(Ae).toAffine(),Ut=a(Bt.x);if(Ut===mr)return;const br=a(Cn*a(st+Ut*_e));if(br===mr)return;let go=(Bt.x===Ut?0:2)|Number(Bt.y&$e),Vu=br;return A&&p(br)&&(Vu=function g(k){return p(k)?a(-k):k}(br),go^=1),new y(Ut,Vu,go)}}}(k,I,E);return GN(t.hash.outputLen,t.nByteLength,t.hmac)(x,R)},verify:function Y(k,I,E,x=B){const R=k;if(I=gr("msgHash",I),E=gr("publicKey",E),"strict"in x)throw new Error("options.strict was renamed to lowS");eR(x);const{lowS:A,prehash:H}=x;let Q,J;try{if("string"==typeof R||to(R))try{Q=y.fromDER(R)}catch(Bt){if(!(Bt instanceof xi.Err))throw Bt;Q=y.fromCompact(R)}else{if("object"!=typeof R||"bigint"!=typeof R.r||"bigint"!=typeof R.s)throw new Error("PARSE");{const{r:Bt,s:Ut}=R;Q=new y(Bt,Ut)}}J=l.fromHex(E)}catch(Bt){if("PARSE"===Bt.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(A&&Q.hasHighS())return!1;H&&(I=t.hash(I));const{r:_e,s:le}=Q,lt=D(I),st=c(le),Se=a(lt*st),tt=a(_e*st),Ae=l.BASE.multiplyAndAddUnsafe(J,Se,tt)?.toAffine();return!!Ae&&a(Ae.x)===_e},ProjectivePoint:l,Signature:y,utils:v}}function vW(e){return{hash:e,hmac:(t,...r)=>Jl(e,t,function Yl(...e){let t=0;for(let i=0;i(e+t/Yh)/t;const kw=KN(nu,void 0,void 0,{sqrt:function rR(e){const t=nu,r=BigInt(3),i=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),c=BigInt(44),l=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=Qn(d,r,t)*d%t,h=Qn(f,r,t)*d%t,p=Qn(h,Yh,t)*u%t,g=Qn(p,s,t)*p%t,m=Qn(g,o,t)*g%t,y=Qn(m,c,t)*m%t,v=Qn(y,l,t)*y%t,w=Qn(v,c,t)*m%t,_=Qn(w,r,t)*d%t,b=Qn(_,a,t)*g%t,C=Qn(b,i,t)*u%t,D=Qn(C,Yh,t);if(!kw.eql(kw.sqr(D),e))throw new Error("Cannot find square root");return D}});(function wW(e,t){const r=i=>mW({...e,...vW(i)});Object.freeze({...r(t),create:r})})({a:BigInt(0),b:BigInt(7),Fp:kw,n:Qh,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Qh,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-ru*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=nR(o*e,t),l=nR(-i*e,t);let u=Lt(e-c*r-l*s,t),d=Lt(-c*i-l*o,t);const f=u>a,h=d>a;if(f&&(u=t-u),h&&(d=t-d),u>a||d>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:h,k2:d}}}},_w),BigInt(0);var IR;function SR(e,t){this.v=e,this.k=t}function hs(e){return new SR(e,0)}function cu(e){var t,r;function i(o,a){try{var c=e[o](a),l=c.value,u=l instanceof SR;Promise.resolve(u?l.v:l).then(function(d){if(u){var f="return"===o?"return":"next";if(!l.k||d.done)return i(f,d);d=e[f](d).value}s(c.done?"return":"normal",d)},function(d){i("throw",d)})}catch(d){s("throw",d)}}function s(o,a){switch(o){case"return":t.resolve({value:a,done:!0});break;case"throw":t.reject(a);break;default:t.resolve({value:a,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(o,a){return new Promise(function(c,l){var u={key:o,arg:a,resolve:c,reject:l,next:null};r?r=r.next=u:(t=r=u,i(o,a))})},"function"!=typeof e.return&&(this.return=void 0)}function ip(e){return function(){return new cu(e.apply(this,arguments))}}kN("Bitcoin seed"),new TextEncoder,(new TextEncoder).encode("0123456789abcdef"),new TextEncoder,new TextDecoder,cu.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},cu.prototype.next=function(e){return this._invoke("next",e)},cu.prototype.throw=function(e){return this._invoke("throw",e)},cu.prototype.return=function(e){return this._invoke("return",e)},IR=Symbol.asyncIterator;class TR{#e=[];#t;#r=!1;constructor(t){t?.aborted?this.abort():t?.addEventListener("abort",()=>this.abort(),{once:!0})}[IR](){var t=this;return ip(function*(){for(;!t.#r;)t.#e.length?yield t.#e.shift():yield hs(new Promise(r=>{t.#t=r}));throw new DOMException("The signal has been aborted","AbortError")})()}push(t){this.#e.push(t),this.#t?.()}abort(){this.#r=!0,this.#t?.()}}class xR{static regular(t){return 1e3<=t&&t<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(t)}static replaceable(t){return 1e4<=t&&t<2e4||[0,3].includes(t)}static ephemeral(t){return 2e4<=t&&t<3e4}static parameterizedReplaceable(t){return 3e4<=t&&t<4e4}}class WW{opts;relays;constructor(t){this.opts=t,this.relays=new Map}relay(t){const r=this.relays.get(t);if(r)return r;{const i=this.opts.open(t);return this.relays.set(t,i),i}}req(t,r){var i=this;return ip(function*(){const s=new AbortController,o=r?.signal?AbortSignal.any([r.signal,s.signal]):s.signal,a=yield hs(i.opts.reqRouter(t));if(a.size<1)return;const c=new TR(o),l=new Set,u=new Set;for(const m of a.keys()){const y=i.relay(m);$(function*(){var _,v=!1,w=!1;try{for(var C,b=ss(y.req(t,{signal:o}));v=!(C=yield b.next()).done;v=!1){const D=C.value;"EOSE"===D[0]&&(l.add(m),l.size===a.size&&c.push(D)),"CLOSED"===D[0]&&(u.add(m),u.size===a.size&&c.push(D)),"EVENT"===D[0]&&c.push(D)}}catch(D){w=!0,_=D}finally{try{v&&null!=b.return&&(yield b.return())}finally{if(w)throw _}}})().catch(()=>{})}try{var h,d=!1,f=!1;try{for(var g,p=ss(c);d=!(g=yield hs(p.next())).done;d=!1)yield g.value}catch(m){f=!0,h=m}finally{try{d&&null!=p.return&&(yield hs(p.return()))}finally{if(f)throw h}}}finally{s.abort()}})()}event(t,r){var i=this;return $(function*(){const s=yield i.opts.eventRouter(t);s.length<1||(yield Promise.any(s.map(o=>i.relay(o).event(t,r))))})()}query(t,r){var i=this;return $(function*(){const s=new Kn,o=t.reduce((h,p)=>h+KM(p),0);if(0===o)return[];const a=t.reduce((h,p)=>h||!!p.kinds?.some(g=>xR.replaceable(g)||xR.parameterizedReplaceable(g)),!1);try{var u,c=!1,l=!1;try{for(var f,d=ss(i.req(t,r));c=!(f=yield d.next()).done;c=!1){const h=f.value;if("EOSE"===h[0])break;if("EVENT"===h[0]&&s.add(h[2]),"CLOSED"===h[0])throw new Error("Subscription closed");if(!a&&s.size>=o)break}}catch(h){l=!0,u=h}finally{try{c&&null!=d.return&&(yield d.return())}finally{if(l)throw u}}}catch{}return[...s]})()}}class ZW{constructor(t,r){if(this._retries=0,!Number.isInteger(t)||t<0)throw new Error("Base must be a positive integer or zero");if(void 0!==r&&(!Number.isInteger(r)||r<0))throw new Error("ExpMax must be a undefined, a positive integer or zero");this.base=t,this.expMax=r,this.i=0}get retries(){return this._retries}get current(){return this.base*Math.pow(2,this.i)}next(){return this._retries++,this.i=void 0===this.expMax?this.i+1:Math.min(this.i+1,this.expMax),this.current}reset(){this._retries=0,this.i=0}}var xe,Ge=function(e){return e.open="open",e.close="close",e.error="error",e.message="message",e.retry="retry",e.reconnect="reconnect",e}(Ge||{});class KW{constructor(t,r,i){var s,o,a,c,l,u,d,f,h,p,g,m,y,v,w;this._closedByUser=!1,this.handleOpenEvent=_=>this.handleEvent(Ge.open,_),this.handleErrorEvent=_=>this.handleEvent(Ge.error,_),this.handleCloseEvent=_=>this.handleEvent(Ge.close,_),this.handleMessageEvent=_=>this.handleEvent(Ge.message,_),this._url=t,this._protocols=r,this._options={buffer:i?.buffer,retry:{maxRetries:null===(s=i?.retry)||void 0===s?void 0:s.maxRetries,instantReconnect:null===(o=i?.retry)||void 0===o?void 0:o.instantReconnect,backoff:null===(a=i?.retry)||void 0===a?void 0:a.backoff},listeners:{open:[...null!==(l=null===(c=i?.listeners)||void 0===c?void 0:c.open)&&void 0!==l?l:[]],close:[...null!==(d=null===(u=i?.listeners)||void 0===u?void 0:u.close)&&void 0!==d?d:[]],error:[...null!==(h=null===(f=i?.listeners)||void 0===f?void 0:f.error)&&void 0!==h?h:[]],message:[...null!==(g=null===(p=i?.listeners)||void 0===p?void 0:p.message)&&void 0!==g?g:[]],retry:[...null!==(y=null===(m=i?.listeners)||void 0===m?void 0:m.retry)&&void 0!==y?y:[]],reconnect:[...null!==(w=null===(v=i?.listeners)||void 0===v?void 0:v.reconnect)&&void 0!==w?w:[]]}},this._underlyingWebsocket=this.tryConnect()}get url(){return this._url}get protocols(){return this._protocols}get buffer(){return this._options.buffer}get maxRetries(){return this._options.retry.maxRetries}get instantReconnect(){return this._options.retry.instantReconnect}get backoff(){return this._options.retry.backoff}get closedByUser(){return this._closedByUser}get lastConnection(){return this._lastConnection}get underlyingWebsocket(){return this._underlyingWebsocket}get readyState(){return this._underlyingWebsocket.readyState}get bufferedAmount(){return this._underlyingWebsocket.bufferedAmount}get extensions(){return this._underlyingWebsocket.extensions}get binaryType(){return this._underlyingWebsocket.binaryType}set binaryType(t){this._underlyingWebsocket.binaryType=t}send(t){this.closedByUser||(this._underlyingWebsocket.readyState===this._underlyingWebsocket.OPEN?this._underlyingWebsocket.send(t):void 0!==this.buffer&&this.buffer.add(t))}close(t,r){this.cancelScheduledConnectionRetry(),this._closedByUser=!0,this._underlyingWebsocket.close(t,r)}addEventListener(t,r,i){this._options.listeners[t].push({listener:r,options:i})}removeEventListener(t,r,i){this._options.listeners[t]=this._options.listeners[t].filter(o=>o.listener!==r||o.options!==i)}tryConnect(){return this._underlyingWebsocket=new WebSocket(this.url,this.protocols),this._underlyingWebsocket.addEventListener(Ge.open,this.handleOpenEvent),this._underlyingWebsocket.addEventListener(Ge.close,this.handleCloseEvent),this._underlyingWebsocket.addEventListener(Ge.error,this.handleErrorEvent),this._underlyingWebsocket.addEventListener(Ge.message,this.handleMessageEvent),this._underlyingWebsocket}clearWebsocket(){this._underlyingWebsocket.removeEventListener(Ge.open,this.handleOpenEvent),this._underlyingWebsocket.removeEventListener(Ge.close,this.handleCloseEvent),this._underlyingWebsocket.removeEventListener(Ge.error,this.handleErrorEvent),this._underlyingWebsocket.removeEventListener(Ge.message,this.handleMessageEvent),this._underlyingWebsocket.close()}dispatchEvent(t,r){const s=[];this._options.listeners[t].forEach(({listener:o,options:a})=>{o(this,r),(void 0===a||void 0===a.once||!a.once)&&s.push({listener:o,options:a})}),this._options.listeners[t]=s}handleEvent(t,r){switch(t){case Ge.close:this.dispatchEvent(t,r),this.scheduleConnectionRetryIfNeeded();break;case Ge.open:if(void 0!==this.backoff&&void 0!==this._lastConnection){const i={retries:this.backoff.retries,lastConnection:new Date(this._lastConnection)},s=new CustomEvent(Ge.reconnect,{detail:i});this.dispatchEvent(Ge.reconnect,s),this.backoff.reset()}this._lastConnection=new Date,this.dispatchEvent(t,r),this.sendBufferedData();break;case Ge.retry:this.dispatchEvent(t,r),this.clearWebsocket(),this.tryConnect();break;default:this.dispatchEvent(t,r)}}sendBufferedData(){if(void 0!==this.buffer)for(let t=this.buffer.read();void 0!==t;t=this.buffer.read())this.send(t)}scheduleConnectionRetryIfNeeded(){if(this.closedByUser||void 0===this.backoff)return;const t=i=>{const s=new CustomEvent(Ge.retry,{detail:i});this.handleEvent(Ge.retry,s)},r={backoff:!0===this._options.retry.instantReconnect?0:this.backoff.next(),retries:!0===this._options.retry.instantReconnect?0:this.backoff.retries,lastConnection:this._lastConnection};(void 0===this._options.retry.maxRetries||r.retries<=this._options.retry.maxRetries)&&(this.retryTimeout=globalThis.setTimeout(()=>t(r),r.backoff))}cancelScheduledConnectionRetry(){globalThis.clearTimeout(this.retryTimeout)}}class QW{constructor(t){this._url=t}get url(){return this._url}withProtocols(t){return this._protocols=t,this}get protocols(){return this._protocols}withMaxRetries(t){var r;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},null===(r=this._options)||void 0===r?void 0:r.retry),{maxRetries:t})}),this}get maxRetries(){var t,r;return null===(r=null===(t=this._options)||void 0===t?void 0:t.retry)||void 0===r?void 0:r.maxRetries}withInstantReconnect(t){var r;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},null===(r=this._options)||void 0===r?void 0:r.retry),{instantReconnect:t})}),this}get instantReconnect(){var t,r;return null===(r=null===(t=this._options)||void 0===t?void 0:t.retry)||void 0===r?void 0:r.instantReconnect}withBackoff(t){var r;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},null===(r=this._options)||void 0===r?void 0:r.retry),{backoff:t})}),this}get backoff(){var t,r;return null===(r=null===(t=this._options)||void 0===t?void 0:t.retry)||void 0===r?void 0:r.backoff}withBuffer(t){return this._options=Object.assign(Object.assign({},this._options),{buffer:t}),this}get buffer(){var t;return null===(t=this._options)||void 0===t?void 0:t.buffer}onOpen(t,r){return this.addListener(Ge.open,t,r),this}onClose(t,r){return this.addListener(Ge.close,t,r),this}onError(t,r){return this.addListener(Ge.error,t,r),this}onMessage(t,r){return this.addListener(Ge.message,t,r),this}onRetry(t,r){return this.addListener(Ge.retry,t,r),this}onReconnect(t,r){return this.addListener(Ge.reconnect,t,r),this}build(){return new KW(this._url,this._protocols,this._options)}addListener(t,r,i){var s,o,a,c,l,u,d,f,h,p,g,m,y,v,w,_,b,C,D,S,T;return this._options=Object.assign(Object.assign({},this._options),{listeners:{open:null!==(a=null===(o=null===(s=this._options)||void 0===s?void 0:s.listeners)||void 0===o?void 0:o.open)&&void 0!==a?a:[],close:null!==(u=null===(l=null===(c=this._options)||void 0===c?void 0:c.listeners)||void 0===l?void 0:l.close)&&void 0!==u?u:[],error:null!==(h=null===(f=null===(d=this._options)||void 0===d?void 0:d.listeners)||void 0===f?void 0:f.error)&&void 0!==h?h:[],message:null!==(m=null===(g=null===(p=this._options)||void 0===p?void 0:p.listeners)||void 0===g?void 0:g.message)&&void 0!==m?m:[],retry:null!==(w=null===(v=null===(y=this._options)||void 0===y?void 0:y.listeners)||void 0===v?void 0:v.retry)&&void 0!==w?w:[],reconnect:null!==(C=null===(b=null===(_=this._options)||void 0===_?void 0:_.listeners)||void 0===b?void 0:b.reconnect)&&void 0!==C?C:[],[t]:[...null!==(T=null===(S=null===(D=this._options)||void 0===D?void 0:D.listeners)||void 0===S?void 0:S[t])&&void 0!==T?T:[],{listener:r,options:i}]}}),this}}class YW{constructor(){this.elements=[]}add(t){this.elements.push(t)}clear(){this.elements.length=0}forEach(t){this.elements.forEach(t)}length(){return this.elements.length}isEmpty(){return 0===this.elements.length}peek(){return this.elements[0]}read(){return this.elements.shift()}}!function(e){e.assertEqual=s=>s,e.assertIs=function t(s){},e.assertNever=function r(s){throw new Error},e.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(c=>"number"!=typeof s[s[c]]),a={};for(const c of o)a[c]=s[c];return e.objectValues(a)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys="function"==typeof Object.keys?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},e.find=(s,o)=>{for(const a of s)if(o(a))return a},e.isInteger="function"==typeof Number.isInteger?s=>Number.isInteger(s):s=>"number"==typeof s&&isFinite(s)&&Math.floor(s)===s,e.joinValues=function i(s,o=" | "){return s.map(a=>"string"==typeof a?`'${a}'`:a).join(o)},e.jsonStringifyReplacer=(s,o)=>"bigint"==typeof o?o.toString():o}(xe||(xe={}));var AR=function(e){return e.mergeShapes=(t,r)=>({...t,...r}),e}(AR||{});const W=xe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ps=e=>{switch(typeof e){case"undefined":return W.undefined;case"string":return W.string;case"number":return isNaN(e)?W.nan:W.number;case"boolean":return W.boolean;case"function":return W.function;case"bigint":return W.bigint;case"symbol":return W.symbol;case"object":return Array.isArray(e)?W.array:null===e?W.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?W.promise:typeof Map<"u"&&e instanceof Map?W.map:typeof Set<"u"&&e instanceof Set?W.set:typeof Date<"u"&&e instanceof Date?W.date:W.object;default:return W.unknown}},L=xe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);let Mi=(()=>{class e extends Error{constructor(r){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=r}get errors(){return this.issues}format(r){const i=r||function(a){return a.message},s={_errors:[]},o=a=>{for(const c of a.issues)if("invalid_union"===c.code)c.unionErrors.map(o);else if("invalid_return_type"===c.code)o(c.returnTypeError);else if("invalid_arguments"===c.code)o(c.argumentsError);else if(0===c.path.length)s._errors.push(i(c));else{let l=s,u=0;for(;ui.message)){const i={},s=[];for(const o of this.issues)o.path.length>0?(i[o.path[0]]=i[o.path[0]]||[],i[o.path[0]].push(r(o))):s.push(r(o));return{formErrors:s,fieldErrors:i}}get formErrors(){return this.flatten()}}return e.create=t=>new e(t),e})();const qa=(e,t)=>{let r;switch(e.code){case L.invalid_type:r=e.received===W.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case L.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,xe.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:r=`Unrecognized key(s) in object: ${xe.joinValues(e.keys,", ")}`;break;case L.invalid_union:r="Invalid input";break;case L.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${xe.joinValues(e.options)}`;break;case L.invalid_enum_value:r=`Invalid enum value. Expected ${xe.joinValues(e.options)}, received '${e.received}'`;break;case L.invalid_arguments:r="Invalid function arguments";break;case L.invalid_return_type:r="Invalid function return type";break;case L.invalid_date:r="Invalid date";break;case L.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:xe.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case L.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case L.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case L.custom:r="Invalid input";break;case L.invalid_intersection_types:r="Intersection results could not be merged";break;case L.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case L.not_finite:r="Number must be finite";break;default:r=t.defaultError,xe.assertNever(e)}return{message:r}};let MR=qa;function sp(){return MR}const op=e=>{const{data:t,path:r,errorMaps:i,issueData:s}=e,o=[...r,...s.path||[]],a={...s,path:o};if(void 0!==s.message)return{...s,path:o,message:s.message};let c="";const l=i.filter(u=>!!u).slice().reverse();for(const u of l)c=u(a,{data:t,defaultError:c}).message;return{...s,path:o,message:c}};function q(e,t){const r=sp(),i=op({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===qa?void 0:qa].filter(s=>!!s)});e.common.issues.push(i)}class Qt{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,r){const i=[];for(const s of r){if("aborted"===s.status)return oe;"dirty"===s.status&&t.dirty(),i.push(s.value)}return{status:t.value,value:i}}static mergeObjectAsync(t,r){return $(function*(){const i=[];for(const s of r){const o=yield s.key,a=yield s.value;i.push({key:o,value:a})}return Qt.mergeObjectSync(t,i)})()}static mergeObjectSync(t,r){const i={};for(const s of r){const{key:o,value:a}=s;if("aborted"===o.status||"aborted"===a.status)return oe;"dirty"===o.status&&t.dirty(),"dirty"===a.status&&t.dirty(),"__proto__"!==o.value&&(typeof a.value<"u"||s.alwaysSet)&&(i[o.value]=a.value)}return{status:t.value,value:i}}}const oe=Object.freeze({status:"aborted"}),Ga=e=>({status:"dirty",value:e}),un=e=>({status:"valid",value:e}),Zw=e=>"aborted"===e.status,Kw=e=>"dirty"===e.status,lu=e=>"valid"===e.status,uu=e=>typeof Promise<"u"&&e instanceof Promise;function ap(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}function NR(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r}"function"==typeof SuppressedError&&SuppressedError;var du,fu,te=function(e){return e.errToObj=t=>"string"==typeof t?{message:t}:t||{},e.toString=t=>"string"==typeof t?t:t?.message,e}(te||{});class Zr{constructor(t,r,i,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=i,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const RR=(e,t)=>{if(lu(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Mi(e.common.issues);return this._error=r,this._error}}};function pe(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:i,description:s}=e;if(t&&(r||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(a,c)=>{var l,u;const{message:d}=e;return"invalid_enum_value"===a.code?{message:d??c.defaultError}:typeof c.data>"u"?{message:null!==(l=d??i)&&void 0!==l?l:c.defaultError}:"invalid_type"!==a.code?{message:c.defaultError}:{message:null!==(u=d??r)&&void 0!==u?u:c.defaultError}},description:s}}class ve{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return ps(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ps(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Qt,ctx:{common:t.parent.common,data:t.data,parsedType:ps(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(uu(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const i=this.safeParse(t,r);if(i.success)return i.data;throw i.error}safeParse(t,r){var i;const s={common:{issues:[],async:null!==(i=r?.async)&&void 0!==i&&i,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ps(t)},o=this._parseSync({data:t,path:s.path,parent:s});return RR(s,o)}parseAsync(t,r){var i=this;return $(function*(){const s=yield i.safeParseAsync(t,r);if(s.success)return s.data;throw s.error})()}safeParseAsync(t,r){var i=this;return $(function*(){const s={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:i._def.errorMap,parent:null,data:t,parsedType:ps(t)},o=i._parse({data:t,path:s.path,parent:s}),a=yield uu(o)?o:Promise.resolve(o);return RR(s,a)})()}refine(t,r){const i=s=>"string"==typeof r||typeof r>"u"?{message:r}:"function"==typeof r?r(s):r;return this._refinement((s,o)=>{const a=t(s),c=()=>o.addIssue({code:L.custom,...i(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>!!l||(c(),!1)):!!a||(c(),!1)})}refinement(t,r){return this._refinement((i,s)=>!!t(i)||(s.addIssue("function"==typeof r?r(i,s):r),!1))}_refinement(t){return new ao({schema:this,typeName:ae.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return ms.create(this,this._def)}nullable(){return Ya.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return pu.create(this,this._def)}promise(){return dp.create(this,this._def)}or(t){return r_.create([this,t],this._def)}and(t){return s_.create(this,t,this._def)}transform(t){return new ao({...pe(this._def),schema:this,typeName:ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r="function"==typeof t?t:()=>t;return new c_({...pe(this._def),innerType:this,defaultValue:r,typeName:ae.ZodDefault})}brand(){return new u_({typeName:ae.ZodBranded,type:this,...pe(this._def)})}catch(t){const r="function"==typeof t?t:()=>t;return new l_({...pe(this._def),innerType:this,catchValue:r,typeName:ae.ZodCatch})}describe(t){return new(0,this.constructor)({...this._def,description:t})}pipe(t){return yu.create(this,t)}readonly(){return d_.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const tZ=/^c[^\s-]{8,}$/i,nZ=/^[0-9a-z]+$/,rZ=/^[0-9A-HJKMNP-TV-Z]{26}$/,iZ=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,sZ=/^[a-z0-9_-]{21}$/i,oZ=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,aZ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Qw;const lZ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,uZ=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,dZ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,OR="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",fZ=new RegExp(`^${OR}$`);function kR(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function hZ(e){return new RegExp(`^${kR(e)}$`)}function PR(e){let t=`${OR}T${kR(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function pZ(e,t){return!(("v4"!==t&&t||!lZ.test(e))&&("v6"!==t&&t||!uZ.test(e)))}let cp=(()=>{class e extends ve{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==W.string){const a=this._getOrReturnCtx(r);return q(a,{code:L.invalid_type,expected:W.string,received:a.parsedType}),oe}const s=new Qt;let o;for(const a of this._def.checks)if("min"===a.kind)r.data.lengtha.value&&(o=this._getOrReturnCtx(r,o),q(o,{code:L.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if("length"===a.kind){const c=r.data.length>a.value,l=r.data.lengthr.test(o),{validation:i,code:L.invalid_string,...te.errToObj(s)})}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...te.errToObj(r)})}url(r){return this._addCheck({kind:"url",...te.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...te.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...te.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...te.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...te.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...te.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...te.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...te.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...te.errToObj(r)})}datetime(r){var i,s;return this._addCheck("string"==typeof r?{kind:"datetime",precision:null,offset:!1,local:!1,message:r}:{kind:"datetime",precision:typeof r?.precision>"u"?null:r?.precision,offset:null!==(i=r?.offset)&&void 0!==i&&i,local:null!==(s=r?.local)&&void 0!==s&&s,...te.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return this._addCheck("string"==typeof r?{kind:"time",precision:null,message:r}:{kind:"time",precision:typeof r?.precision>"u"?null:r?.precision,...te.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...te.errToObj(r)})}regex(r,i){return this._addCheck({kind:"regex",regex:r,...te.errToObj(i)})}includes(r,i){return this._addCheck({kind:"includes",value:r,position:i?.position,...te.errToObj(i?.message)})}startsWith(r,i){return this._addCheck({kind:"startsWith",value:r,...te.errToObj(i)})}endsWith(r,i){return this._addCheck({kind:"endsWith",value:r,...te.errToObj(i)})}min(r,i){return this._addCheck({kind:"min",value:r,...te.errToObj(i)})}max(r,i){return this._addCheck({kind:"max",value:r,...te.errToObj(i)})}length(r,i){return this._addCheck({kind:"length",value:r,...te.errToObj(i)})}nonempty(r){return this.min(1,te.errToObj(r))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>"datetime"===r.kind)}get isDate(){return!!this._def.checks.find(r=>"date"===r.kind)}get isTime(){return!!this._def.checks.find(r=>"time"===r.kind)}get isDuration(){return!!this._def.checks.find(r=>"duration"===r.kind)}get isEmail(){return!!this._def.checks.find(r=>"email"===r.kind)}get isURL(){return!!this._def.checks.find(r=>"url"===r.kind)}get isEmoji(){return!!this._def.checks.find(r=>"emoji"===r.kind)}get isUUID(){return!!this._def.checks.find(r=>"uuid"===r.kind)}get isNANOID(){return!!this._def.checks.find(r=>"nanoid"===r.kind)}get isCUID(){return!!this._def.checks.find(r=>"cuid"===r.kind)}get isCUID2(){return!!this._def.checks.find(r=>"cuid2"===r.kind)}get isULID(){return!!this._def.checks.find(r=>"ulid"===r.kind)}get isIP(){return!!this._def.checks.find(r=>"ip"===r.kind)}get isBase64(){return!!this._def.checks.find(r=>"base64"===r.kind)}get minLength(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return r}get maxLength(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.value{var r;return new e({checks:[],typeName:ae.ZodString,coerce:null!==(r=t?.coerce)&&void 0!==r&&r,...pe(t)})},e})();function gZ(e,t){const r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,s=r>i?r:i;return parseInt(e.toFixed(s).replace(".",""))%parseInt(t.toFixed(s).replace(".",""))/Math.pow(10,s)}let Yw=(()=>{class e extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==W.number){const a=this._getOrReturnCtx(r);return q(a,{code:L.invalid_type,expected:W.number,received:a.parsedType}),oe}let s;const o=new Qt;for(const a of this._def.checks)"int"===a.kind?xe.isInteger(r.data)||(s=this._getOrReturnCtx(r,s),q(s,{code:L.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):"min"===a.kind?(a.inclusive?r.dataa.value:r.data>=a.value)&&(s=this._getOrReturnCtx(r,s),q(s,{code:L.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):"multipleOf"===a.kind?0!==gZ(r.data,a.value)&&(s=this._getOrReturnCtx(r,s),q(s,{code:L.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):"finite"===a.kind?Number.isFinite(r.data)||(s=this._getOrReturnCtx(r,s),q(s,{code:L.not_finite,message:a.message}),o.dirty()):xe.assertNever(a);return{status:o.value,value:r.data}}gte(r,i){return this.setLimit("min",r,!0,te.toString(i))}gt(r,i){return this.setLimit("min",r,!1,te.toString(i))}lte(r,i){return this.setLimit("max",r,!0,te.toString(i))}lt(r,i){return this.setLimit("max",r,!1,te.toString(i))}setLimit(r,i,s,o){return new e({...this._def,checks:[...this._def.checks,{kind:r,value:i,inclusive:s,message:te.toString(o)}]})}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:te.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:te.toString(r)})}multipleOf(r,i){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(i)})}finite(r){return this._addCheck({kind:"finite",message:te.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:te.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:te.toString(r)})}get minValue(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return r}get maxValue(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.value"int"===r.kind||"multipleOf"===r.kind&&xe.isInteger(r.value))}get isFinite(){let r=null,i=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===i||s.value>i)&&(i=s.value):"max"===s.kind&&(null===r||s.valuenew e({checks:[],typeName:ae.ZodNumber,coerce:t?.coerce||!1,...pe(t)}),e})(),Jw=(()=>{class e extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce&&(r.data=BigInt(r.data)),this._getType(r)!==W.bigint){const a=this._getOrReturnCtx(r);return q(a,{code:L.invalid_type,expected:W.bigint,received:a.parsedType}),oe}let s;const o=new Qt;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?r.dataa.value:r.data>=a.value)&&(s=this._getOrReturnCtx(r,s),q(s,{code:L.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):"multipleOf"===a.kind?r.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(r,s),q(s,{code:L.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):xe.assertNever(a);return{status:o.value,value:r.data}}gte(r,i){return this.setLimit("min",r,!0,te.toString(i))}gt(r,i){return this.setLimit("min",r,!1,te.toString(i))}lte(r,i){return this.setLimit("max",r,!0,te.toString(i))}lt(r,i){return this.setLimit("max",r,!1,te.toString(i))}setLimit(r,i,s,o){return new e({...this._def,checks:[...this._def.checks,{kind:r,value:i,inclusive:s,message:te.toString(o)}]})}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:te.toString(r)})}multipleOf(r,i){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(i)})}get minValue(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return r}get maxValue(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.value{var r;return new e({checks:[],typeName:ae.ZodBigInt,coerce:null!==(r=t?.coerce)&&void 0!==r&&r,...pe(t)})},e})(),Xw=(()=>{class e extends ve{_parse(r){if(this._def.coerce&&(r.data=!!r.data),this._getType(r)!==W.boolean){const s=this._getOrReturnCtx(r);return q(s,{code:L.invalid_type,expected:W.boolean,received:s.parsedType}),oe}return un(r.data)}}return e.create=t=>new e({typeName:ae.ZodBoolean,coerce:t?.coerce||!1,...pe(t)}),e})(),e_=(()=>{class e extends ve{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==W.date){const a=this._getOrReturnCtx(r);return q(a,{code:L.invalid_type,expected:W.date,received:a.parsedType}),oe}if(isNaN(r.data.getTime()))return q(this._getOrReturnCtx(r),{code:L.invalid_date}),oe;const s=new Qt;let o;for(const a of this._def.checks)"min"===a.kind?r.data.getTime()a.value&&(o=this._getOrReturnCtx(r,o),q(o,{code:L.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):xe.assertNever(a);return{status:s.value,value:new Date(r.data.getTime())}}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}min(r,i){return this._addCheck({kind:"min",value:r.getTime(),message:te.toString(i)})}max(r,i){return this._addCheck({kind:"max",value:r.getTime(),message:te.toString(i)})}get minDate(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return null!=r?new Date(r):null}get maxDate(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.valuenew e({checks:[],coerce:t?.coerce||!1,typeName:ae.ZodDate,...pe(t)}),e})(),LR=(()=>{class e extends ve{_parse(r){if(this._getType(r)!==W.symbol){const s=this._getOrReturnCtx(r);return q(s,{code:L.invalid_type,expected:W.symbol,received:s.parsedType}),oe}return un(r.data)}}return e.create=t=>new e({typeName:ae.ZodSymbol,...pe(t)}),e})(),t_=(()=>{class e extends ve{_parse(r){if(this._getType(r)!==W.undefined){const s=this._getOrReturnCtx(r);return q(s,{code:L.invalid_type,expected:W.undefined,received:s.parsedType}),oe}return un(r.data)}}return e.create=t=>new e({typeName:ae.ZodUndefined,...pe(t)}),e})(),n_=(()=>{class e extends ve{_parse(r){if(this._getType(r)!==W.null){const s=this._getOrReturnCtx(r);return q(s,{code:L.invalid_type,expected:W.null,received:s.parsedType}),oe}return un(r.data)}}return e.create=t=>new e({typeName:ae.ZodNull,...pe(t)}),e})(),lp=(()=>{class e extends ve{constructor(){super(...arguments),this._any=!0}_parse(r){return un(r.data)}}return e.create=t=>new e({typeName:ae.ZodAny,...pe(t)}),e})(),hu=(()=>{class e extends ve{constructor(){super(...arguments),this._unknown=!0}_parse(r){return un(r.data)}}return e.create=t=>new e({typeName:ae.ZodUnknown,...pe(t)}),e})(),oo=(()=>{class e extends ve{_parse(r){const i=this._getOrReturnCtx(r);return q(i,{code:L.invalid_type,expected:W.never,received:i.parsedType}),oe}}return e.create=t=>new e({typeName:ae.ZodNever,...pe(t)}),e})(),FR=(()=>{class e extends ve{_parse(r){if(this._getType(r)!==W.undefined){const s=this._getOrReturnCtx(r);return q(s,{code:L.invalid_type,expected:W.void,received:s.parsedType}),oe}return un(r.data)}}return e.create=t=>new e({typeName:ae.ZodVoid,...pe(t)}),e})(),pu=(()=>{class e extends ve{_parse(r){const{ctx:i,status:s}=this._processInputParams(r),o=this._def;if(i.parsedType!==W.array)return q(i,{code:L.invalid_type,expected:W.array,received:i.parsedType}),oe;if(null!==o.exactLength){const c=i.data.length>o.exactLength.value,l=i.data.lengtho.maxLength.value&&(q(i,{code:L.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),s.dirty()),i.common.async)return Promise.all([...i.data].map((c,l)=>o.type._parseAsync(new Zr(i,c,i.path,l)))).then(c=>Qt.mergeArray(s,c));const a=[...i.data].map((c,l)=>o.type._parseSync(new Zr(i,c,i.path,l)));return Qt.mergeArray(s,a)}get element(){return this._def.type}min(r,i){return new e({...this._def,minLength:{value:r,message:te.toString(i)}})}max(r,i){return new e({...this._def,maxLength:{value:r,message:te.toString(i)}})}length(r,i){return new e({...this._def,exactLength:{value:r,message:te.toString(i)}})}nonempty(r){return this.min(1,r)}}return e.create=(t,r)=>new e({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ae.ZodArray,...pe(r)}),e})();function Wa(e){if(e instanceof Za){const t={};for(const r in e.shape)t[r]=ms.create(Wa(e.shape[r]));return new Za({...e._def,shape:()=>t})}return e instanceof pu?new pu({...e._def,type:Wa(e.element)}):e instanceof ms?ms.create(Wa(e.unwrap())):e instanceof Ya?Ya.create(Wa(e.unwrap())):e instanceof Ka?Ka.create(e.items.map(t=>Wa(t))):e}let Za=(()=>{class e extends ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const r=this._def.shape(),i=xe.objectKeys(r);return this._cached={shape:r,keys:i}}_parse(r){if(this._getType(r)!==W.object){const d=this._getOrReturnCtx(r);return q(d,{code:L.invalid_type,expected:W.object,received:d.parsedType}),oe}const{status:s,ctx:o}=this._processInputParams(r),{shape:a,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof oo&&"strip"===this._def.unknownKeys))for(const d in o.data)c.includes(d)||l.push(d);const u=[];for(const d of c)u.push({key:{status:"valid",value:d},value:a[d]._parse(new Zr(o,o.data[d],o.path,d)),alwaysSet:d in o.data});if(this._def.catchall instanceof oo){const d=this._def.unknownKeys;if("passthrough"===d)for(const f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if("strict"===d)l.length>0&&(q(o,{code:L.unrecognized_keys,keys:l}),s.dirty());else if("strip"!==d)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const f of l)u.push({key:{status:"valid",value:f},value:d._parse(new Zr(o,o.data[f],o.path,f)),alwaysSet:f in o.data})}return o.common.async?Promise.resolve().then($(function*(){const d=[];for(const f of u){const h=yield f.key,p=yield f.value;d.push({key:h,value:p,alwaysSet:f.alwaysSet})}return d})).then(d=>Qt.mergeObjectSync(s,d)):Qt.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(r){return new e({...this._def,unknownKeys:"strict",...void 0!==r?{errorMap:(i,s)=>{var o,a,c,l;const u=null!==(c=null===(a=(o=this._def).errorMap)||void 0===a?void 0:a.call(o,i,s).message)&&void 0!==c?c:s.defaultError;return"unrecognized_keys"===i.code?{message:null!==(l=te.errToObj(r).message)&&void 0!==l?l:u}:{message:u}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(r){return new e({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new e({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:ae.ZodObject})}setKey(r,i){return this.augment({[r]:i})}catchall(r){return new e({...this._def,catchall:r})}pick(r){const i={};return xe.objectKeys(r).forEach(s=>{r[s]&&this.shape[s]&&(i[s]=this.shape[s])}),new e({...this._def,shape:()=>i})}omit(r){const i={};return xe.objectKeys(this.shape).forEach(s=>{r[s]||(i[s]=this.shape[s])}),new e({...this._def,shape:()=>i})}deepPartial(){return Wa(this)}partial(r){const i={};return xe.objectKeys(this.shape).forEach(s=>{const o=this.shape[s];i[s]=r&&!r[s]?o:o.optional()}),new e({...this._def,shape:()=>i})}required(r){const i={};return xe.objectKeys(this.shape).forEach(s=>{if(r&&!r[s])i[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof ms;)a=a._def.innerType;i[s]=a}}),new e({...this._def,shape:()=>i})}keyof(){return jR(xe.objectKeys(this.shape))}}return e.create=(t,r)=>new e({shape:()=>t,unknownKeys:"strip",catchall:oo.create(),typeName:ae.ZodObject,...pe(r)}),e.strictCreate=(t,r)=>new e({shape:()=>t,unknownKeys:"strict",catchall:oo.create(),typeName:ae.ZodObject,...pe(r)}),e.lazycreate=(t,r)=>new e({shape:t,unknownKeys:"strip",catchall:oo.create(),typeName:ae.ZodObject,...pe(r)}),e})(),r_=(()=>{class e extends ve{_parse(r){const{ctx:i}=this._processInputParams(r),s=this._def.options;if(i.common.async)return Promise.all(s.map(function(){var a=$(function*(c){const l={...i,common:{...i.common,issues:[]},parent:null};return{result:yield c._parseAsync({data:i.data,path:i.path,parent:l}),ctx:l}});return function(c){return a.apply(this,arguments)}}())).then(function o(a){for(const l of a)if("valid"===l.result.status)return l.result;for(const l of a)if("dirty"===l.result.status)return i.common.issues.push(...l.ctx.common.issues),l.result;const c=a.map(l=>new Mi(l.ctx.common.issues));return q(i,{code:L.invalid_union,unionErrors:c}),oe});{let a;const c=[];for(const u of s){const d={...i,common:{...i.common,issues:[]},parent:null},f=u._parseSync({data:i.data,path:i.path,parent:d});if("valid"===f.status)return f;"dirty"===f.status&&!a&&(a={result:f,ctx:d}),d.common.issues.length&&c.push(d.common.issues)}if(a)return i.common.issues.push(...a.ctx.common.issues),a.result;const l=c.map(u=>new Mi(u));return q(i,{code:L.invalid_union,unionErrors:l}),oe}}get options(){return this._def.options}}return e.create=(t,r)=>new e({options:t,typeName:ae.ZodUnion,...pe(r)}),e})();const Ni=e=>e instanceof o_?Ni(e.schema):e instanceof ao?Ni(e.innerType()):e instanceof a_?[e.value]:e instanceof gs?e.options:e instanceof mu?xe.objectValues(e.enum):e instanceof c_?Ni(e._def.innerType):e instanceof t_?[void 0]:e instanceof n_?[null]:e instanceof ms?[void 0,...Ni(e.unwrap())]:e instanceof Ya?[null,...Ni(e.unwrap())]:e instanceof u_||e instanceof d_?Ni(e.unwrap()):e instanceof l_?Ni(e._def.innerType):[];class up extends ve{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==W.object)return q(r,{code:L.invalid_type,expected:W.object,received:r.parsedType}),oe;const i=this.discriminator,o=this.optionsMap.get(r.data[i]);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(q(r,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,i){const s=new Map;for(const o of r){const a=Ni(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const c of a){if(s.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);s.set(c,o)}}return new up({typeName:ae.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...pe(i)})}}function i_(e,t){const r=ps(e),i=ps(t);if(e===t)return{valid:!0,data:e};if(r===W.object&&i===W.object){const s=xe.objectKeys(t),o=xe.objectKeys(e).filter(c=>-1!==s.indexOf(c)),a={...e,...t};for(const c of o){const l=i_(e[c],t[c]);if(!l.valid)return{valid:!1};a[c]=l.data}return{valid:!0,data:a}}if(r===W.array&&i===W.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{class e extends ve{_parse(r){const{status:i,ctx:s}=this._processInputParams(r),o=(a,c)=>{if(Zw(a)||Zw(c))return oe;const l=i_(a.value,c.value);return l.valid?((Kw(a)||Kw(c))&&i.dirty(),{status:i.value,value:l.data}):(q(s,{code:L.invalid_intersection_types}),oe)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,c])=>o(a,c)):o(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}return e.create=(t,r,i)=>new e({left:t,right:r,typeName:ae.ZodIntersection,...pe(i)}),e})(),Ka=(()=>{class e extends ve{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==W.array)return q(s,{code:L.invalid_type,expected:W.array,received:s.parsedType}),oe;if(s.data.lengththis._def.items.length&&(q(s,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const a=[...s.data].map((c,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new Zr(s,c,s.path,l)):null}).filter(c=>!!c);return s.common.async?Promise.all(a).then(c=>Qt.mergeArray(i,c)):Qt.mergeArray(i,a)}get items(){return this._def.items}rest(r){return new e({...this._def,rest:r})}}return e.create=(t,r)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new e({items:t,typeName:ae.ZodTuple,rest:null,...pe(r)})},e})();class gu extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==W.object)return q(i,{code:L.invalid_type,expected:W.object,received:i.parsedType}),oe;const s=[],o=this._def.keyType,a=this._def.valueType;for(const c in i.data)s.push({key:o._parse(new Zr(i,c,i.path,c)),value:a._parse(new Zr(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?Qt.mergeObjectAsync(r,s):Qt.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,i){return new gu(r instanceof ve?{keyType:t,valueType:r,typeName:ae.ZodRecord,...pe(i)}:{keyType:cp.create(),valueType:t,typeName:ae.ZodRecord,...pe(r)})}}let BR=(()=>{class e extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==W.map)return q(s,{code:L.invalid_type,expected:W.map,received:s.parsedType}),oe;const o=this._def.keyType,a=this._def.valueType,c=[...s.data.entries()].map(([l,u],d)=>({key:o._parse(new Zr(s,l,s.path,[d,"key"])),value:a._parse(new Zr(s,u,s.path,[d,"value"]))}));if(s.common.async){const l=new Map;return Promise.resolve().then($(function*(){for(const u of c){const d=yield u.key,f=yield u.value;if("aborted"===d.status||"aborted"===f.status)return oe;("dirty"===d.status||"dirty"===f.status)&&i.dirty(),l.set(d.value,f.value)}return{status:i.value,value:l}}))}{const l=new Map;for(const u of c){const d=u.key,f=u.value;if("aborted"===d.status||"aborted"===f.status)return oe;("dirty"===d.status||"dirty"===f.status)&&i.dirty(),l.set(d.value,f.value)}return{status:i.value,value:l}}}}return e.create=(t,r,i)=>new e({valueType:r,keyType:t,typeName:ae.ZodMap,...pe(i)}),e})(),UR=(()=>{class e extends ve{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==W.set)return q(s,{code:L.invalid_type,expected:W.set,received:s.parsedType}),oe;const o=this._def;null!==o.minSize&&s.data.sizeo.maxSize.value&&(q(s,{code:L.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),i.dirty());const a=this._def.valueType;function c(u){const d=new Set;for(const f of u){if("aborted"===f.status)return oe;"dirty"===f.status&&i.dirty(),d.add(f.value)}return{status:i.value,value:d}}const l=[...s.data.values()].map((u,d)=>a._parse(new Zr(s,u,s.path,d)));return s.common.async?Promise.all(l).then(u=>c(u)):c(l)}min(r,i){return new e({...this._def,minSize:{value:r,message:te.toString(i)}})}max(r,i){return new e({...this._def,maxSize:{value:r,message:te.toString(i)}})}size(r,i){return this.min(r,i).max(r,i)}nonempty(r){return this.min(1,r)}}return e.create=(t,r)=>new e({valueType:t,minSize:null,maxSize:null,typeName:ae.ZodSet,...pe(r)}),e})();class Qa extends ve{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==W.function)return q(r,{code:L.invalid_type,expected:W.function,received:r.parsedType}),oe;function i(c,l){return op({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,sp(),qa].filter(u=>!!u),issueData:{code:L.invalid_arguments,argumentsError:l}})}function s(c,l){return op({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,sp(),qa].filter(u=>!!u),issueData:{code:L.invalid_return_type,returnTypeError:l}})}const o={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof dp){const c=this;return un($(function*(...l){const u=new Mi([]),d=yield c._def.args.parseAsync(l,o).catch(p=>{throw u.addIssue(i(l,p)),u}),f=yield Reflect.apply(a,this,d);return yield c._def.returns._def.type.parseAsync(f,o).catch(p=>{throw u.addIssue(s(f,p)),u})}))}{const c=this;return un(function(...l){const u=c._def.args.safeParse(l,o);if(!u.success)throw new Mi([i(l,u.error)]);const d=Reflect.apply(a,this,u.data),f=c._def.returns.safeParse(d,o);if(!f.success)throw new Mi([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Qa({...this._def,args:Ka.create(t).rest(hu.create())})}returns(t){return new Qa({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,i){return new Qa({args:t||Ka.create([]).rest(hu.create()),returns:r||hu.create(),typeName:ae.ZodFunction,...pe(i)})}}let o_=(()=>{class e extends ve{get schema(){return this._def.getter()}_parse(r){const{ctx:i}=this._processInputParams(r);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}return e.create=(t,r)=>new e({getter:t,typeName:ae.ZodLazy,...pe(r)}),e})(),a_=(()=>{class e extends ve{_parse(r){if(r.data!==this._def.value){const i=this._getOrReturnCtx(r);return q(i,{received:i.data,code:L.invalid_literal,expected:this._def.value}),oe}return{status:"valid",value:r.data}}get value(){return this._def.value}}return e.create=(t,r)=>new e({value:t,typeName:ae.ZodLiteral,...pe(r)}),e})();function jR(e,t){return new gs({values:e,typeName:ae.ZodEnum,...pe(t)})}class gs extends ve{constructor(){super(...arguments),du.set(this,void 0)}_parse(t){if("string"!=typeof t.data){const r=this._getOrReturnCtx(t);return q(r,{expected:xe.joinValues(this._def.values),received:r.parsedType,code:L.invalid_type}),oe}if(ap(this,du,"f")||NR(this,du,new Set(this._def.values),"f"),!ap(this,du,"f").has(t.data)){const r=this._getOrReturnCtx(t);return q(r,{received:r.data,code:L.invalid_enum_value,options:this._def.values}),oe}return un(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return gs.create(t,{...this._def,...r})}exclude(t,r=this._def){return gs.create(this.options.filter(i=>!t.includes(i)),{...this._def,...r})}}du=new WeakMap,gs.create=jR;class mu extends ve{constructor(){super(...arguments),fu.set(this,void 0)}_parse(t){const r=xe.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==W.string&&i.parsedType!==W.number){const s=xe.objectValues(r);return q(i,{expected:xe.joinValues(s),received:i.parsedType,code:L.invalid_type}),oe}if(ap(this,fu,"f")||NR(this,fu,new Set(xe.getValidEnumValues(this._def.values)),"f"),!ap(this,fu,"f").has(t.data)){const s=xe.objectValues(r);return q(i,{received:i.data,code:L.invalid_enum_value,options:s}),oe}return un(t.data)}get enum(){return this._def.values}}fu=new WeakMap,mu.create=(e,t)=>new mu({values:e,typeName:ae.ZodNativeEnum,...pe(t)});let dp=(()=>{class e extends ve{unwrap(){return this._def.type}_parse(r){const{ctx:i}=this._processInputParams(r);if(i.parsedType!==W.promise&&!1===i.common.async)return q(i,{code:L.invalid_type,expected:W.promise,received:i.parsedType}),oe;const s=i.parsedType===W.promise?i.data:Promise.resolve(i.data);return un(s.then(o=>this._def.type.parseAsync(o,{path:i.path,errorMap:i.common.contextualErrorMap})))}}return e.create=(t,r)=>new e({type:t,typeName:ae.ZodPromise,...pe(r)}),e})(),ao=(()=>{class e extends ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){var i=this;const{status:s,ctx:o}=this._processInputParams(r),a=this._def.effect||null,c={addIssue:l=>{q(o,l),l.fatal?s.abort():s.dirty()},get path(){return o.path}};if(c.addIssue=c.addIssue.bind(c),"preprocess"===a.type){const l=a.transform(o.data,c);if(o.common.async)return Promise.resolve(l).then(function(){var u=$(function*(d){if("aborted"===s.value)return oe;const f=yield i._def.schema._parseAsync({data:d,path:o.path,parent:o});return"aborted"===f.status?oe:"dirty"===f.status||"dirty"===s.value?Ga(f.value):f});return function(d){return u.apply(this,arguments)}}());{if("aborted"===s.value)return oe;const u=this._def.schema._parseSync({data:l,path:o.path,parent:o});return"aborted"===u.status?oe:"dirty"===u.status||"dirty"===s.value?Ga(u.value):u}}if("refinement"===a.type){const l=u=>{const d=a.refinement(u,c);if(o.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(!1===o.common.async){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return"aborted"===u.status?oe:("dirty"===u.status&&s.dirty(),l(u.value),{status:s.value,value:u.value})}return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>"aborted"===u.status?oe:("dirty"===u.status&&s.dirty(),l(u.value).then(()=>({status:s.value,value:u.value}))))}if("transform"===a.type){if(!1===o.common.async){const l=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!lu(l))return l;const u=a.transform(l.value,c);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:u}}return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(l=>lu(l)?Promise.resolve(a.transform(l.value,c)).then(u=>({status:s.value,value:u})):l)}xe.assertNever(a)}}return e.create=(t,r,i)=>new e({schema:t,typeName:ae.ZodEffects,effect:r,...pe(i)}),e.createWithPreprocess=(t,r,i)=>new e({schema:r,effect:{type:"preprocess",transform:t},typeName:ae.ZodEffects,...pe(i)}),e})(),ms=(()=>{class e extends ve{_parse(r){return this._getType(r)===W.undefined?un(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ae.ZodOptional,...pe(r)}),e})(),Ya=(()=>{class e extends ve{_parse(r){return this._getType(r)===W.null?un(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ae.ZodNullable,...pe(r)}),e})(),c_=(()=>{class e extends ve{_parse(r){const{ctx:i}=this._processInputParams(r);let s=i.data;return i.parsedType===W.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ae.ZodDefault,defaultValue:"function"==typeof r.default?r.default:()=>r.default,...pe(r)}),e})(),l_=(()=>{class e extends ve{_parse(r){const{ctx:i}=this._processInputParams(r),s={...i,common:{...i.common,issues:[]}},o=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return uu(o)?o.then(a=>({status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new Mi(s.common.issues)},input:s.data})})):{status:"valid",value:"valid"===o.status?o.value:this._def.catchValue({get error(){return new Mi(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ae.ZodCatch,catchValue:"function"==typeof r.catch?r.catch:()=>r.catch,...pe(r)}),e})(),$R=(()=>{class e extends ve{_parse(r){if(this._getType(r)!==W.nan){const s=this._getOrReturnCtx(r);return q(s,{code:L.invalid_type,expected:W.nan,received:s.parsedType}),oe}return{status:"valid",value:r.data}}}return e.create=t=>new e({typeName:ae.ZodNaN,...pe(t)}),e})();const mZ=Symbol("zod_brand");class u_ extends ve{_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.type._parse({data:r.data,path:r.path,parent:r})}unwrap(){return this._def.type}}class yu extends ve{_parse(t){var r=this;const{status:i,ctx:s}=this._processInputParams(t);if(s.common.async)return function(){var a=$(function*(){const c=yield r._def.in._parseAsync({data:s.data,path:s.path,parent:s});return"aborted"===c.status?oe:"dirty"===c.status?(i.dirty(),Ga(c.value)):r._def.out._parseAsync({data:c.value,path:s.path,parent:s})});return function(){return a.apply(this,arguments)}}()();{const o=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===o.status?oe:"dirty"===o.status?(i.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:s.path,parent:s})}}static create(t,r){return new yu({in:t,out:r,typeName:ae.ZodPipeline})}}let d_=(()=>{class e extends ve{_parse(r){const i=this._def.innerType._parse(r),s=o=>(lu(o)&&(o.value=Object.freeze(o.value)),o);return uu(i)?i.then(o=>s(o)):s(i)}unwrap(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ae.ZodReadonly,...pe(r)}),e})();function VR(e,t={},r){return e?lp.create().superRefine((i,s)=>{var o,a;if(!e(i)){const c="function"==typeof t?t(i):"string"==typeof t?{message:t}:t,l=null===(a=null!==(o=c.fatal)&&void 0!==o?o:r)||void 0===a||a;s.addIssue({code:"custom",..."string"==typeof c?{message:c}:c,fatal:l})}}):lp.create()}const yZ={object:Za.lazycreate};var ae=function(e){return e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly",e}(ae||{});const HR=cp.create,zR=Yw.create,qR=Xw.create,GR=ao.create;var V=Object.freeze({__proto__:null,defaultErrorMap:qa,setErrorMap:function XW(e){MR=e},getErrorMap:sp,makeIssue:op,EMPTY_PATH:[],addIssueToContext:q,ParseStatus:Qt,INVALID:oe,DIRTY:Ga,OK:un,isAborted:Zw,isDirty:Kw,isValid:lu,isAsync:uu,get util(){return xe},get objectUtil(){return AR},ZodParsedType:W,getParsedType:ps,ZodType:ve,datetimeRegex:PR,ZodString:cp,ZodNumber:Yw,ZodBigInt:Jw,ZodBoolean:Xw,ZodDate:e_,ZodSymbol:LR,ZodUndefined:t_,ZodNull:n_,ZodAny:lp,ZodUnknown:hu,ZodNever:oo,ZodVoid:FR,ZodArray:pu,ZodObject:Za,ZodUnion:r_,ZodDiscriminatedUnion:up,ZodIntersection:s_,ZodTuple:Ka,ZodRecord:gu,ZodMap:BR,ZodSet:UR,ZodFunction:Qa,ZodLazy:o_,ZodLiteral:a_,ZodEnum:gs,ZodNativeEnum:mu,ZodPromise:dp,ZodEffects:ao,ZodTransformer:ao,ZodOptional:ms,ZodNullable:Ya,ZodDefault:c_,ZodCatch:l_,ZodNaN:$R,BRAND:mZ,ZodBranded:u_,ZodPipeline:yu,ZodReadonly:d_,custom:VR,Schema:ve,ZodSchema:ve,late:yZ,get ZodFirstPartyTypeKind(){return ae},coerce:{string:e=>cp.create({...e,coerce:!0}),number:e=>Yw.create({...e,coerce:!0}),boolean:e=>Xw.create({...e,coerce:!0}),bigint:e=>Jw.create({...e,coerce:!0}),date:e=>e_.create({...e,coerce:!0})},any:lp.create,array:pu.create,bigint:Jw.create,boolean:qR,date:e_.create,discriminatedUnion:up.create,effect:GR,enum:gs.create,function:Qa.create,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>VR(r=>r instanceof e,t),intersection:s_.create,lazy:o_.create,literal:a_.create,map:BR.create,nan:$R.create,nativeEnum:mu.create,never:oo.create,null:n_.create,nullable:Ya.create,number:zR,object:Za.create,oboolean:()=>qR().optional(),onumber:()=>zR().optional(),optional:ms.create,ostring:()=>HR().optional(),pipeline:yu.create,preprocess:ao.createWithPreprocess,promise:dp.create,record:gu.create,set:UR.create,strictObject:Za.strictCreate,string:HR,symbol:LR.create,transformer:GR,tuple:Ka.create,undefined:t_.create,union:r_.create,unknown:hu.create,void:FR.create,NEVER:oe,ZodIssueCode:L,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Mi});class et{static id(){return V.string().regex(/^[0-9a-f]{64}$/)}static event(){return V.object({id:et.id(),kind:V.number().int().nonnegative(),pubkey:et.id(),tags:V.string().array().array(),content:V.string(),created_at:V.number().int().nonnegative(),sig:V.string()})}static filter(){return V.object({kinds:V.number().int().nonnegative().array().optional(),ids:et.id().array().optional(),authors:et.id().array().optional(),since:V.number().int().nonnegative().optional(),until:V.number().int().nonnegative().optional(),limit:V.number().int().nonnegative().optional(),search:V.string().optional()}).passthrough().transform(t=>{const r=["kinds","ids","authors","since","until","limit","search"];return Object.entries(t).reduce((i,[s,o])=>((r.includes(s)||s.startsWith("#"))&&(i[s]=o),i),{})})}static bech32(t){return V.string().regex(/^[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}$/).refine(r=>!t||r.startsWith(`${t}1`))}static clientEVENT(){return V.tuple([V.literal("EVENT"),et.event()])}static clientREQ(){return V.tuple([V.literal("REQ"),V.string()]).rest(et.filter())}static clientCOUNT(){return V.tuple([V.literal("COUNT"),V.string()]).rest(et.filter())}static clientCLOSE(){return V.tuple([V.literal("CLOSE"),V.string()])}static clientAUTH(){return V.tuple([V.literal("AUTH"),et.event()])}static clientMsg(){return V.union([et.clientEVENT(),et.clientREQ(),et.clientCOUNT(),et.clientCLOSE(),et.clientAUTH()])}static relayEVENT(){return V.tuple([V.literal("EVENT"),V.string(),et.event()])}static relayOK(){return V.tuple([V.literal("OK"),et.id(),V.boolean(),V.string()])}static relayEOSE(){return V.tuple([V.literal("EOSE"),V.string()])}static relayNOTICE(){return V.tuple([V.literal("NOTICE"),V.string()])}static relayCLOSED(){return V.tuple([V.literal("CLOSED"),V.string(),V.string()])}static relayAUTH(){return V.tuple([V.literal("AUTH"),V.string()])}static relayCOUNT(){return V.tuple([V.literal("COUNT"),V.string(),V.object({count:V.number().int().nonnegative(),approximate:V.boolean().optional()})])}static relayMsg(){return V.union([et.relayEVENT(),et.relayOK(),et.relayEOSE(),et.relayNOTICE(),et.relayCLOSED(),et.relayAUTH(),et.relayCOUNT()])}static metadata(){return V.object({about:V.string().optional().catch(void 0),banner:V.string().url().optional().catch(void 0),bot:V.boolean().optional().catch(void 0),display_name:V.string().optional().catch(void 0),lud06:et.bech32("lnurl").optional().catch(void 0),lud16:V.string().email().optional().catch(void 0),name:V.string().optional().catch(void 0),nip05:V.string().email().optional().catch(void 0),picture:V.string().url().optional().catch(void 0),website:V.string().url().optional().catch(void 0)}).passthrough()}static connectRequest(){return V.object({id:V.string(),method:V.string(),params:V.string().array()})}static connectResponse(){return V.object({id:V.string(),result:V.string(),error:V.string().optional()})}static json(){return V.string().transform((t,r)=>{try{return JSON.parse(t)}catch{return r.addIssue({code:V.ZodIssueCode.custom,message:"Invalid JSON"}),V.NEVER}})}}class KZ{socket;subscriptions=new Map;ee=new EventTarget;constructor(t,r={}){const{auth:i,backoff:s=new ZW(1e3),verifyEvent:o=ka}=r;this.socket=new QW(t).withBuffer(new YW).withBackoff(!1===s?void 0:s).onOpen(()=>{for(const a of this.subscriptions.values())this.send(a)}).onMessage((a,c)=>{const l=et.json().pipe(et.relayMsg()).safeParse(c.data);if(!l.success)return;const u=l.data;switch(u[0]){case"EVENT":case"EOSE":case"CLOSED":if("EVENT"===u[0]&&!o(u[2]))break;"CLOSED"===u[0]&&this.subscriptions.delete(u[1]),this.ee.dispatchEvent(new CustomEvent(`sub:${u[1]}`,{detail:u}));break;case"OK":this.ee.dispatchEvent(new CustomEvent(`ok:${u[1]}`,{detail:u}));break;case"NOTICE":this.ee.dispatchEvent(new CustomEvent("notice",{detail:u}));break;case"COUNT":this.ee.dispatchEvent(new CustomEvent(`count:${u[1]}`,{detail:u}));break;case"AUTH":i?.(u[1]).then(d=>this.send(["AUTH",d])).catch(()=>{})}}).build()}send(t){switch(t[0]){case"REQ":this.subscriptions.set(t[1],t);break;case"CLOSE":this.subscriptions.delete(t[1]);break;case"EVENT":case"COUNT":return this.socket.send(JSON.stringify(t))}this.socket.readyState===WebSocket.OPEN&&this.socket.send(JSON.stringify(t))}req(t,r={}){var i=this;return ip(function*(){const{signal:s}=r,o=crypto.randomUUID(),a=i.on(`sub:${o}`,s),c=["REQ",o,...t];i.send(c);try{var d,l=!1,u=!1;try{for(var h,f=ss(a);l=!(h=yield hs(f.next())).done;l=!1){const p=h.value;if("EOSE"===p[0]&&(yield p),"CLOSED"===p[0])break;if("EVENT"===p[0]){if(!Nh(t,p[2]))continue;yield p}}}catch(p){u=!0,d=p}finally{try{l&&null!=f.return&&(yield hs(f.return()))}finally{if(u)throw d}}}finally{i.send(["CLOSE",o])}})()}query(t,r){var i=this;return $(function*(){const s=new Kn,o=t.reduce((f,h)=>f+KM(h),0);if(0===o)return[];var l,a=!1,c=!1;try{for(var d,u=ss(i.req(t,r));a=!(d=yield u.next()).done;a=!1){const f=d.value;if("EOSE"===f[0])break;if("EVENT"===f[0]&&s.add(f[2]),"CLOSED"===f[0])throw new Error("Subscription closed");if(s.size>=o)break}}catch(f){c=!0,l=f}finally{try{a&&null!=u.return&&(yield u.return())}finally{if(c)throw l}}return[...s]})()}event(t,r){var i=this;return $(function*(){const s=i.once(`ok:${t.id}`,r?.signal);i.send(["EVENT",t]);const[,,o,a]=yield s;if(!o)throw new Error(a)})()}count(t,r){var i=this;return $(function*(){const s=crypto.randomUUID(),o=i.once(`count:${s}`,r?.signal);i.send(["COUNT",s,...t]);const[,,a]=yield o;return a})()}on(t,r){var i=this;return ip(function*(){if(r?.aborted)throw i.abortError();const s=new TR(r),o=f=>s.push(f.detail);i.ee.addEventListener(t,o);try{var l,a=!1,c=!1;try{for(var d,u=ss(s);a=!(d=yield hs(u.next())).done;a=!1)yield d.value}catch(f){c=!0,l=f}finally{try{a&&null!=u.return&&(yield hs(u.return()))}finally{if(c)throw l}}}finally{i.ee.removeEventListener(t,o)}})()}once(t,r){var i=this;return $(function*(){var a,s=!1,o=!1;try{for(var l,c=ss(i.on(t,r));s=!(l=yield c.next()).done;s=!1)return l.value}catch(u){o=!0,a=u}finally{try{s&&null!=c.return&&(yield c.return())}finally{if(o)throw a}}throw new Error("Unreachable")})()}abortError(){return new DOMException("The signal has been aborted","AbortError")}close(){var t=this;return $(function*(){t.socket.readyState!==WebSocket.CLOSED&&(yield new Promise(r=>{t.socket.addEventListener(Ge.close,r,{once:!0}),t.socket.close()}))})()}}function vu(e){return Nt((t,r)=>{try{t.subscribe(r)}finally{r.add(e)}})}class fp extends WW{constructor(){var t;super({open:t=>new KZ(t),reqRouter:(t=$(function*(r){const i=[];return"wss://nos.lol".split(",").forEach(s=>{i.push([s,r])}),new Map(i)}),function(i){return t.apply(this,arguments)}),eventRouter:function(){var t=$(function*(){return"wss://nos.lol".split(",")});return function(){return t.apply(this,arguments)}}()})}observe(t){var r=this;console.info((new Date).toLocaleString(),"[[subscribe filter]]",t);const i=new AbortController,s=new ot;return $(function*(){var c,o=!1,a=!1;try{for(var u,l=ss(r.req(t,i));o=!(u=yield l.next()).done;o=!1){const d=u.value;if("CLOSED"===d[0]){s.error(d);break}"EVENT"===d[0]&&s.next(d[2])}}catch(d){a=!0,c=d}finally{try{o&&null!=l.return&&(yield l.return())}finally{if(a)throw c}}})(),s.asObservable().pipe(vu(()=>{console.info((new Date).toLocaleString(),"[[unsubscribe filter]]",t),i.abort()}))}}let WR=(()=>{class e{constructor(){this.pubkeySet=new Set,this.loadList()}loadList(){try{const r=sessionStorage.getItem("alwaysIgnoreWannachat");if(r){let i=JSON.parse(r);i instanceof Array?this.pubkeySet=new Set(i):sessionStorage.setItem("alwaysIgnoreWannachat","[]")}}catch{sessionStorage.setItem("alwaysIgnoreWannachat","[]")}}saveInList(r){this.pubkeySet.add(r),sessionStorage.setItem("alwaysIgnoreWannachat",JSON.stringify([...this.pubkeySet]))}isInList(r){return this.pubkeySet.has(r)}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),ZR=(()=>{class e{constructor(r,i){this.npool=r,this.ignoreListService=i}listenUserStatusUpdate(r){return console.info((new Date).toLocaleString(),"observing filter:",[{kinds:[Kt.UserStatuses],"#t":["omegle"],authors:[r]}]),this.npool.observe([{kinds:[Kt.UserStatuses],"#t":["omegle"],authors:[r]}])}queryWannachatResponse(r){return console.info((new Date).toLocaleString(),"quering filter:",[{kinds:[Kt.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}]),this.npool.query([{kinds:[Kt.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}])}listenWannachatResponse(r){return console.info((new Date).toLocaleString(),"observing filter:",[{kinds:[Kt.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}]),this.npool.observe([{kinds:[Kt.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}])}queryChatAvailable(){var r=this;return $(function*(){const i=Math.floor((new Date).getTime()/1e3);console.info((new Date).toLocaleString(),"quering filter: ",[{kinds:[Kt.UserStatuses],"#t":["wannachat","omegle"],since:i-600}]);let o=yield r.npool.query([{kinds:[Kt.UserStatuses],"#t":["wannachat","omegle"],since:i-600}]);o=o.filter(c=>!r.ignoreListService.isInList(c.pubkey));const a=o[Math.floor(Math.random()*o.length)];return a?console.info((new Date).toLocaleString(),"wanna chat found:",a):console.info((new Date).toLocaleString(),"wanna chat NOT found..."),Promise.resolve(a||null)})()}static#e=this.\u0275fac=function(i){return new(i||e)(G(fp),G(WR))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();class co{constructor(t){const{type:r,data:i}=Gl.decode(t);if("nsec"===r)this.nsec=t,this.secretKey=i,this.pubkey=UM(this.secretKey),this.npub=Gl.npubEncode(this.pubkey);else{if("npub"!==r)throw new Error("Invalid argument, NostrUser expect nsec or npub string");this.npub=t,this.pubkey=i.toString(),this.nsec=void 0,this.secretKey=void 0}}static fromPubkey(t){return new co(Gl.npubEncode(t))}static fromSecretKeyBytes(t){return new co(Gl.nsecEncode(t))}static create(){return this.fromSecretKeyBytes(M7())}toString(){return this.pubkey}}class QZ extends Rt{constructor(t,r){super()}schedule(t,r=0){return this}}const hp={setInterval(e,t,...r){const{delegate:i}=hp;return i?.setInterval?i.setInterval(e,t,...r):setInterval(e,t,...r)},clearInterval(e){const{delegate:t}=hp;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},KR={now:()=>(KR.delegate||Date).now(),delegate:void 0};class wu{constructor(t,r=wu.now){this.schedulerActionCtor=t,this.now=r}schedule(t,r=0,i){return new this.schedulerActionCtor(this,t).schedule(i,r)}}wu.now=KR.now;const XZ=new class JZ extends wu{constructor(t,r=wu.now){super(t,r),this.actions=[],this._active=!1}flush(t){const{actions:r}=this;if(this._active)return void r.push(t);let i;this._active=!0;do{if(i=t.execute(t.state,t.delay))break}while(t=r.shift());if(this._active=!1,i){for(;t=r.shift();)t.unsubscribe();throw i}}}(class YZ extends QZ{constructor(t,r){super(t,r),this.scheduler=t,this.work=r,this.pending=!1}schedule(t,r=0){var i;if(this.closed)return this;this.state=t;const s=this.id,o=this.scheduler;return null!=s&&(this.id=this.recycleAsyncId(o,s,r)),this.pending=!0,this.delay=r,this.id=null!==(i=this.id)&&void 0!==i?i:this.requestAsyncId(o,this.id,r),this}requestAsyncId(t,r,i=0){return hp.setInterval(t.flush.bind(t,this),i)}recycleAsyncId(t,r,i=0){if(null!=i&&this.delay===i&&!1===this.pending)return r;null!=r&&hp.clearInterval(r)}execute(t,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(t,r);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,r){let s,i=!1;try{this.work(t)}catch(o){i=!0,s=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s}unsubscribe(){if(!this.closed){const{id:t,scheduler:r}=this,{actions:i}=r;this.work=this.state=this.scheduler=null,this.pending=!1,Gu(i,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,super.unsubscribe()}}});function ys(e){return this instanceof ys?(this.v=e,this):new ys(e)}function XR(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,t=e[Symbol.asyncIterator];return t?t.call(e):(e=function g_(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=e[o]&&function(a){return new Promise(function(c,l){!function s(o,a,c,l){Promise.resolve(l).then(function(u){o({value:u,done:c})},a)}(c,l,(a=e[o](a)).done,a.value)})}}}"function"==typeof SuppressedError&&SuppressedError;const e2=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function t2(e){return nt(e?.then)}function n2(e){return nt(e[ng])}function r2(e){return Symbol.asyncIterator&&nt(e?.[Symbol.asyncIterator])}function i2(e){return new TypeError(`You provided ${null!==e&&"object"==typeof e?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const s2=function EK(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function o2(e){return nt(e?.[s2])}function a2(e){return function JR(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,i=r.apply(e,t||[]),o=[];return s=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",function a(p){return function(g){return Promise.resolve(g).then(p,f)}}),s[Symbol.asyncIterator]=function(){return this},s;function c(p,g){i[p]&&(s[p]=function(m){return new Promise(function(y,v){o.push([p,m,y,v])>1||l(p,m)})},g&&(s[p]=g(s[p])))}function l(p,g){try{!function u(p){p.value instanceof ys?Promise.resolve(p.value.v).then(d,f):h(o[0][2],p)}(i[p](g))}catch(m){h(o[0][3],m)}}function d(p){l("next",p)}function f(p){l("throw",p)}function h(p,g){p(g),o.shift(),o.length&&l(o[0][0],o[0][1])}}(this,arguments,function*(){const r=e.getReader();try{for(;;){const{value:i,done:s}=yield ys(r.read());if(s)return yield ys(void 0);yield yield ys(i)}}finally{r.releaseLock()}})}function c2(e){return nt(e?.getReader)}function Kr(e){if(e instanceof Ot)return e;if(null!=e){if(n2(e))return function DK(e){return new Ot(t=>{const r=e[ng]();if(nt(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(e);if(e2(e))return function CK(e){return new Ot(t=>{for(let r=0;r{e.then(r=>{t.closed||(t.next(r),t.complete())},r=>t.error(r)).then(null,zb)})}(e);if(r2(e))return l2(e);if(o2(e))return function IK(e){return new Ot(t=>{for(const r of e)if(t.next(r),t.closed)return;t.complete()})}(e);if(c2(e))return function TK(e){return l2(a2(e))}(e)}throw i2(e)}function l2(e){return new Ot(t=>{(function xK(e,t){var r,i,s,o;return function QR(e,t,r,i){return new(r||(r=Promise))(function(o,a){function c(d){try{u(i.next(d))}catch(f){a(f)}}function l(d){try{u(i.throw(d))}catch(f){a(f)}}function u(d){d.done?o(d.value):function s(o){return o instanceof r?o:new r(function(a){a(o)})}(d.value).then(c,l)}u((i=i.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){try{for(r=XR(e);!(i=yield r.next()).done;)if(t.next(i.value),t.closed)return}catch(a){s={error:a}}finally{try{i&&!i.done&&(o=r.return)&&(yield o.call(r))}finally{if(s)throw s.error}}t.complete()})})(e,t).catch(r=>t.error(r))})}function Qr(e,t,r,i=0,s=!1){const o=t.schedule(function(){r(),s?e.add(this.schedule(null,i)):this.unsubscribe()},i);if(e.add(o),!s)return o}const AK=qu(e=>function(r=null){e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r});function u2(e,t){const{first:r,each:i,with:s=MK,scheduler:o=t??XZ,meta:a=null}=function eK(e){return e instanceof Date&&!isNaN(e)}(e)?{first:e}:"number"==typeof e?{each:e}:e;if(null==r&&null==i)throw new TypeError("No timeout provided.");return Nt((c,l)=>{let u,d,f=null,h=0;const p=g=>{d=Qr(l,o,()=>{try{u.unsubscribe(),Kr(s({meta:a,lastValue:f,seen:h})).subscribe(l)}catch(m){l.error(m)}},g)};u=c.subscribe(_t(l,g=>{d?.unsubscribe(),h++,l.next(f=g),i>0&&p(i)},void 0,void 0,()=>{d?.closed||d?.unsubscribe(),f=null})),!h&&p(null!=r?"number"==typeof r?r:+r-o.now():i)})}function MK(e){throw new AK(e)}function vs(e){return Nt((t,r)=>{let o,i=null,s=!1;i=t.subscribe(_t(r,void 0,void 0,a=>{o=Kr(e(a,vs(e)(t))),i?(i.unsubscribe(),i=null,o.subscribe(r)):s=!0})),s&&(i.unsubscribe(),i=null,o.subscribe(r))})}function Ja(e,t){const r=nt(e)?e:()=>e,i=s=>s.error(r());return new Ot(t?s=>t.schedule(i,0,s):i)}let m_=(()=>{class e{constructor(r){this.globalConfigService=r,this.largeExpirationTime=1800}getCurrentTimestamp(){return Math.floor(Date.now()/1e3)}getExpirationTimestamp(r=this.globalConfigService.wannachatStatusDefaultTimeoutInSeconds){const s=Math.floor(Date.now()/1e3)+r;return String(s)}createEncryptedDirectMessage(r,i,s){var o=this;return $(function*(){const a=yield Kl.encrypt(r.secretKey,i.pubkey,s),c={kind:Kt.EncryptedDirectMessage,content:a,created_at:o.getCurrentTimestamp(),tags:[["p",i.pubkey],["expiration",o.getExpirationTimestamp(o.largeExpirationTime)]]},l=Zn(c,r.secretKey);return Promise.resolve(l)})()}createWannaChatUserStatus(r){return this.createUserStatus(r,"wannachat",[["expiration",this.getExpirationTimestamp()],["t","omegle"],["t","wannachat"]])}createDisconnectedUserStatus(r){return this.createUserStatus(r,"disconnected",[["expiration",this.getExpirationTimestamp()]])}createTypingUserStatus(r){return this.createUserStatus(r,"typing",[["t","omegle"],["expiration",this.getExpirationTimestamp(this.largeExpirationTime)]])}createChatingUserStatus(r,i){return this.createUserStatus(r,"chating",[["expiration",this.getExpirationTimestamp(this.largeExpirationTime)],["p",i.pubkey],["t","omegle"],["t","chating"]])}deleteUserHistory(r){const i={kind:5,tags:[["k",String(Kt.EncryptedDirectMessage)],["k",String(Kt.UserStatuses)],["expiration",this.getExpirationTimestamp()]],created_at:Math.floor((new Date).getTime()/1e3),content:""};return Zn(i,r.secretKey)}cleanUserStatus(r){return this.createUserStatus(r,"",[["t","omegle"]])}createUserStatus(r,i,s){const o=[["d","general"],...s||[]],a={kind:Kt.UserStatuses,content:i,created_at:this.getCurrentTimestamp(),tags:o};return Zn(a,r.secretKey)}static#e=this.\u0275fac=function(i){return new(i||e)(G(Kv))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),d2=(()=>{class e{constructor(r,i,s,o,a){this.nostrEventFactory=r,this.findStrangerNostr=i,this.ignoreListService=s,this.config=o,this.npool=a}publish(r){return this.npool.event(r)}searchStranger(r){var i=this;return $(function*(){const s=yield i.findStrangerNostr.queryChatAvailable();if(s){console.info((new Date).toLocaleString(),"inviting ",s.pubkey," to chat and listening confirmation");const o=i.listenChatingConfirmation(s,r);yield i.inviteToChating(r,s);const a=yield o;return i.ignoreListService.saveInList(s.pubkey),a?Promise.resolve(co.fromPubkey(s.pubkey)):(yield i.disconnect(r),i.searchStranger(r))}return yield i.publishWannaChatStatus(r),new Promise(o=>{const a=i.findStrangerNostr.listenWannachatResponse(r).pipe(u2(1e3*i.config.wannachatStatusDefaultTimeoutInSeconds),vs(c=>(a.unsubscribe(),i.deleteUserHistory(r).then(()=>i.searchStranger(r).then(l=>o(l))),Ja(()=>new c)))).subscribe({next:c=>{i.ignoreListService.saveInList(c.pubkey),i.replyChatInvitation(c,r).then(l=>l&&o(l)),a.unsubscribe()},error:c=>console.error((new Date).toLocaleString(),c)})})})()}replyChatInvitation(r,i){var s=this;return $(function*(){return console.info((new Date).toLocaleString(),"event was listen: ",r),console.info((new Date).toLocaleString(),"it must be a chating invitation from ",r.pubkey,", repling invitation..."),yield s.inviteToChating(i,r),console.info((new Date).toLocaleString(),"replied... resolving... "),console.info((new Date).toLocaleString(),"[searchStranger] unsubscribe"),Promise.resolve(co.fromPubkey(r.pubkey))})()}isChatingToMe(r,i){console.info((new Date).toLocaleString(),"is wannachat reply with chating? event: ",r);const s=r.tags.filter(([o])=>"p"===o).find(([,o])=>o===i.pubkey)||[];return console.info((new Date).toLocaleString(),"is wannachat reply with chating?",s.length?"yes":"no"),!!s.length}inviteToChating(r,i){const s=co.fromPubkey(i.pubkey);return this.publishChatInviteStatus(r,s)}listenChatingConfirmation(r,i){var s=this;return $(function*(){return new Promise(o=>{console.info((new Date).toLocaleString(),"listening status update from: ",r.pubkey);const a=s.findStrangerNostr.listenUserStatusUpdate(r.pubkey).pipe(u2(5e3),vs(c=>Ja(()=>new Error("chat confirmation timeout after 5s waiting, there is no stranger connected to this session")))).subscribe({next:c=>s.receiveChatingConfirmation(a,c,r,i).then(l=>{"boolean"==typeof l&&o(l)}),error:()=>o(!1)})})})()}receiveChatingConfirmation(r,i,s,o){return i.id===s.id&&"wannachat"===i.content?(console.info((new Date).toLocaleString(),"stranger #wannachat status was listen, ignoring and waiting new status..."),Promise.resolve(void 0)):(r.unsubscribe(),console.info((new Date).toLocaleString(),"[listenUserStatusUpdate] unsubscribe"),console.info((new Date).toLocaleString(),"stranger ",s.pubkey," update status: ",i),this.isChatingToMe(i,o)?(console.info((new Date).toLocaleString(),'is "chating" status confirmed, resolved with true'),Promise.resolve(!0)):(console.info((new Date).toLocaleString(),"unexpected status was given, resolved with false, event: ",i),Promise.resolve(!1)))}publishWannaChatStatus(r){var i=this;return $(function*(){const s=i.nostrEventFactory.createWannaChatUserStatus(r);return console.info((new Date).toLocaleString(),"updating my status to: ",s),yield i.npool.event(s),Promise.resolve(s)})()}publishChatInviteStatus(r,i){var s=this;return $(function*(){const o=s.nostrEventFactory.createChatingUserStatus(r,i);return console.info((new Date).toLocaleString(),"updating my status to: ",o),yield s.npool.event(o),Promise.resolve(o)})()}deleteUserHistory(r){var i=this;return $(function*(){const s=i.nostrEventFactory.deleteUserHistory(r);console.info((new Date).toLocaleString(),"deleting user history"),yield i.npool.event(s)})()}connect(){const r=co.create();return this.ignoreListService.saveInList(r.pubkey),r}disconnect(r){var i=this;return $(function*(){const s=i.nostrEventFactory.createDisconnectedUserStatus(r);return console.info((new Date).toLocaleString(),"updating my status to: ",s),yield i.deleteUserHistory(r),yield i.npool.event(s),Promise.resolve(s)})()}static#e=this.\u0275fac=function(i){return new(i||e)(G(m_),G(ZR),G(WR),G(Kv),G(fp))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})(),f2=(()=>{class e{constructor(r,i){this.nostrEventFactory=r,this.npool=i,this.updateUserCountTimeout=12e4}openEncryptedDirectMessage(r,i,s){return $(function*(){return Kl.decrypt(r.secretKey,i.pubkey,s.content)})()}listenMessages(r,i){return this.npool.observe([{kinds:[Kt.EncryptedDirectMessage],authors:[i.pubkey],"#p":[r.pubkey]}])}listenStrangerStatus(r){return this.npool.observe([{kinds:[Kt.UserStatuses],authors:[r.pubkey]}])}listenCurrenOnlineUsers(){const r=new ot;let i=!1;const s=()=>{i||(i=!0,console.info((new Date).toLocaleString(),"user count requested"),this.npool.query([{kinds:[Kt.UserStatuses],"#t":["omegle"]}]).then(a=>{const c=new Set;console.info((new Date).toLocaleString(),"count events",a),a.forEach(u=>c.add(u.pubkey));const l=[...c].length;console.info((new Date).toLocaleString(),"active users counted: ",l),r.next(l),i=!1}).catch(a=>{console.error((new Date).toLocaleString(),"user count lauched error",a),i=!1,clearInterval(o)}))},o=setInterval(s,this.updateUserCountTimeout);return s(),r.asObservable().pipe(vu(()=>clearInterval(o)))}sendMessage(r,i,s){var o=this;return $(function*(){yield o.stopTyping(r);const a=yield o.nostrEventFactory.createEncryptedDirectMessage(r,i,s);return o.npool.event(a)})()}isTyping(r){const i=this.nostrEventFactory.createTypingUserStatus(r);return this.npool.event(i)}stopTyping(r){const i=this.nostrEventFactory.cleanUserStatus(r);return this.npool.event(i)}static#e=this.\u0275fac=function(i){return new(i||e)(G(m_),G(fp))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})(),NK=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({providers:[ZR,d2,f2],imports:[Ea]})}return e})();function h2(e,t=0){return Nt((r,i)=>{r.subscribe(_t(i,s=>Qr(i,e,()=>i.next(s),t),()=>Qr(i,e,()=>i.complete(),t),s=>Qr(i,e,()=>i.error(s),t)))})}function p2(e,t=0){return Nt((r,i)=>{i.add(e.schedule(()=>r.subscribe(i),t))})}function g2(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ot(r=>{Qr(r,t,()=>{const i=e[Symbol.asyncIterator]();Qr(r,t,()=>{i.next().then(s=>{s.done?r.complete():r.next(s.value)})},0,!0)})})}function Ft(e,t){return t?function BK(e,t){if(null!=e){if(n2(e))return function OK(e,t){return Kr(e).pipe(p2(t),h2(t))}(e,t);if(e2(e))return function PK(e,t){return new Ot(r=>{let i=0;return t.schedule(function(){i===e.length?r.complete():(r.next(e[i++]),r.closed||this.schedule())})})}(e,t);if(t2(e))return function kK(e,t){return Kr(e).pipe(p2(t),h2(t))}(e,t);if(r2(e))return g2(e,t);if(o2(e))return function LK(e,t){return new Ot(r=>{let i;return Qr(r,t,()=>{i=e[s2](),Qr(r,t,()=>{let s,o;try{({value:s,done:o}=i.next())}catch(a){return void r.error(a)}o?r.complete():r.next(s)},0,!0)}),()=>nt(i?.return)&&i.return()})}(e,t);if(c2(e))return function FK(e,t){return g2(a2(e),t)}(e,t)}throw i2(e)}(e,t):Kr(e)}function y_(e){return e[e.length-1]}function pp(e){return function UK(e){return e&&nt(e.schedule)}(y_(e))?e.pop():void 0}function ue(...e){return Ft(e,pp(e))}const{isArray:$K}=Array,{getPrototypeOf:VK,prototype:HK,keys:zK}=Object;const{isArray:WK}=Array;function v_(...e){const t=pp(e),r=function jK(e){return nt(y_(e))?e.pop():void 0}(e),{args:i,keys:s}=function qK(e){if(1===e.length){const t=e[0];if($K(t))return{args:t,keys:null};if(function GK(e){return e&&"object"==typeof e&&VK(e)===HK}(t)){const r=zK(t);return{args:r.map(i=>t[i]),keys:r}}}return{args:e,keys:null}}(e);if(0===i.length)return Ft([],t);const o=new Ot(function YK(e,t,r=Cs){return i=>{m2(t,()=>{const{length:s}=e,o=new Array(s);let a=s,c=s;for(let l=0;l{const u=Ft(e[l],t);let d=!1;u.subscribe(_t(i,f=>{o[l]=f,d||(d=!0,c--),c||i.next(r(o.slice()))},()=>{--a||i.complete()}))},i)},i)}}(i,t,s?a=>function QK(e,t){return e.reduce((r,i,s)=>(r[i]=t[s],r),{})}(s,a):Cs));return r?o.pipe(function KK(e){return Ue(t=>function ZK(e,t){return WK(t)?e(...t):e(t)}(e,t))}(r)):o}function m2(e,t,r){e?Qr(r,e,t):t()}const gp=qu(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"});function Yt(e,t,r=1/0){return nt(t)?Yt((i,s)=>Ue((o,a)=>t(i,o,s,a))(Kr(e(i,s))),r):("number"==typeof t&&(r=t),Nt((i,s)=>function JK(e,t,r,i,s,o,a,c){const l=[];let u=0,d=0,f=!1;const h=()=>{f&&!l.length&&!u&&t.complete()},p=m=>u{o&&t.next(m),u++;let y=!1;Kr(r(m,d++)).subscribe(_t(t,v=>{s?.(v),o?p(v):t.next(v)},()=>{y=!0},void 0,()=>{if(y)try{for(u--;l.length&&ug(v)):g(v)}h()}catch(v){t.error(v)}}))};return e.subscribe(_t(t,p,()=>{f=!0,h()})),()=>{c?.()}}(i,s,e,r)))}function _u(e=1/0){return Yt(Cs,e)}function w_(...e){return function XK(){return _u(1)}()(Ft(e,pp(e)))}function y2(e){return new Ot(t=>{Kr(e()).subscribe(t)})}const Yr=new Ot(e=>e.complete());function __(){return Nt((e,t)=>{let r=null;e._refCount++;const i=_t(t,void 0,void 0,void 0,()=>{if(!e||e._refCount<=0||0<--e._refCount)return void(r=null);const s=e._connection,o=r;r=null,s&&(!o||s===o)&&s.unsubscribe(),t.unsubscribe()});e.subscribe(i),i.closed||(r=e.connect())})}class v2 extends Ot{constructor(t,r){super(),this.source=t,this.subjectFactory=r,this._subject=null,this._refCount=0,this._connection=null,Zb(t)&&(this.lift=t.lift)}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:t}=this;this._subject=this._connection=null,t?.unsubscribe()}connect(){let t=this._connection;if(!t){t=this._connection=new Rt;const r=this.getSubject();t.add(this.source.subscribe(_t(r,void 0,()=>{this._teardown(),r.complete()},i=>{this._teardown(),r.error(i)},()=>this._teardown()))),t.closed&&(this._connection=null,t=Rt.EMPTY)}return t}refCount(){return __()(this)}}function Jr(e,t){return Nt((r,i)=>{let s=null,o=0,a=!1;const c=()=>a&&!s&&i.complete();r.subscribe(_t(i,l=>{s?.unsubscribe();let u=0;const d=o++;Kr(e(l,d)).subscribe(s=_t(i,f=>i.next(t?t(l,f,d,u++):f),()=>{s=null,c()}))},()=>{a=!0,c()}))})}function Xa(e){return e<=0?()=>Yr:Nt((t,r)=>{let i=0;t.subscribe(_t(r,s=>{++i<=e&&(r.next(s),e<=i&&r.complete())}))})}function ws(e,t){return Nt((r,i)=>{let s=0;r.subscribe(_t(i,o=>e.call(t,o,s++)&&i.next(o)))})}function mp(e){return Nt((t,r)=>{let i=!1;t.subscribe(_t(r,s=>{i=!0,r.next(s)},()=>{i||r.next(e),r.complete()}))})}function w2(e=nQ){return Nt((t,r)=>{let i=!1;t.subscribe(_t(r,s=>{i=!0,r.next(s)},()=>i?r.complete():r.error(e())))})}function nQ(){return new gp}function lo(e,t){const r=arguments.length>=2;return i=>i.pipe(e?ws((s,o)=>e(s,o,i)):Cs,Xa(1),r?mp(t):w2(()=>new gp))}function bu(e,t){return nt(t)?Yt(e,t,1):Yt(e,1)}function dn(e,t,r){const i=nt(e)||t||r?{next:e,error:t,complete:r}:e;return i?Nt((s,o)=>{var a;null===(a=i.subscribe)||void 0===a||a.call(i);let c=!0;s.subscribe(_t(o,l=>{var u;null===(u=i.next)||void 0===u||u.call(i,l),o.next(l)},()=>{var l;c=!1,null===(l=i.complete)||void 0===l||l.call(i),o.complete()},l=>{var u;c=!1,null===(u=i.error)||void 0===u||u.call(i,l),o.error(l)},()=>{var l,u;c&&(null===(l=i.unsubscribe)||void 0===l||l.call(i)),null===(u=i.finalize)||void 0===u||u.call(i)}))}):Cs}function b_(e){return e<=0?()=>Yr:Nt((t,r)=>{let i=[];t.subscribe(_t(r,s=>{i.push(s),e{for(const s of i)r.next(s);r.complete()},void 0,()=>{i=null}))})}const ge="primary",Eu=Symbol("RouteTitle");class cQ{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const r=this.params[t];return Array.isArray(r)?r[0]:r}return null}getAll(t){if(this.has(t)){const r=this.params[t];return Array.isArray(r)?r:[r]}return[]}get keys(){return Object.keys(this.params)}}function ec(e){return new cQ(e)}function lQ(e,t,r){const i=r.path.split("/");if(i.length>e.length||"full"===r.pathMatch&&(t.hasChildren()||i.lengthi[o]===s)}return e===t}function b2(e){return e.length>0?e[e.length-1]:null}function _s(e){return function RK(e){return!!e&&(e instanceof Ot||nt(e.lift)&&nt(e.subscribe))}(e)?e:Lf(e)?Ft(Promise.resolve(e)):ue(e)}const dQ={exact:function C2(e,t,r){if(!uo(e.segments,t.segments)||!yp(e.segments,t.segments,r)||e.numberOfChildren!==t.numberOfChildren)return!1;for(const i in t.children)if(!e.children[i]||!C2(e.children[i],t.children[i],r))return!1;return!0},subset:S2},E2={exact:function fQ(e,t){return Xr(e,t)},subset:function hQ(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(r=>_2(e[r],t[r]))},ignored:()=>!0};function D2(e,t,r){return dQ[r.paths](e.root,t.root,r.matrixParams)&&E2[r.queryParams](e.queryParams,t.queryParams)&&!("exact"===r.fragment&&e.fragment!==t.fragment)}function S2(e,t,r){return I2(e,t,t.segments,r)}function I2(e,t,r,i){if(e.segments.length>r.length){const s=e.segments.slice(0,r.length);return!(!uo(s,r)||t.hasChildren()||!yp(s,r,i))}if(e.segments.length===r.length){if(!uo(e.segments,r)||!yp(e.segments,r,i))return!1;for(const s in t.children)if(!e.children[s]||!S2(e.children[s],t.children[s],i))return!1;return!0}{const s=r.slice(0,e.segments.length),o=r.slice(e.segments.length);return!!(uo(e.segments,s)&&yp(e.segments,s,i)&&e.children[ge])&&I2(e.children[ge],t,o,i)}}function yp(e,t,r){return t.every((i,s)=>E2[r](e[s].parameters,i.parameters))}class tc{constructor(t=new Ve([],{}),r={},i=null){this.root=t,this.queryParams=r,this.fragment=i}get queryParamMap(){return this._queryParamMap??=ec(this.queryParams),this._queryParamMap}toString(){return mQ.serialize(this)}}class Ve{constructor(t,r){this.segments=t,this.children=r,this.parent=null,Object.values(r).forEach(i=>i.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return vp(this)}}class Du{constructor(t,r){this.path=t,this.parameters=r}get parameterMap(){return this._parameterMap??=ec(this.parameters),this._parameterMap}toString(){return A2(this)}}function uo(e,t){return e.length===t.length&&e.every((r,i)=>r.path===t[i].path)}let nc=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>new D_,providedIn:"root"})}return e})();class D_{parse(t){const r=new TQ(t);return new tc(r.parseRootSegment(),r.parseQueryParams(),r.parseFragment())}serialize(t){const r=`/${Cu(t.root,!0)}`,i=function wQ(e){const t=Object.entries(e).map(([r,i])=>Array.isArray(i)?i.map(s=>`${wp(r)}=${wp(s)}`).join("&"):`${wp(r)}=${wp(i)}`).filter(r=>r);return t.length?`?${t.join("&")}`:""}(t.queryParams),s="string"==typeof t.fragment?`#${function yQ(e){return encodeURI(e)}(t.fragment)}`:"";return`${r}${i}${s}`}}const mQ=new D_;function vp(e){return e.segments.map(t=>A2(t)).join("/")}function Cu(e,t){if(!e.hasChildren())return vp(e);if(t){const r=e.children[ge]?Cu(e.children[ge],!1):"",i=[];return Object.entries(e.children).forEach(([s,o])=>{s!==ge&&i.push(`${s}:${Cu(o,!1)}`)}),i.length>0?`${r}(${i.join("//")})`:r}{const r=function gQ(e,t){let r=[];return Object.entries(e.children).forEach(([i,s])=>{i===ge&&(r=r.concat(t(s,i)))}),Object.entries(e.children).forEach(([i,s])=>{i!==ge&&(r=r.concat(t(s,i)))}),r}(e,(i,s)=>s===ge?[Cu(e.children[ge],!1)]:[`${s}:${Cu(i,!1)}`]);return 1===Object.keys(e.children).length&&null!=e.children[ge]?`${vp(e)}/${r[0]}`:`${vp(e)}/(${r.join("//")})`}}function T2(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function wp(e){return T2(e).replace(/%3B/gi,";")}function C_(e){return T2(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function _p(e){return decodeURIComponent(e)}function x2(e){return _p(e.replace(/\+/g,"%20"))}function A2(e){return`${C_(e.path)}${function vQ(e){return Object.entries(e).map(([t,r])=>`;${C_(t)}=${C_(r)}`).join("")}(e.parameters)}`}const _Q=/^[^\/()?;#]+/;function S_(e){const t=e.match(_Q);return t?t[0]:""}const bQ=/^[^\/()?;=#]+/,DQ=/^[^=?&#]+/,SQ=/^[^&#]+/;class TQ{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Ve([],{}):new Ve([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let r={};this.peekStartsWith("/(")&&(this.capture("/"),r=this.parseParens(!0));let i={};return this.peekStartsWith("(")&&(i=this.parseParens(!1)),(t.length>0||Object.keys(r).length>0)&&(i[ge]=new Ve(t,r)),i}parseSegment(){const t=S_(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new M(4009,!1);return this.capture(t),new Du(_p(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const r=function EQ(e){const t=e.match(bQ);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let i="";if(this.consumeOptional("=")){const s=S_(this.remaining);s&&(i=s,this.capture(i))}t[_p(r)]=_p(i)}parseQueryParam(t){const r=function CQ(e){const t=e.match(DQ);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let i="";if(this.consumeOptional("=")){const a=function IQ(e){const t=e.match(SQ);return t?t[0]:""}(this.remaining);a&&(i=a,this.capture(i))}const s=x2(r),o=x2(i);if(t.hasOwnProperty(s)){let a=t[s];Array.isArray(a)||(a=[a],t[s]=a),a.push(o)}else t[s]=o}parseParens(t){const r={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const i=S_(this.remaining),s=this.remaining[i.length];if("/"!==s&&")"!==s&&";"!==s)throw new M(4010,!1);let o;i.indexOf(":")>-1?(o=i.slice(0,i.indexOf(":")),this.capture(o),this.capture(":")):t&&(o=ge);const a=this.parseChildren();r[o]=1===Object.keys(a).length?a[ge]:new Ve([],a),this.consumeOptional("//")}return r}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new M(4011,!1)}}function M2(e){return e.segments.length>0?new Ve([],{[ge]:e}):e}function N2(e){const t={};for(const[i,s]of Object.entries(e.children)){const o=N2(s);if(i===ge&&0===o.segments.length&&o.hasChildren())for(const[a,c]of Object.entries(o.children))t[a]=c;else(o.segments.length>0||o.hasChildren())&&(t[i]=o)}return function xQ(e){if(1===e.numberOfChildren&&e.children[ge]){const t=e.children[ge];return new Ve(e.segments.concat(t.segments),t.children)}return e}(new Ve(e.segments,t))}function rc(e){return e instanceof tc}function R2(e){let t;const s=M2(function r(o){const a={};for(const l of o.children){const u=r(l);a[l.outlet]=u}const c=new Ve(o.url,a);return o===e&&(t=c),c}(e.root));return t??s}function O2(e,t,r,i){let s=e;for(;s.parent;)s=s.parent;if(0===t.length)return I_(s,s,s,r,i);const o=function MQ(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new P2(!0,0,e);let t=0,r=!1;const i=e.reduce((s,o,a)=>{if("object"==typeof o&&null!=o){if(o.outlets){const c={};return Object.entries(o.outlets).forEach(([l,u])=>{c[l]="string"==typeof u?u.split("/"):u}),[...s,{outlets:c}]}if(o.segmentPath)return[...s,o.segmentPath]}return"string"!=typeof o?[...s,o]:0===a?(o.split("/").forEach((c,l)=>{0==l&&"."===c||(0==l&&""===c?r=!0:".."===c?t++:""!=c&&s.push(c))}),s):[...s,o]},[]);return new P2(r,t,i)}(t);if(o.toRoot())return I_(s,s,new Ve([],{}),r,i);const a=function NQ(e,t,r){if(e.isAbsolute)return new Ep(t,!0,0);if(!r)return new Ep(t,!1,NaN);if(null===r.parent)return new Ep(r,!0,0);const i=bp(e.commands[0])?0:1;return function RQ(e,t,r){let i=e,s=t,o=r;for(;o>s;){if(o-=s,i=i.parent,!i)throw new M(4005,!1);s=i.segments.length}return new Ep(i,!1,s-o)}(r,r.segments.length-1+i,e.numberOfDoubleDots)}(o,s,e),c=a.processChildren?Iu(a.segmentGroup,a.index,o.commands):L2(a.segmentGroup,a.index,o.commands);return I_(s,a.segmentGroup,c,r,i)}function bp(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function Su(e){return"object"==typeof e&&null!=e&&e.outlets}function I_(e,t,r,i,s){let a,o={};i&&Object.entries(i).forEach(([l,u])=>{o[l]=Array.isArray(u)?u.map(d=>`${d}`):`${u}`}),a=e===t?r:k2(e,t,r);const c=M2(N2(a));return new tc(c,o,s)}function k2(e,t,r){const i={};return Object.entries(e.children).forEach(([s,o])=>{i[s]=o===t?r:k2(o,t,r)}),new Ve(e.segments,i)}class P2{constructor(t,r,i){if(this.isAbsolute=t,this.numberOfDoubleDots=r,this.commands=i,t&&i.length>0&&bp(i[0]))throw new M(4003,!1);const s=i.find(Su);if(s&&s!==b2(i))throw new M(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Ep{constructor(t,r,i){this.segmentGroup=t,this.processChildren=r,this.index=i}}function L2(e,t,r){if(e??=new Ve([],{}),0===e.segments.length&&e.hasChildren())return Iu(e,t,r);const i=function kQ(e,t,r){let i=0,s=t;const o={match:!1,pathIndex:0,commandIndex:0};for(;s=r.length)return o;const a=e.segments[s],c=r[i];if(Su(c))break;const l=`${c}`,u=i0&&void 0===l)break;if(l&&u&&"object"==typeof u&&void 0===u.outlets){if(!B2(l,u,a))return o;i+=2}else{if(!B2(l,{},a))return o;i++}s++}return{match:!0,pathIndex:s,commandIndex:i}}(e,t,r),s=r.slice(i.commandIndex);if(i.match&&i.pathIndexo!==ge)&&e.children[ge]&&1===e.numberOfChildren&&0===e.children[ge].segments.length){const o=Iu(e.children[ge],t,r);return new Ve(e.segments,o.children)}return Object.entries(i).forEach(([o,a])=>{"string"==typeof a&&(a=[a]),null!==a&&(s[o]=L2(e.children[o],t,a))}),Object.entries(e.children).forEach(([o,a])=>{void 0===i[o]&&(s[o]=a)}),new Ve(e.segments,s)}}function T_(e,t,r){const i=e.segments.slice(0,t);let s=0;for(;s{"string"==typeof i&&(i=[i]),null!==i&&(t[r]=T_(new Ve([],{}),0,i))}),t}function F2(e){const t={};return Object.entries(e).forEach(([r,i])=>t[r]=`${i}`),t}function B2(e,t,r){return e==r.path&&Xr(t,r.parameters)}const Tu="imperative";var Te=function(e){return e[e.NavigationStart=0]="NavigationStart",e[e.NavigationEnd=1]="NavigationEnd",e[e.NavigationCancel=2]="NavigationCancel",e[e.NavigationError=3]="NavigationError",e[e.RoutesRecognized=4]="RoutesRecognized",e[e.ResolveStart=5]="ResolveStart",e[e.ResolveEnd=6]="ResolveEnd",e[e.GuardsCheckStart=7]="GuardsCheckStart",e[e.GuardsCheckEnd=8]="GuardsCheckEnd",e[e.RouteConfigLoadStart=9]="RouteConfigLoadStart",e[e.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",e[e.ChildActivationStart=11]="ChildActivationStart",e[e.ChildActivationEnd=12]="ChildActivationEnd",e[e.ActivationStart=13]="ActivationStart",e[e.ActivationEnd=14]="ActivationEnd",e[e.Scroll=15]="Scroll",e[e.NavigationSkipped=16]="NavigationSkipped",e}(Te||{});class ei{constructor(t,r){this.id=t,this.url=r}}class Dp extends ei{constructor(t,r,i="imperative",s=null){super(t,r),this.type=Te.NavigationStart,this.navigationTrigger=i,this.restoredState=s}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class Ri extends ei{constructor(t,r,i){super(t,r),this.urlAfterRedirects=i,this.type=Te.NavigationEnd}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}var Fn=function(e){return e[e.Redirect=0]="Redirect",e[e.SupersededByNewNavigation=1]="SupersededByNewNavigation",e[e.NoDataFromResolver=2]="NoDataFromResolver",e[e.GuardRejected=3]="GuardRejected",e}(Fn||{}),Cp=function(e){return e[e.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",e[e.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",e}(Cp||{});class ic extends ei{constructor(t,r,i,s){super(t,r),this.reason=i,this.code=s,this.type=Te.NavigationCancel}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class sc extends ei{constructor(t,r,i,s){super(t,r),this.reason=i,this.code=s,this.type=Te.NavigationSkipped}}class Sp extends ei{constructor(t,r,i,s){super(t,r),this.error=i,this.target=s,this.type=Te.NavigationError}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class U2 extends ei{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Te.RoutesRecognized}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class LQ extends ei{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Te.GuardsCheckStart}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class FQ extends ei{constructor(t,r,i,s,o){super(t,r),this.urlAfterRedirects=i,this.state=s,this.shouldActivate=o,this.type=Te.GuardsCheckEnd}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class BQ extends ei{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Te.ResolveStart}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class UQ extends ei{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Te.ResolveEnd}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class jQ{constructor(t){this.route=t,this.type=Te.RouteConfigLoadStart}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class $Q{constructor(t){this.route=t,this.type=Te.RouteConfigLoadEnd}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class VQ{constructor(t){this.snapshot=t,this.type=Te.ChildActivationStart}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class HQ{constructor(t){this.snapshot=t,this.type=Te.ChildActivationEnd}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class zQ{constructor(t){this.snapshot=t,this.type=Te.ActivationStart}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class qQ{constructor(t){this.snapshot=t,this.type=Te.ActivationEnd}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class j2{constructor(t,r,i){this.routerEvent=t,this.position=r,this.anchor=i,this.type=Te.Scroll}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class x_{}class A_{constructor(t){this.url=t}}class GQ{constructor(){this.outlet=null,this.route=null,this.injector=null,this.children=new xu,this.attachRef=null}}let xu=(()=>{class e{constructor(){this.contexts=new Map}onChildOutletCreated(r,i){const s=this.getOrCreateContext(r);s.outlet=i,this.contexts.set(r,s)}onChildOutletDestroyed(r){const i=this.getContext(r);i&&(i.outlet=null,i.attachRef=null)}onOutletDeactivated(){const r=this.contexts;return this.contexts=new Map,r}onOutletReAttached(r){this.contexts=r}getOrCreateContext(r){let i=this.getContext(r);return i||(i=new GQ,this.contexts.set(r,i)),i}getContext(r){return this.contexts.get(r)||null}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();class $2{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const r=this.pathFromRoot(t);return r.length>1?r[r.length-2]:null}children(t){const r=M_(t,this._root);return r?r.children.map(i=>i.value):[]}firstChild(t){const r=M_(t,this._root);return r&&r.children.length>0?r.children[0].value:null}siblings(t){const r=N_(t,this._root);return r.length<2?[]:r[r.length-2].children.map(s=>s.value).filter(s=>s!==t)}pathFromRoot(t){return N_(t,this._root).map(r=>r.value)}}function M_(e,t){if(e===t.value)return t;for(const r of t.children){const i=M_(e,r);if(i)return i}return null}function N_(e,t){if(e===t.value)return[t];for(const r of t.children){const i=N_(e,r);if(i.length)return i.unshift(t),i}return[]}class vr{constructor(t,r){this.value=t,this.children=r}toString(){return`TreeNode(${this.value})`}}function oc(e){const t={};return e&&e.children.forEach(r=>t[r.value.outlet]=r),t}class V2 extends $2{constructor(t,r){super(t),this.snapshot=r,k_(this,t)}toString(){return this.snapshot.toString()}}function H2(e){const t=function WQ(e){const o=new O_([],{},{},"",{},ge,e,null,{});return new z2("",new vr(o,[]))}(e),r=new jn([new Du("",{})]),i=new jn({}),s=new jn({}),o=new jn({}),a=new jn(""),c=new ac(r,i,o,a,s,ge,e,t.root);return c.snapshot=t.root,new V2(new vr(c,[]),t)}class ac{constructor(t,r,i,s,o,a,c,l){this.urlSubject=t,this.paramsSubject=r,this.queryParamsSubject=i,this.fragmentSubject=s,this.dataSubject=o,this.outlet=a,this.component=c,this._futureSnapshot=l,this.title=this.dataSubject?.pipe(Ue(u=>u[Eu]))??ue(void 0),this.url=t,this.params=r,this.queryParams=i,this.fragment=s,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(Ue(t=>ec(t))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(Ue(t=>ec(t))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function R_(e,t,r="emptyOnly"){let i;const{routeConfig:s}=e;return i=null===t||"always"!==r&&""!==s?.path&&(t.component||t.routeConfig?.loadComponent)?{params:{...e.params},data:{...e.data},resolve:{...e.data,...e._resolvedData??{}}}:{params:{...t.params,...e.params},data:{...t.data,...e.data},resolve:{...e.data,...t.data,...s?.data,...e._resolvedData}},s&&G2(s)&&(i.resolve[Eu]=s.title),i}class O_{get title(){return this.data?.[Eu]}constructor(t,r,i,s,o,a,c,l,u){this.url=t,this.params=r,this.queryParams=i,this.fragment=s,this.data=o,this.outlet=a,this.component=c,this.routeConfig=l,this._resolve=u}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??=ec(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=ec(this.queryParams),this._queryParamMap}toString(){return`Route(url:'${this.url.map(i=>i.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class z2 extends $2{constructor(t,r){super(r),this.url=t,k_(this,r)}toString(){return q2(this._root)}}function k_(e,t){t.value._routerState=e,t.children.forEach(r=>k_(e,r))}function q2(e){const t=e.children.length>0?` { ${e.children.map(q2).join(", ")} } `:"";return`${e.value}${t}`}function P_(e){if(e.snapshot){const t=e.snapshot,r=e._futureSnapshot;e.snapshot=r,Xr(t.queryParams,r.queryParams)||e.queryParamsSubject.next(r.queryParams),t.fragment!==r.fragment&&e.fragmentSubject.next(r.fragment),Xr(t.params,r.params)||e.paramsSubject.next(r.params),function uQ(e,t){if(e.length!==t.length)return!1;for(let r=0;rXr(r.parameters,t[i].parameters))}(e.url,t.url);return r&&!(!e.parent!=!t.parent)&&(!e.parent||L_(e.parent,t.parent))}function G2(e){return"string"==typeof e.title||null===e.title}let F_=(()=>{class e{constructor(){this.activated=null,this._activatedRoute=null,this.name=ge,this.activateEvents=new rn,this.deactivateEvents=new rn,this.attachEvents=new rn,this.detachEvents=new rn,this.parentContexts=P(xu),this.location=P(or),this.changeDetector=P(Uf),this.environmentInjector=P(gn),this.inputBinder=P(Ip,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(r){if(r.name){const{firstChange:i,previousValue:s}=r.name;if(i)return;this.isTrackedInParentContexts(s)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(s)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(r){return this.parentContexts.getContext(r)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const r=this.parentContexts.getContext(this.name);r?.route&&(r.attachRef?this.attach(r.attachRef,r.route):this.activateWith(r.route,r.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new M(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new M(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new M(4012,!1);this.location.detach();const r=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(r.instance),r}attach(r,i){this.activated=r,this._activatedRoute=i,this.location.insert(r.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(r.instance)}deactivate(){if(this.activated){const r=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(r)}}activateWith(r,i){if(this.isActivated)throw new M(4013,!1);this._activatedRoute=r;const s=this.location,a=r.snapshot.component,c=this.parentContexts.getOrCreateContext(this.name).children,l=new B_(r,c,s.injector);this.activated=s.createComponent(a,{index:s.length,injector:l,environmentInjector:i??this.environmentInjector}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275dir=Xt({type:e,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[Ms]})}return e})();class B_{__ngOutletInjector(t){return new B_(this.route,this.childContexts,t)}constructor(t,r,i){this.route=t,this.childContexts=r,this.parent=i}get(t,r){return t===ac?this.route:t===xu?this.childContexts:this.parent.get(t,r)}}const Ip=new K("");let W2=(()=>{class e{constructor(){this.outletDataSubscriptions=new Map}bindActivatedRouteToOutletComponent(r){this.unsubscribeFromRouteData(r),this.subscribeToRouteData(r)}unsubscribeFromRouteData(r){this.outletDataSubscriptions.get(r)?.unsubscribe(),this.outletDataSubscriptions.delete(r)}subscribeToRouteData(r){const{activatedRoute:i}=r,s=v_([i.queryParams,i.params,i.data]).pipe(Jr(([o,a,c],l)=>(c={...o,...a,...c},0===l?ue(c):Promise.resolve(c)))).subscribe(o=>{if(!r.isActivated||!r.activatedComponentRef||r.activatedRoute!==i||null===i.component)return void this.unsubscribeFromRouteData(r);const a=function iV(e){const t=we(e);if(!t)return null;const r=new ll(t);return{get selector(){return r.selector},get type(){return r.componentType},get inputs(){return r.inputs},get outputs(){return r.outputs},get ngContentSelectors(){return r.ngContentSelectors},get isStandalone(){return t.standalone},get isSignal(){return t.signals}}}(i.component);if(a)for(const{templateName:c}of a.inputs)r.activatedComponentRef.setInput(c,o[c]);else this.unsubscribeFromRouteData(r)});this.outletDataSubscriptions.set(r,s)}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();function Au(e,t,r){if(r&&e.shouldReuseRoute(t.value,r.value.snapshot)){const i=r.value;i._futureSnapshot=t.value;const s=function KQ(e,t,r){return t.children.map(i=>{for(const s of r.children)if(e.shouldReuseRoute(i.value,s.value.snapshot))return Au(e,i,s);return Au(e,i)})}(e,t,r);return new vr(i,s)}{if(e.shouldAttach(t.value)){const o=e.retrieve(t.value);if(null!==o){const a=o.route;return a.value._futureSnapshot=t.value,a.children=t.children.map(c=>Au(e,c)),a}}const i=function QQ(e){return new ac(new jn(e.url),new jn(e.params),new jn(e.queryParams),new jn(e.fragment),new jn(e.data),e.outlet,e.component,e)}(t.value),s=t.children.map(o=>Au(e,o));return new vr(i,s)}}const Z2="ngNavigationCancelingError";function K2(e,t){const{redirectTo:r,navigationBehaviorOptions:i}=rc(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,s=Q2(!1,Fn.Redirect);return s.url=r,s.navigationBehaviorOptions=i,s}function Q2(e,t){const r=new Error(`NavigationCancelingError: ${e||""}`);return r[Z2]=!0,r.cancellationCode=t,r}function Y2(e){return!!e&&e[Z2]}let J2=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275cmp=So({type:e,selectors:[["ng-component"]],standalone:!0,features:[Mf],decls:1,vars:0,template:function(i,s){1&i&&mi(0,"router-outlet")},dependencies:[F_],encapsulation:2})}return e})();function U_(e){const t=e.children&&e.children.map(U_),r=t?{...e,children:t}:{...e};return!r.component&&!r.loadComponent&&(t||r.loadChildren)&&r.outlet&&r.outlet!==ge&&(r.component=J2),r}function ti(e){return e.outlet||ge}function Mu(e){if(!e)return null;if(e.routeConfig?._injector)return e.routeConfig._injector;for(let t=e.parent;t;t=t.parent){const r=t.routeConfig;if(r?._loadedInjector)return r._loadedInjector;if(r?._injector)return r._injector}return null}class iY{constructor(t,r,i,s,o){this.routeReuseStrategy=t,this.futureState=r,this.currState=i,this.forwardEvent=s,this.inputBindingEnabled=o}activate(t){const r=this.futureState._root,i=this.currState?this.currState._root:null;this.deactivateChildRoutes(r,i,t),P_(this.futureState.root),this.activateChildRoutes(r,i,t)}deactivateChildRoutes(t,r,i){const s=oc(r);t.children.forEach(o=>{const a=o.value.outlet;this.deactivateRoutes(o,s[a],i),delete s[a]}),Object.values(s).forEach(o=>{this.deactivateRouteAndItsChildren(o,i)})}deactivateRoutes(t,r,i){const s=t.value,o=r?r.value:null;if(s===o)if(s.component){const a=i.getContext(s.outlet);a&&this.deactivateChildRoutes(t,r,a.children)}else this.deactivateChildRoutes(t,r,i);else o&&this.deactivateRouteAndItsChildren(r,i)}deactivateRouteAndItsChildren(t,r){t.value.component&&this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,r):this.deactivateRouteAndOutlet(t,r)}detachAndStoreRouteSubtree(t,r){const i=r.getContext(t.value.outlet),s=i&&t.value.component?i.children:r,o=oc(t);for(const a of Object.values(o))this.deactivateRouteAndItsChildren(a,s);if(i&&i.outlet){const a=i.outlet.detach(),c=i.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:a,route:t,contexts:c})}}deactivateRouteAndOutlet(t,r){const i=r.getContext(t.value.outlet),s=i&&t.value.component?i.children:r,o=oc(t);for(const a of Object.values(o))this.deactivateRouteAndItsChildren(a,s);i&&(i.outlet&&(i.outlet.deactivate(),i.children.onOutletDeactivated()),i.attachRef=null,i.route=null)}activateChildRoutes(t,r,i){const s=oc(r);t.children.forEach(o=>{this.activateRoutes(o,s[o.value.outlet],i),this.forwardEvent(new qQ(o.value.snapshot))}),t.children.length&&this.forwardEvent(new HQ(t.value.snapshot))}activateRoutes(t,r,i){const s=t.value,o=r?r.value:null;if(P_(s),s===o)if(s.component){const a=i.getOrCreateContext(s.outlet);this.activateChildRoutes(t,r,a.children)}else this.activateChildRoutes(t,r,i);else if(s.component){const a=i.getOrCreateContext(s.outlet);if(this.routeReuseStrategy.shouldAttach(s.snapshot)){const c=this.routeReuseStrategy.retrieve(s.snapshot);this.routeReuseStrategy.store(s.snapshot,null),a.children.onOutletReAttached(c.contexts),a.attachRef=c.componentRef,a.route=c.route.value,a.outlet&&a.outlet.attach(c.componentRef,c.route.value),P_(c.route.value),this.activateChildRoutes(t,null,a.children)}else{const c=Mu(s.snapshot);a.attachRef=null,a.route=s,a.injector=c,a.outlet&&a.outlet.activateWith(s,a.injector),this.activateChildRoutes(t,null,a.children)}}else this.activateChildRoutes(t,null,i)}}class X2{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class Tp{constructor(t,r){this.component=t,this.route=r}}function sY(e,t,r){const i=e._root;return Nu(i,t?t._root:null,r,[i.value])}function cc(e,t){const r=Symbol(),i=t.get(e,r);return i===r?"function"!=typeof e||function Fk(e){return null!==Ju(e)}(e)?t.get(e):e:i}function Nu(e,t,r,i,s={canDeactivateChecks:[],canActivateChecks:[]}){const o=oc(t);return e.children.forEach(a=>{(function aY(e,t,r,i,s={canDeactivateChecks:[],canActivateChecks:[]}){const o=e.value,a=t?t.value:null,c=r?r.getContext(e.value.outlet):null;if(a&&o.routeConfig===a.routeConfig){const l=function cY(e,t,r){if("function"==typeof r)return r(e,t);switch(r){case"pathParamsChange":return!uo(e.url,t.url);case"pathParamsOrQueryParamsChange":return!uo(e.url,t.url)||!Xr(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!L_(e,t)||!Xr(e.queryParams,t.queryParams);default:return!L_(e,t)}}(a,o,o.routeConfig.runGuardsAndResolvers);l?s.canActivateChecks.push(new X2(i)):(o.data=a.data,o._resolvedData=a._resolvedData),Nu(e,t,o.component?c?c.children:null:r,i,s),l&&c&&c.outlet&&c.outlet.isActivated&&s.canDeactivateChecks.push(new Tp(c.outlet.component,a))}else a&&Ru(t,c,s),s.canActivateChecks.push(new X2(i)),Nu(e,null,o.component?c?c.children:null:r,i,s)})(a,o[a.value.outlet],r,i.concat([a.value]),s),delete o[a.value.outlet]}),Object.entries(o).forEach(([a,c])=>Ru(c,r.getContext(a),s)),s}function Ru(e,t,r){const i=oc(e),s=e.value;Object.entries(i).forEach(([o,a])=>{Ru(a,s.component?t?t.children.getContext(o):null:t,r)}),r.canDeactivateChecks.push(new Tp(s.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,s))}function Ou(e){return"function"==typeof e}function eO(e){return e instanceof gp||"EmptyError"===e?.name}const xp=Symbol("INITIAL_VALUE");function lc(){return Jr(e=>v_(e.map(t=>t.pipe(Xa(1),function tQ(...e){const t=pp(e);return Nt((r,i)=>{(t?w_(e,r,t):w_(e,r)).subscribe(i)})}(xp)))).pipe(Ue(t=>{for(const r of t)if(!0!==r){if(r===xp)return xp;if(!1===r||r instanceof tc)return r}return!0}),ws(t=>t!==xp),Xa(1)))}function tO(e){return function Tk(...e){return qb(e)}(dn(t=>{if(rc(t))throw K2(0,t)}),Ue(t=>!0===t))}class j_{constructor(t){this.segmentGroup=t||null}}class $_ extends Error{constructor(t){super(),this.urlTree=t}}function uc(e){return Ja(new j_(e))}class TY{constructor(t,r){this.urlSerializer=t,this.urlTree=r}lineralizeSegments(t,r){let i=[],s=r.root;for(;;){if(i=i.concat(s.segments),0===s.numberOfChildren)return ue(i);if(s.numberOfChildren>1||!s.children[ge])return Ja(new M(4e3,!1));s=s.children[ge]}}applyRedirectCommands(t,r,i){const s=this.applyRedirectCreateUrlTree(r,this.urlSerializer.parse(r),t,i);if(r.startsWith("/"))throw new $_(s);return s}applyRedirectCreateUrlTree(t,r,i,s){const o=this.createSegmentGroup(t,r.root,i,s);return new tc(o,this.createQueryParams(r.queryParams,this.urlTree.queryParams),r.fragment)}createQueryParams(t,r){const i={};return Object.entries(t).forEach(([s,o])=>{if("string"==typeof o&&o.startsWith(":")){const c=o.substring(1);i[s]=r[c]}else i[s]=o}),i}createSegmentGroup(t,r,i,s){const o=this.createSegments(t,r.segments,i,s);let a={};return Object.entries(r.children).forEach(([c,l])=>{a[c]=this.createSegmentGroup(t,l,i,s)}),new Ve(o,a)}createSegments(t,r,i,s){return r.map(o=>o.path.startsWith(":")?this.findPosParam(t,o,s):this.findOrReturn(o,i))}findPosParam(t,r,i){const s=i[r.path.substring(1)];if(!s)throw new M(4001,!1);return s}findOrReturn(t,r){let i=0;for(const s of r){if(s.path===t.path)return r.splice(i),s;i++}return t}}const V_={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function xY(e,t,r,i,s){const o=H_(e,t,r);return o.matched?(i=function JQ(e,t){return e.providers&&!e._injector&&(e._injector=hf(e.providers,t,`Route: ${e.path}`)),e._injector??t}(t,i),function CY(e,t,r,i){const s=t.canMatch;return s&&0!==s.length?ue(s.map(a=>{const c=cc(a,e);return _s(function pY(e){return e&&Ou(e.canMatch)}(c)?c.canMatch(t,r):oi(e,()=>c(t,r)))})).pipe(lc(),tO()):ue(!0)}(i,t,r).pipe(Ue(a=>!0===a?o:{...V_}))):ue(o)}function H_(e,t,r){if("**"===t.path)return function AY(e){return{matched:!0,parameters:e.length>0?b2(e).parameters:{},consumedSegments:e,remainingSegments:[],positionalParamSegments:{}}}(r);if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||r.length>0)?{...V_}:{matched:!0,consumedSegments:[],remainingSegments:r,parameters:{},positionalParamSegments:{}};const s=(t.matcher||lQ)(r,e,t);if(!s)return{...V_};const o={};Object.entries(s.posParams??{}).forEach(([c,l])=>{o[c]=l.path});const a=s.consumed.length>0?{...o,...s.consumed[s.consumed.length-1].parameters}:o;return{matched:!0,consumedSegments:s.consumed,remainingSegments:r.slice(s.consumed.length),parameters:a,positionalParamSegments:s.posParams??{}}}function nO(e,t,r,i){return r.length>0&&function RY(e,t,r){return r.some(i=>Ap(e,t,i)&&ti(i)!==ge)}(e,r,i)?{segmentGroup:new Ve(t,NY(i,new Ve(r,e.children))),slicedSegments:[]}:0===r.length&&function OY(e,t,r){return r.some(i=>Ap(e,t,i))}(e,r,i)?{segmentGroup:new Ve(e.segments,MY(e,r,i,e.children)),slicedSegments:r}:{segmentGroup:new Ve(e.segments,e.children),slicedSegments:r}}function MY(e,t,r,i){const s={};for(const o of r)if(Ap(e,t,o)&&!i[ti(o)]){const a=new Ve([],{});s[ti(o)]=a}return{...i,...s}}function NY(e,t){const r={};r[ge]=t;for(const i of e)if(""===i.path&&ti(i)!==ge){const s=new Ve([],{});r[ti(i)]=s}return r}function Ap(e,t,r){return(!(e.hasChildren()||t.length>0)||"full"!==r.pathMatch)&&""===r.path}class LY{}class UY{constructor(t,r,i,s,o,a,c){this.injector=t,this.configLoader=r,this.rootComponentType=i,this.config=s,this.urlTree=o,this.paramsInheritanceStrategy=a,this.urlSerializer=c,this.applyRedirects=new TY(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(t){return new M(4002,`'${t.segmentGroup}'`)}recognize(){const t=nO(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(t).pipe(Ue(r=>{const i=new O_([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,{},ge,this.rootComponentType,null,{}),s=new vr(i,r),o=new z2("",s),a=function AQ(e,t,r=null,i=null){return O2(R2(e),t,r,i)}(i,[],this.urlTree.queryParams,this.urlTree.fragment);return a.queryParams=this.urlTree.queryParams,o.url=this.urlSerializer.serialize(a),this.inheritParamsAndData(o._root,null),{state:o,tree:a}}))}match(t){return this.processSegmentGroup(this.injector,this.config,t,ge).pipe(vs(i=>{if(i instanceof $_)return this.urlTree=i.urlTree,this.match(i.urlTree.root);throw i instanceof j_?this.noMatchError(i):i}))}inheritParamsAndData(t,r){const i=t.value,s=R_(i,r,this.paramsInheritanceStrategy);i.params=Object.freeze(s.params),i.data=Object.freeze(s.data),t.children.forEach(o=>this.inheritParamsAndData(o,i))}processSegmentGroup(t,r,i,s){return 0===i.segments.length&&i.hasChildren()?this.processChildren(t,r,i):this.processSegment(t,r,i,i.segments,s,!0).pipe(Ue(o=>o instanceof vr?[o]:[]))}processChildren(t,r,i){const s=[];for(const o of Object.keys(i.children))"primary"===o?s.unshift(o):s.push(o);return Ft(s).pipe(bu(o=>{const a=i.children[o],c=function nY(e,t){const r=e.filter(i=>ti(i)===t);return r.push(...e.filter(i=>ti(i)!==t)),r}(r,o);return this.processSegmentGroup(t,c,a,o)}),function iQ(e,t){return Nt(function rQ(e,t,r,i,s){return(o,a)=>{let c=r,l=t,u=0;o.subscribe(_t(a,d=>{const f=u++;l=c?e(l,d,f):(c=!0,d),i&&a.next(l)},s&&(()=>{c&&a.next(l),a.complete()})))}}(e,t,arguments.length>=2,!0))}((o,a)=>(o.push(...a),o)),mp(null),function sQ(e,t){const r=arguments.length>=2;return i=>i.pipe(e?ws((s,o)=>e(s,o,i)):Cs,b_(1),r?mp(t):w2(()=>new gp))}(),Yt(o=>{if(null===o)return uc(i);const a=rO(o);return function jY(e){e.sort((t,r)=>t.value.outlet===ge?-1:r.value.outlet===ge?1:t.value.outlet.localeCompare(r.value.outlet))}(a),ue(a)}))}processSegment(t,r,i,s,o,a){return Ft(r).pipe(bu(c=>this.processSegmentAgainstRoute(c._injector??t,r,c,i,s,o,a).pipe(vs(l=>{if(l instanceof j_)return ue(null);throw l}))),lo(c=>!!c),vs(c=>{if(eO(c))return function PY(e,t,r){return 0===t.length&&!e.children[r]}(i,s,o)?ue(new LY):uc(i);throw c}))}processSegmentAgainstRoute(t,r,i,s,o,a,c){return function kY(e,t,r,i){return!!(ti(e)===i||i!==ge&&Ap(t,r,e))&&H_(t,e,r).matched}(i,s,o,a)?void 0===i.redirectTo?this.matchSegmentAgainstRoute(t,s,i,o,a):this.allowRedirects&&c?this.expandSegmentAgainstRouteUsingRedirect(t,s,r,i,o,a):uc(s):uc(s)}expandSegmentAgainstRouteUsingRedirect(t,r,i,s,o,a){const{matched:c,consumedSegments:l,positionalParamSegments:u,remainingSegments:d}=H_(r,s,o);if(!c)return uc(r);s.redirectTo.startsWith("/")&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const f=this.applyRedirects.applyRedirectCommands(l,s.redirectTo,u);return this.applyRedirects.lineralizeSegments(s,f).pipe(Yt(h=>this.processSegment(t,i,r,h.concat(d),a,!1)))}matchSegmentAgainstRoute(t,r,i,s,o){const a=xY(r,i,s,t);return"**"===i.path&&(r.children={}),a.pipe(Jr(c=>c.matched?this.getChildConfig(t=i._injector??t,i,s).pipe(Jr(({routes:l})=>{const u=i._loadedInjector??t,{consumedSegments:d,remainingSegments:f,parameters:h}=c,p=new O_(d,h,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,function VY(e){return e.data||{}}(i),ti(i),i.component??i._loadedComponent??null,i,function HY(e){return e.resolve||{}}(i)),{segmentGroup:g,slicedSegments:m}=nO(r,d,f,l);if(0===m.length&&g.hasChildren())return this.processChildren(u,l,g).pipe(Ue(v=>null===v?null:new vr(p,v)));if(0===l.length&&0===m.length)return ue(new vr(p,[]));const y=ti(i)===o;return this.processSegment(u,l,g,m,y?ge:o,!0).pipe(Ue(v=>new vr(p,v instanceof vr?[v]:[])))})):uc(r)))}getChildConfig(t,r,i){return r.children?ue({routes:r.children,injector:t}):r.loadChildren?void 0!==r._loadedRoutes?ue({routes:r._loadedRoutes,injector:r._loadedInjector}):function DY(e,t,r,i){const s=t.canLoad;return void 0===s||0===s.length?ue(!0):ue(s.map(a=>{const c=cc(a,e);return _s(function uY(e){return e&&Ou(e.canLoad)}(c)?c.canLoad(t,r):oi(e,()=>c(t,r)))})).pipe(lc(),tO())}(t,r,i).pipe(Yt(s=>s?this.configLoader.loadChildren(t,r).pipe(dn(o=>{r._loadedRoutes=o.routes,r._loadedInjector=o.injector})):function IY(e){return Ja(Q2(!1,Fn.GuardRejected))}())):ue({routes:[],injector:t})}}function $Y(e){const t=e.value.routeConfig;return t&&""===t.path}function rO(e){const t=[],r=new Set;for(const i of e){if(!$Y(i)){t.push(i);continue}const s=t.find(o=>i.value.routeConfig===o.value.routeConfig);void 0!==s?(s.children.push(...i.children),r.add(s)):t.push(i)}for(const i of r){const s=rO(i.children);t.push(new vr(i.value,s))}return t.filter(i=>!r.has(i))}function iO(e){const t=e.children.map(r=>iO(r)).flat();return[e,...t]}function z_(e){return Jr(t=>{const r=e(t);return r?Ft(r).pipe(Ue(()=>t)):ue(t)})}let sO=(()=>{class e{buildTitle(r){let i,s=r.root;for(;void 0!==s;)i=this.getResolvedTitleForRoute(s)??i,s=s.children.find(o=>o.outlet===ge);return i}getResolvedTitleForRoute(r){return r.data[Eu]}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>P(KY),providedIn:"root"})}return e})(),KY=(()=>{class e extends sO{constructor(r){super(),this.title=r}updateTitle(r){const i=this.buildTitle(r);void 0!==i&&this.title.setTitle(i)}static#e=this.\u0275fac=function(i){return new(i||e)(G(MH))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const dc=new K("",{providedIn:"root",factory:()=>({})}),fc=new K("");let q_=(()=>{class e{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=P(H1)}loadComponent(r){if(this.componentLoaders.get(r))return this.componentLoaders.get(r);if(r._loadedComponent)return ue(r._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(r);const i=_s(r.loadComponent()).pipe(Ue(oO),dn(o=>{this.onLoadEndListener&&this.onLoadEndListener(r),r._loadedComponent=o}),vu(()=>{this.componentLoaders.delete(r)})),s=new v2(i,()=>new ot).pipe(__());return this.componentLoaders.set(r,s),s}loadChildren(r,i){if(this.childrenLoaders.get(i))return this.childrenLoaders.get(i);if(i._loadedRoutes)return ue({routes:i._loadedRoutes,injector:i._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(i);const o=function QY(e,t,r,i){return _s(e.loadChildren()).pipe(Ue(oO),Yt(s=>s instanceof tI||Array.isArray(s)?ue(s):Ft(t.compileModuleAsync(s))),Ue(s=>{i&&i(e);let o,a,c=!1;return Array.isArray(s)?(a=s,!0):(o=s.create(r).injector,a=o.get(fc,[],{optional:!0,self:!0}).flat()),{routes:a.map(U_),injector:o}}))}(i,this.compiler,r,this.onLoadEndListener).pipe(vu(()=>{this.childrenLoaders.delete(i)})),a=new v2(o,()=>new ot).pipe(__());return this.childrenLoaders.set(i,a),a}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function oO(e){return function YY(e){return e&&"object"==typeof e&&"default"in e}(e)?e.default:e}let G_=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>P(JY),providedIn:"root"})}return e})(),JY=(()=>{class e{shouldProcessUrl(r){return!0}extract(r){return r}merge(r,i){return r}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const aO=new K(""),cO=new K("");function XY(e,t,r){const i=e.get(cO),s=e.get(Wt);return e.get(Ne).runOutsideAngular(()=>{if(!s.startViewTransition||i.skipNextTransition)return i.skipNextTransition=!1,new Promise(u=>setTimeout(u));let o;const a=new Promise(u=>{o=u}),c=s.startViewTransition(()=>(o(),function eJ(e){return new Promise(t=>{uy(t,{injector:e})})}(e))),{onViewTransitionCreated:l}=i;return l&&oi(e,()=>l({transition:c,from:t,to:r})),a})}let Mp=(()=>{class e{get hasRequestedNavigation(){return 0!==this.navigationId}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new ot,this.transitionAbortSubject=new ot,this.configLoader=P(q_),this.environmentInjector=P(gn),this.urlSerializer=P(nc),this.rootContexts=P(xu),this.location=P(Ml),this.inputBindingEnabled=null!==P(Ip,{optional:!0}),this.titleStrategy=P(sO),this.options=P(dc,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=P(G_),this.createViewTransition=P(aO,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>ue(void 0),this.rootComponentType=null,this.configLoader.onLoadEndListener=s=>this.events.next(new $Q(s)),this.configLoader.onLoadStartListener=s=>this.events.next(new jQ(s))}complete(){this.transitions?.complete()}handleNavigationRequest(r){const i=++this.navigationId;this.transitions?.next({...this.transitions.value,...r,id:i})}setupNavigations(r,i,s){return this.transitions=new jn({id:0,currentUrlTree:i,currentRawUrl:i,extractedUrl:this.urlHandlingStrategy.extract(i),urlAfterRedirects:this.urlHandlingStrategy.extract(i),rawUrl:i,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:Tu,restoredState:null,currentSnapshot:s.snapshot,targetSnapshot:null,currentRouterState:s,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(ws(o=>0!==o.id),Ue(o=>({...o,extractedUrl:this.urlHandlingStrategy.extract(o.rawUrl)})),Jr(o=>{let a=!1,c=!1;return ue(o).pipe(Jr(l=>{if(this.navigationId>o.id)return this.cancelNavigationTransition(o,"",Fn.SupersededByNewNavigation),Yr;this.currentTransition=o,this.currentNavigation={id:l.id,initialUrl:l.rawUrl,extractedUrl:l.extractedUrl,trigger:l.source,extras:l.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null};const u=!r.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl();if(!u&&"reload"!==(l.extras.onSameUrlNavigation??r.onSameUrlNavigation)){const f="";return this.events.next(new sc(l.id,this.urlSerializer.serialize(l.rawUrl),f,Cp.IgnoredSameUrlNavigation)),l.resolve(null),Yr}if(this.urlHandlingStrategy.shouldProcessUrl(l.rawUrl))return ue(l).pipe(Jr(f=>{const h=this.transitions?.getValue();return this.events.next(new Dp(f.id,this.urlSerializer.serialize(f.extractedUrl),f.source,f.restoredState)),h!==this.transitions?.getValue()?Yr:Promise.resolve(f)}),function zY(e,t,r,i,s,o){return Yt(a=>function FY(e,t,r,i,s,o,a="emptyOnly"){return new UY(e,t,r,i,s,a,o).recognize()}(e,t,r,i,a.extractedUrl,s,o).pipe(Ue(({state:c,tree:l})=>({...a,targetSnapshot:c,urlAfterRedirects:l}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,r.config,this.urlSerializer,this.paramsInheritanceStrategy),dn(f=>{o.targetSnapshot=f.targetSnapshot,o.urlAfterRedirects=f.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:f.urlAfterRedirects};const h=new U2(f.id,this.urlSerializer.serialize(f.extractedUrl),this.urlSerializer.serialize(f.urlAfterRedirects),f.targetSnapshot);this.events.next(h)}));if(u&&this.urlHandlingStrategy.shouldProcessUrl(l.currentRawUrl)){const{id:f,extractedUrl:h,source:p,restoredState:g,extras:m}=l,y=new Dp(f,this.urlSerializer.serialize(h),p,g);this.events.next(y);const v=H2(this.rootComponentType).snapshot;return this.currentTransition=o={...l,targetSnapshot:v,urlAfterRedirects:h,extras:{...m,skipLocationChange:!1,replaceUrl:!1}},this.currentNavigation.finalUrl=h,ue(o)}{const f="";return this.events.next(new sc(l.id,this.urlSerializer.serialize(l.extractedUrl),f,Cp.IgnoredByUrlHandlingStrategy)),l.resolve(null),Yr}}),dn(l=>{const u=new LQ(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot);this.events.next(u)}),Ue(l=>(this.currentTransition=o={...l,guards:sY(l.targetSnapshot,l.currentSnapshot,this.rootContexts)},o)),function gY(e,t){return Yt(r=>{const{targetSnapshot:i,currentSnapshot:s,guards:{canActivateChecks:o,canDeactivateChecks:a}}=r;return 0===a.length&&0===o.length?ue({...r,guardsResult:!0}):function mY(e,t,r,i){return Ft(e).pipe(Yt(s=>function EY(e,t,r,i,s){const o=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return o&&0!==o.length?ue(o.map(c=>{const l=Mu(t)??s,u=cc(c,l);return _s(function hY(e){return e&&Ou(e.canDeactivate)}(u)?u.canDeactivate(e,t,r,i):oi(l,()=>u(e,t,r,i))).pipe(lo())})).pipe(lc()):ue(!0)}(s.component,s.route,r,t,i)),lo(s=>!0!==s,!0))}(a,i,s,e).pipe(Yt(c=>c&&function lY(e){return"boolean"==typeof e}(c)?function yY(e,t,r,i){return Ft(t).pipe(bu(s=>w_(function wY(e,t){return null!==e&&t&&t(new VQ(e)),ue(!0)}(s.route.parent,i),function vY(e,t){return null!==e&&t&&t(new zQ(e)),ue(!0)}(s.route,i),function bY(e,t,r){const i=t[t.length-1],o=t.slice(0,t.length-1).reverse().map(a=>function oY(e){const t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null}(a)).filter(a=>null!==a).map(a=>y2(()=>ue(a.guards.map(l=>{const u=Mu(a.node)??r,d=cc(l,u);return _s(function fY(e){return e&&Ou(e.canActivateChild)}(d)?d.canActivateChild(i,e):oi(u,()=>d(i,e))).pipe(lo())})).pipe(lc())));return ue(o).pipe(lc())}(e,s.path,r),function _Y(e,t,r){const i=t.routeConfig?t.routeConfig.canActivate:null;if(!i||0===i.length)return ue(!0);const s=i.map(o=>y2(()=>{const a=Mu(t)??r,c=cc(o,a);return _s(function dY(e){return e&&Ou(e.canActivate)}(c)?c.canActivate(t,e):oi(a,()=>c(t,e))).pipe(lo())}));return ue(s).pipe(lc())}(e,s.route,r))),lo(s=>!0!==s,!0))}(i,o,e,t):ue(c)),Ue(c=>({...r,guardsResult:c})))})}(this.environmentInjector,l=>this.events.next(l)),dn(l=>{if(o.guardsResult=l.guardsResult,rc(l.guardsResult))throw K2(0,l.guardsResult);const u=new FQ(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot,!!l.guardsResult);this.events.next(u)}),ws(l=>!!l.guardsResult||(this.cancelNavigationTransition(l,"",Fn.GuardRejected),!1)),z_(l=>{if(l.guards.canActivateChecks.length)return ue(l).pipe(dn(u=>{const d=new BQ(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(d)}),Jr(u=>{let d=!1;return ue(u).pipe(function qY(e,t){return Yt(r=>{const{targetSnapshot:i,guards:{canActivateChecks:s}}=r;if(!s.length)return ue(r);const o=new Set(s.map(l=>l.route)),a=new Set;for(const l of o)if(!a.has(l))for(const u of iO(l))a.add(u);let c=0;return Ft(a).pipe(bu(l=>o.has(l)?function GY(e,t,r,i){const s=e.routeConfig,o=e._resolve;return void 0!==s?.title&&!G2(s)&&(o[Eu]=s.title),function WY(e,t,r,i){const s=E_(e);if(0===s.length)return ue({});const o={};return Ft(s).pipe(Yt(a=>function ZY(e,t,r,i){const s=Mu(t)??i,o=cc(e,s);return _s(o.resolve?o.resolve(t,r):oi(s,()=>o(t,r)))}(e[a],t,r,i).pipe(lo(),dn(c=>{o[a]=c}))),b_(1),function oQ(e){return Ue(()=>e)}(o),vs(a=>eO(a)?Yr:Ja(a)))}(o,e,t,i).pipe(Ue(a=>(e._resolvedData=a,e.data=R_(e,e.parent,r).resolve,null)))}(l,i,e,t):(l.data=R_(l,l.parent,e).resolve,ue(void 0))),dn(()=>c++),b_(1),Yt(l=>c===a.size?ue(r):Yr))})}(this.paramsInheritanceStrategy,this.environmentInjector),dn({next:()=>d=!0,complete:()=>{d||this.cancelNavigationTransition(u,"",Fn.NoDataFromResolver)}}))}),dn(u=>{const d=new UQ(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(d)}))}),z_(l=>{const u=d=>{const f=[];d.routeConfig?.loadComponent&&!d.routeConfig._loadedComponent&&f.push(this.configLoader.loadComponent(d.routeConfig).pipe(dn(h=>{d.component=h}),Ue(()=>{})));for(const h of d.children)f.push(...u(h));return f};return v_(u(l.targetSnapshot.root)).pipe(mp(null),Xa(1))}),z_(()=>this.afterPreactivation()),Jr(()=>{const{currentSnapshot:l,targetSnapshot:u}=o,d=this.createViewTransition?.(this.environmentInjector,l.root,u.root);return d?Ft(d).pipe(Ue(()=>o)):ue(o)}),Ue(l=>{const u=function ZQ(e,t,r){const i=Au(e,t._root,r?r._root:void 0);return new V2(i,t)}(r.routeReuseStrategy,l.targetSnapshot,l.currentRouterState);return this.currentTransition=o={...l,targetRouterState:u},this.currentNavigation.targetRouterState=u,o}),dn(()=>{this.events.next(new x_)}),((e,t,r,i)=>Ue(s=>(new iY(t,s.targetRouterState,s.currentRouterState,r,i).activate(e),s)))(this.rootContexts,r.routeReuseStrategy,l=>this.events.next(l),this.inputBindingEnabled),Xa(1),dn({next:l=>{a=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new Ri(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects))),this.titleStrategy?.updateTitle(l.targetRouterState.snapshot),l.resolve(!0)},complete:()=>{a=!0}}),function aQ(e){return Nt((t,r)=>{Kr(e).subscribe(_t(r,()=>r.complete(),Qp)),!r.closed&&t.subscribe(r)})}(this.transitionAbortSubject.pipe(dn(l=>{throw l}))),vu(()=>{!a&&!c&&this.cancelNavigationTransition(o,"",Fn.SupersededByNewNavigation),this.currentTransition?.id===o.id&&(this.currentNavigation=null,this.currentTransition=null)}),vs(l=>{if(c=!0,Y2(l))this.events.next(new ic(o.id,this.urlSerializer.serialize(o.extractedUrl),l.message,l.cancellationCode)),function YQ(e){return Y2(e)&&rc(e.url)}(l)?this.events.next(new A_(l.url)):o.resolve(!1);else{this.events.next(new Sp(o.id,this.urlSerializer.serialize(o.extractedUrl),l,o.targetSnapshot??void 0));try{o.resolve(r.errorHandler(l))}catch(u){this.options.resolveNavigationPromiseOnError?o.resolve(!1):o.reject(u)}}return Yr}))}))}cancelNavigationTransition(r,i,s){const o=new ic(r.id,this.urlSerializer.serialize(r.extractedUrl),i,s);this.events.next(o),r.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){return this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))).toString()!==this.currentTransition?.extractedUrl.toString()&&!this.currentTransition?.extras.skipLocationChange}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function tJ(e){return e!==Tu}let nJ=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>P(iJ),providedIn:"root"})}return e})();class rJ{shouldDetach(t){return!1}store(t,r){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,r){return t.routeConfig===r.routeConfig}}let iJ=(()=>{class e extends rJ{static#e=this.\u0275fac=(()=>{let r;return function(s){return(r||(r=nm(e)))(s||e)}})();static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),lO=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>P(sJ),providedIn:"root"})}return e})(),sJ=(()=>{class e extends lO{constructor(){super(...arguments),this.location=P(Ml),this.urlSerializer=P(nc),this.options=P(dc,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=P(G_),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new tc,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=H2(null),this.stateMemento=this.createStateMemento()}getCurrentUrlTree(){return this.currentUrlTree}getRawUrlTree(){return this.rawUrlTree}restoredState(){return this.location.getState()}get browserPageId(){return"computed"!==this.canceledNavigationResolution?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}getRouterState(){return this.routerState}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(r){return this.location.subscribe(i=>{"popstate"===i.type&&r(i.url,i.state)})}handleRouterEvent(r,i){if(r instanceof Dp)this.stateMemento=this.createStateMemento();else if(r instanceof sc)this.rawUrlTree=i.initialUrl;else if(r instanceof U2){if("eager"===this.urlUpdateStrategy&&!i.extras.skipLocationChange){const s=this.urlHandlingStrategy.merge(i.finalUrl,i.initialUrl);this.setBrowserUrl(s,i)}}else r instanceof x_?(this.currentUrlTree=i.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(i.finalUrl,i.initialUrl),this.routerState=i.targetRouterState,"deferred"===this.urlUpdateStrategy&&(i.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,i))):r instanceof ic&&(r.code===Fn.GuardRejected||r.code===Fn.NoDataFromResolver)?this.restoreHistory(i):r instanceof Sp?this.restoreHistory(i,!0):r instanceof Ri&&(this.lastSuccessfulId=r.id,this.currentPageId=this.browserPageId)}setBrowserUrl(r,i){const s=this.urlSerializer.serialize(r);if(this.location.isCurrentPathEqualTo(s)||i.extras.replaceUrl){const a={...i.extras.state,...this.generateNgRouterState(i.id,this.browserPageId)};this.location.replaceState(s,"",a)}else{const o={...i.extras.state,...this.generateNgRouterState(i.id,this.browserPageId+1)};this.location.go(s,"",o)}}restoreHistory(r,i=!1){if("computed"===this.canceledNavigationResolution){const o=this.currentPageId-this.browserPageId;0!==o?this.location.historyGo(o):this.currentUrlTree===r.finalUrl&&0===o&&(this.resetState(r),this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(i&&this.resetState(r),this.resetUrlToCurrentUrlTree())}resetState(r){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,r.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(r,i){return"computed"===this.canceledNavigationResolution?{navigationId:r,\u0275routerPageId:i}:{navigationId:r}}static#e=this.\u0275fac=(()=>{let r;return function(s){return(r||(r=nm(e)))(s||e)}})();static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var ku=function(e){return e[e.COMPLETE=0]="COMPLETE",e[e.FAILED=1]="FAILED",e[e.REDIRECTING=2]="REDIRECTING",e}(ku||{});function uO(e,t){e.events.pipe(ws(r=>r instanceof Ri||r instanceof ic||r instanceof Sp||r instanceof sc),Ue(r=>r instanceof Ri||r instanceof sc?ku.COMPLETE:r instanceof ic&&(r.code===Fn.Redirect||r.code===Fn.SupersededByNewNavigation)?ku.REDIRECTING:ku.FAILED),ws(r=>r!==ku.REDIRECTING),Xa(1)).subscribe(()=>{t()})}function oJ(e){throw e}const aJ={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},cJ={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let wr=(()=>{class e{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}constructor(){this.disposed=!1,this.isNgZoneEnabled=!1,this.console=P(O1),this.stateManager=P(lO),this.options=P(dc,{optional:!0})||{},this.pendingTasks=P(Ko),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=P(Mp),this.urlSerializer=P(nc),this.location=P(Ml),this.urlHandlingStrategy=P(G_),this._events=new ot,this.errorHandler=this.options.errorHandler||oJ,this.navigated=!1,this.routeReuseStrategy=P(nJ),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=P(fc,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!P(Ip,{optional:!0}),this.eventsSubscription=new Rt,this.isNgZoneEnabled=P(Ne)instanceof Ne&&Ne.isInAngularZone(),this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:r=>{this.console.warn(r)}}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){const r=this.navigationTransitions.events.subscribe(i=>{try{const s=this.navigationTransitions.currentTransition,o=this.navigationTransitions.currentNavigation;if(null!==s&&null!==o)if(this.stateManager.handleRouterEvent(i,o),i instanceof ic&&i.code!==Fn.Redirect&&i.code!==Fn.SupersededByNewNavigation)this.navigated=!0;else if(i instanceof Ri)this.navigated=!0;else if(i instanceof A_){const a=this.urlHandlingStrategy.merge(i.url,s.currentRawUrl),c={info:s.extras.info,skipLocationChange:s.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||tJ(s.source)};this.scheduleNavigation(a,Tu,null,c,{resolve:s.resolve,reject:s.reject,promise:s.promise})}(function uJ(e){return!(e instanceof x_||e instanceof A_)})(i)&&this._events.next(i)}catch(s){this.navigationTransitions.transitionAbortSubject.next(s)}});this.eventsSubscription.add(r)}resetRootComponentType(r){this.routerState.root.component=r,this.navigationTransitions.rootComponentType=r}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),Tu,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((r,i)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(r,"popstate",i)},0)})}navigateToSyncWithBrowser(r,i,s){const o={replaceUrl:!0},a=s?.navigationId?s:null;if(s){const l={...s};delete l.navigationId,delete l.\u0275routerPageId,0!==Object.keys(l).length&&(o.state=l)}const c=this.parseUrl(r);this.scheduleNavigation(c,i,a,o)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(r){this.config=r.map(U_),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(r,i={}){const{relativeTo:s,queryParams:o,fragment:a,queryParamsHandling:c,preserveFragment:l}=i,u=l?this.currentUrlTree.fragment:a;let f,d=null;switch(c){case"merge":d={...this.currentUrlTree.queryParams,...o};break;case"preserve":d=this.currentUrlTree.queryParams;break;default:d=o||null}null!==d&&(d=this.removeEmptyProps(d));try{f=R2(s?s.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof r[0]||!r[0].startsWith("/"))&&(r=[]),f=this.currentUrlTree.root}return O2(f,r,d,u??null)}navigateByUrl(r,i={skipLocationChange:!1}){const s=rc(r)?r:this.parseUrl(r),o=this.urlHandlingStrategy.merge(s,this.rawUrlTree);return this.scheduleNavigation(o,Tu,null,i)}navigate(r,i={skipLocationChange:!1}){return function lJ(e){for(let t=0;t(null!=o&&(i[s]=o),i),{})}scheduleNavigation(r,i,s,o,a){if(this.disposed)return Promise.resolve(!1);let c,l,u;a?(c=a.resolve,l=a.reject,u=a.promise):u=new Promise((f,h)=>{c=f,l=h});const d=this.pendingTasks.add();return uO(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(d))}),this.navigationTransitions.handleNavigationRequest({source:i,restoredState:s,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:r,extras:o,resolve:c,reject:l,promise:u,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),u.catch(f=>Promise.reject(f))}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();class dO{}let hJ=(()=>{class e{constructor(r,i,s,o,a){this.router=r,this.injector=s,this.preloadingStrategy=o,this.loader=a}setUpPreloading(){this.subscription=this.router.events.pipe(ws(r=>r instanceof Ri),bu(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(r,i){const s=[];for(const o of i){o.providers&&!o._injector&&(o._injector=hf(o.providers,r,`Route: ${o.path}`));const a=o._injector??r,c=o._loadedInjector??a;(o.loadChildren&&!o._loadedRoutes&&void 0===o.canLoad||o.loadComponent&&!o._loadedComponent)&&s.push(this.preloadConfig(a,o)),(o.children||o._loadedRoutes)&&s.push(this.processRoutes(c,o.children??o._loadedRoutes))}return Ft(s).pipe(_u())}preloadConfig(r,i){return this.preloadingStrategy.preload(i,()=>{let s;s=i.loadChildren&&void 0===i.canLoad?this.loader.loadChildren(r,i):ue(null);const o=s.pipe(Yt(a=>null===a?ue(void 0):(i._loadedRoutes=a.routes,i._loadedInjector=a.injector,this.processRoutes(a.injector??r,a.routes))));return i.loadComponent&&!i._loadedComponent?Ft([o,this.loader.loadComponent(i)]).pipe(_u()):o})}static#e=this.\u0275fac=function(i){return new(i||e)(G(wr),G(H1),G(gn),G(dO),G(q_))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const Z_=new K("");let fO=(()=>{class e{constructor(r,i,s,o,a={}){this.urlSerializer=r,this.transitions=i,this.viewportScroller=s,this.zone=o,this.options=a,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},this.environmentInjector=P(gn),a.scrollPositionRestoration||="disabled",a.anchorScrolling||="disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(r=>{r instanceof Dp?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=r.navigationTrigger,this.restoredId=r.restoredState?r.restoredState.navigationId:0):r instanceof Ri?(this.lastId=r.id,this.scheduleScrollEvent(r,this.urlSerializer.parse(r.urlAfterRedirects).fragment)):r instanceof sc&&r.code===Cp.IgnoredSameUrlNavigation&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(r,this.urlSerializer.parse(r.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(r=>{r instanceof j2&&(r.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(r.position):r.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(r.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(r,i){var s=this;this.zone.runOutsideAngular($(function*(){yield new Promise(o=>{setTimeout(()=>{o()}),uy(()=>{o()},{injector:s.environmentInjector})}),s.zone.run(()=>{s.transitions.events.next(new j2(r,"popstate"===s.lastSource?s.store[s.restoredId]:null,i))})}))}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static#e=this.\u0275fac=function(i){!function LC(){throw new Error("invalid")}()};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();function ni(e,t){return{\u0275kind:e,\u0275providers:t}}function pO(){const e=P(qt);return t=>{const r=e.get(Br);if(t!==r.components[0])return;const i=e.get(wr),s=e.get(gO);1===e.get(K_)&&i.initialNavigation(),e.get(mO,null,Ee.Optional)?.setUpPreloading(),e.get(Z_,null,Ee.Optional)?.init(),i.resetRootComponentType(r.componentTypes[0]),s.closed||(s.next(),s.complete(),s.unsubscribe())}}const gO=new K("",{factory:()=>new ot}),K_=new K("",{providedIn:"root",factory:()=>1}),mO=new K("");function yJ(e){return ni(0,[{provide:mO,useExisting:hJ},{provide:dO,useExisting:e}])}function wJ(e){return ni(9,[{provide:aO,useValue:XY},{provide:cO,useValue:{skipNextTransition:!!e?.skipInitialTransition,...e}}])}const yO=new K("ROUTER_FORROOT_GUARD"),_J=[Ml,{provide:nc,useClass:D_},wr,xu,{provide:ac,useFactory:function hO(e){return e.routerState.root},deps:[wr]},q_,[]];let vO=(()=>{class e{constructor(r){}static forRoot(r,i){return{ngModule:e,providers:[_J,[],{provide:fc,multi:!0,useValue:r},{provide:yO,useFactory:CJ,deps:[[wr,new rd,new id]]},{provide:dc,useValue:i||{}},i?.useHash?{provide:qs,useClass:lV}:{provide:qs,useClass:Ox},{provide:Z_,useFactory:()=>{const e=P(M5),t=P(Ne),r=P(dc),i=P(Mp),s=P(nc);return r.scrollOffset&&e.setOffset(r.scrollOffset),new fO(s,i,e,t,r)}},i?.preloadingStrategy?yJ(i.preloadingStrategy).\u0275providers:[],i?.initialNavigation?SJ(i):[],i?.bindToComponentInputs?ni(8,[W2,{provide:Ip,useExisting:W2}]).\u0275providers:[],i?.enableViewTransitions?wJ().\u0275providers:[],[{provide:wO,useFactory:pO},{provide:fv,multi:!0,useExisting:wO}]]}}static forChild(r){return{ngModule:e,providers:[{provide:fc,multi:!0,useValue:r}]}}static#e=this.\u0275fac=function(i){return new(i||e)(G(yO,8))};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({})}return e})();function CJ(e){return"guarded"}function SJ(e){return["disabled"===e.initialNavigation?ni(3,[{provide:uv,multi:!0,useFactory:()=>{const t=P(wr);return()=>{t.setUpLocationChangeListener()}}},{provide:K_,useValue:2}]).\u0275providers:[],"enabledBlocking"===e.initialNavigation?ni(2,[{provide:K_,useValue:0},{provide:uv,multi:!0,deps:[qt],useFactory:t=>{const r=t.get(aV,Promise.resolve());return()=>r.then(()=>new Promise(i=>{const s=t.get(wr),o=t.get(gO);uO(s,()=>{i(!0)}),t.get(Mp).afterPreactivation=()=>(i(!0),o.closed?ue(void 0):o),s.initialNavigation()}))}}]).\u0275providers:[]]}const wO=new K("");var Oi=function(e){return e.STRANGE="STRANGE",e.YOU="YOU",e}(Oi||{}),ki=function(e){return e.CONNECTED="CONNECTED",e.UP_TO_DISCONNECT="UP_TO_DISCONNECT",e.DISCONNECTED="DISCONNECTED",e.SEARCHING_STRANGER="SEARCHING_STRANGER",e}(ki||{});let TJ=(()=>{class e{constructor(){this.authorTypes={[Oi.STRANGE]:"Stranger",[Oi.YOU]:"You"}}transform(r){return this.authorTypes[r]}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275pipe=en({name:"author",type:e,pure:!0})}return e})();const xJ=["conversation"];function AJ(e,t){1&e&&(Le(0,"div",18),at(1," You're now chatting with a random stranger. "),Qe())}function MJ(e,t){1&e&&(Le(0,"div",18),at(1," Looking for someone you can chat with. "),Qe())}function NJ(e,t){if(1&e&&(Le(0,"div",19)(1,"span"),at(2),function m1(e,t){const r=De();let i;const s=e+fe;r.firstCreatePass?(i=function Wj(e,t){if(t)for(let r=t.length-1;r>=0;r--){const i=t[r];if(e===i.name)return i}}(t,r.pipeRegistry),r.data[s]=i,i.onDestroy&&(r.destroyHooks??=[]).push(s,i.onDestroy)):i=r.data[s];const o=i.factory||(i.factory=Ss(i.type)),c=fn(X);try{const l=Dd(!1),u=o();return Dd(l),function mj(e,t,r,i){r>=e.data.length&&(e.data[r]=null,e.blueprint[r]=null),t[r]=i}(r,N(),s,u),u}finally{fn(c)}}(3,"author"),Qe(),Le(4,"span",20),at(5),Qe()()),2&e){const r=t.$implicit,i=It();Ie(),Uy("authorStranger",r.author===i.authorStrange)("authorYou",r.author===i.authorYou),Ie(),Fr("",y1(3,6,r.author),": "),Ie(3),Af(r.text)}}function RJ(e,t){1&e&&(Le(0,"div",18),at(1," Stranger is typing... "),Qe())}function OJ(e,t){1&e&&(Le(0,"div",18),at(1,"Stranger has disconnected."),Qe())}function kJ(e,t){1&e&&(Le(0,"div",18),at(1,"You have disconnected."),Qe())}function PJ(e,t){if(1&e&&(ha(0),Hn(1,OJ,2,0,"div",9)(2,kJ,2,0,"div",9),pa()),2&e){const r=It();Ie(),Ke("ngIf",r.whoDisconnected===r.authorStrange),Ie(),Ke("ngIf",r.whoDisconnected===r.authorYou)}}function LJ(e,t){if(1&e){const r=Vs();Le(0,"button",21),kn("click",function(){return ci(r),li(It().findStranger())}),at(1," Start "),Qe()}if(2&e){const r=It();kr("disabled",r.currentState===r.stateSearchingStranger?"disabled":null)}}function FJ(e,t){if(1&e){const r=Vs();Le(0,"button",22),kn("click",function(){ci(r);const s=It();return li(s.currentState=s.stateUpToDisconnect)}),at(1," Stop "),Qe()}}function BJ(e,t){if(1&e){const r=Vs();Le(0,"button",23),kn("click",function(){ci(r);const s=It(),o=xf(19);return s.disconnect(),li(s.cleanMessageField(o))}),at(1," Really? "),Qe()}}const UJ=[{path:"chat",component:(()=>{class e{constructor(r,i){this.findStrangerProxy=r,this.talkToStrangerNostr=i,this.stateConnected=ki.CONNECTED,this.stateUpToDisconnect=ki.UP_TO_DISCONNECT,this.stateDisconnected=ki.DISCONNECTED,this.stateSearchingStranger=ki.SEARCHING_STRANGER,this.authorStrange=Oi.STRANGE,this.authorYou=Oi.YOU,this.typingTimeoutAmount=2e3,this.typingTimeoutId=0,this.currentOnline=1,this.strangeIsTyping=!1,this.currentState=ki.DISCONNECTED,this.whoDisconnected=null,this.you=null,this.stranger=null,this.messages=[],this.subscriptions=new Rt}ngOnInit(){this.subscriptions.add(this.talkToStrangerNostr.listenCurrenOnlineUsers().subscribe(r=>this.currentOnline=r||1))}ngOnDestroy(){this.subscriptions.unsubscribe()}onBeforeUnload(){var r=this;return $(function*(){return yield r.disconnect(),!0})()}findStranger(){this.whoDisconnected=null,this.currentState=this.stateSearchingStranger,this.messages=[];const r=this.you=this.findStrangerProxy.connect();console.info((new Date).toLocaleString(),"me: ",r.pubkey),this.findStrangerProxy.searchStranger(this.you).then(i=>this.startConversation(r,i)).catch(i=>console.error((new Date).toLocaleString(),i))}disconnect(){return this.you?(this.stranger=null,this.findStrangerProxy.disconnect(this.you).then(()=>(this.currentState=ki.DISCONNECTED,this.strangeIsTyping=!1,this.whoDisconnected||(this.whoDisconnected=Oi.YOU),Promise.resolve()))):Promise.resolve()}startConversation(r,i){console.log((new Date).toLocaleString(),"starting conversation, stranger: ",i),this.stranger=i,this.currentState=ki.CONNECTED,1===this.currentOnline&&(this.currentOnline=2),this.subscriptions.add(this.talkToStrangerNostr.listenMessages(r,i).subscribe({next:s=>this.addMessageFromStranger(r,i,s)})),this.subscriptions.add(this.talkToStrangerNostr.listenStrangerStatus(i).subscribe({next:s=>this.handleStrangerStatus(s)}))}addMessageFromStranger(r,i,s){this.talkToStrangerNostr.openEncryptedDirectMessage(r,i,s).then(o=>{this.messages.push({text:o,author:Oi.STRANGE,time:s.created_at}),this.scrollConversationToTheEnd()})}handleStrangerStatus(r){"typing"===r.content?this.strangeIsTyping=!0:"disconnected"===r.content?(this.strangeIsTyping=!1,this.whoDisconnected=Oi.STRANGE,this.currentState=ki.DISCONNECTED,this.disconnect()):this.strangeIsTyping=!1}sendMessage(r){const i=this.you,s=this.stranger;i&&s&&r.length&&(this.talkToStrangerNostr.sendMessage(i,s,r),this.messages.push({author:Oi.YOU,text:r,time:Math.floor((new Date).getTime()/1e3)}),this.scrollConversationToTheEnd())}scrollConversationToTheEnd(){setTimeout(()=>{const r=this.conversationEl.nativeElement;r.scrollTo({top:r.scrollHeight,behavior:"smooth"})})}cleanMessageField(r){setTimeout(()=>r.value="")}onTyping(){const r=this.you;r&&(this.typingTimeoutId||this.talkToStrangerNostr.isTyping(r),clearTimeout(this.typingTimeoutId),this.typingTimeoutId=Number(setTimeout(()=>{this.talkToStrangerNostr.stopTyping(r),this.typingTimeoutId=0},this.typingTimeoutAmount)))}static#e=this.\u0275fac=function(i){return new(i||e)(X(d2),X(f2))};static#t=this.\u0275cmp=So({type:e,selectors:[["omg-chat"]],viewQuery:function(i,s){if(1&i&&function VT(e,t,r){RS(e,t,r)}(xJ,5),2&i){let o;(function Qy(e){const t=N(),r=De(),i=Wg();wd(i+1);const s=by(r,i);if(e.dirty&&function GP(e){return!(4&~e[ee])}(t)===!(2&~s.metadata.flags)){if(null===s.matches)e.reset([]);else{const o=PS(t,i);e.reset(o,bD),e.notifyOnChanges()}return!0}return!1})(o=Yy())&&(s.conversationEl=o.first)}},hostBindings:function(i,s){1&i&&kn("beforeunload",function(){return s.onBeforeUnload()},0,gC)},decls:23,vars:11,consts:[["conversation",""],["messageField",""],["send",""],[1,"navbar"],["src","/assets/logo.png","alt","logo",1,"logo"],[1,"description"],[1,"online"],[1,"main"],[1,"conversation"],["class","message",4,"ngIf"],["class","chat",4,"ngFor","ngForOf"],[4,"ngIf"],["novalidate","","autocomplete","off",1,"form"],["type","button","class","btn start bottomLeftRadius",3,"click",4,"ngIf"],["type","button","class","btn bottomLeftRadius",3,"click",4,"ngIf"],["type","button","class","btn bottomLeftRadius bold",3,"click",4,"ngIf"],["name","text",1,"textarea",3,"keydown.enter","keydown"],["type","button",1,"btn","bottomRightRadius",3,"click"],[1,"message"],[1,"chat"],[1,"text"],["type","button",1,"btn","start","bottomLeftRadius",3,"click"],["type","button",1,"btn","bottomLeftRadius",3,"click"],["type","button",1,"btn","bottomLeftRadius","bold",3,"click"]],template:function(i,s){if(1&i){const o=Vs();Le(0,"section",3),mi(1,"img",4),Le(2,"h2",5),at(3,"Talk to strangers!"),Qe(),Le(4,"h2",6),at(5),Qe()(),Le(6,"main",7)(7,"section",8,0),Hn(9,AJ,2,0,"div",9)(10,MJ,2,0,"div",9)(11,NJ,6,8,"div",10)(12,RJ,2,0,"div",9)(13,PJ,3,2,"ng-container",11),Qe(),Le(14,"form",12),Hn(15,LJ,2,1,"button",13)(16,FJ,2,0,"button",14)(17,BJ,2,0,"button",15),Le(18,"textarea",16,1),kn("keydown.enter",function(){ci(o);const c=xf(19);return s.sendMessage(c.value),li(s.cleanMessageField(c))})("keydown",function(){return ci(o),li(s.onTyping())}),Qe(),Le(20,"button",17,2),kn("click",function(){ci(o);const c=xf(19);return s.sendMessage(c.value),li(s.cleanMessageField(c))}),at(22," Send "),Qe()()()}2&i&&(Ie(5),Af(s.currentOnline),Ie(4),Ke("ngIf",s.stranger),Ie(),Ke("ngIf",!s.stranger&&s.currentState===s.stateSearchingStranger),Ie(),Ke("ngForOf",s.messages),Ie(),Ke("ngIf",s.strangeIsTyping),Ie(),Ke("ngIf",s.currentState===s.stateDisconnected),Ie(2),Ke("ngIf",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger),Ie(),Ke("ngIf",s.currentState===s.stateConnected),Ie(),Ke("ngIf",s.currentState===s.stateUpToDisconnect),Ie(),kr("disabled",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger?"disabled":null),Ie(2),kr("disabled",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger?"disabled":null))},dependencies:[qx,sh,TJ],encapsulation:2})}return e})()},{path:"",redirectTo:"chat",pathMatch:"full"}];let jJ=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({imports:[vO.forRoot(UJ,{useHash:!0}),vO]})}return e})(),Q_=(()=>{class e extends ot{constructor(){super()}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var ce=function(e){return e[e.State=0]="State",e[e.Transition=1]="Transition",e[e.Sequence=2]="Sequence",e[e.Group=3]="Group",e[e.Animate=4]="Animate",e[e.Keyframes=5]="Keyframes",e[e.Style=6]="Style",e[e.Trigger=7]="Trigger",e[e.Reference=8]="Reference",e[e.AnimateChild=9]="AnimateChild",e[e.AnimateRef=10]="AnimateRef",e[e.Query=11]="Query",e[e.Stagger=12]="Stagger",e}(ce||{});const Pi="*";function $J(e,t){return{type:ce.Trigger,name:e,definitions:t,options:{}}}function _O(e,t=null){return{type:ce.Animate,styles:t,timings:e}}function Pu(e){return{type:ce.Style,styles:e,offset:null}}function Y_(e,t,r){return{type:ce.State,name:e,styles:t,options:r}}function bO(e,t,r=null){return{type:ce.Transition,expr:e,animation:t,options:r}}class Lu{constructor(t=0,r=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._originalOnDoneFns=[],this._originalOnStartFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+r}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){const r="start"==t?this._onStartFns:this._onDoneFns;r.forEach(i=>i()),r.length=0}}class EO{constructor(t){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;let r=0,i=0,s=0;const o=this.players.length;0==o?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++r==o&&this._onFinish()}),a.onDestroy(()=>{++i==o&&this._onDestroy()}),a.onStart(()=>{++s==o&&this._onStart()})}),this.totalTime=this.players.reduce((a,c)=>Math.max(a,c.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){const r=t*this.totalTime;this.players.forEach(i=>{const s=i.totalTime?Math.min(1,r/i.totalTime):1;i.setPosition(s)})}getPosition(){const t=this.players.reduce((r,i)=>null===r||i.totalTime>r.totalTime?i:r,null);return null!=t?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){const r="start"==t?this._onStartFns:this._onDoneFns;r.forEach(i=>i()),r.length=0}}const DO=["toast-component",""];function WJ(e,t){if(1&e){const r=Vs();Le(0,"button",5),kn("click",function(){return ci(r),li(It().remove())}),Le(1,"span",6),at(2,"\xd7"),Qe()()}}function ZJ(e,t){if(1&e&&(ha(0),at(1),pa()),2&e){const r=It(2);Ie(),Fr("[",r.duplicatesCount+1,"]")}}function KJ(e,t){if(1&e&&(Le(0,"div"),at(1),Hn(2,ZJ,2,1,"ng-container",4),Qe()),2&e){const r=It();gi(r.options.titleClass),kr("aria-label",r.title),Ie(),Fr(" ",r.title," "),Ie(),Ke("ngIf",r.duplicatesCount)}}function QJ(e,t){if(1&e&&mi(0,"div",7),2&e){const r=It();gi(r.options.messageClass),Ke("innerHTML",r.message,xm)}}function YJ(e,t){if(1&e&&(Le(0,"div",8),at(1),Qe()),2&e){const r=It();gi(r.options.messageClass),kr("aria-label",r.message),Ie(),Fr(" ",r.message," ")}}function JJ(e,t){if(1&e&&(Le(0,"div"),mi(1,"div",9),Qe()),2&e){const r=It();Ie(),fa("width",r.width()+"%")}}class sX{_attachedHost;component;viewContainerRef;injector;constructor(t,r){this.component=t,this.injector=r}attach(t,r){return this._attachedHost=t,t.attach(this,r)}detach(){const t=this._attachedHost;if(t)return this._attachedHost=void 0,t.detach()}get isAttached(){return null!=this._attachedHost}setAttachedHost(t){this._attachedHost=t}}class oX{_attachedPortal;_disposeFn;attach(t,r){return this._attachedPortal=t,this.attachComponentPortal(t,r)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(t){this._disposeFn=t}}class aX{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new ot;_activate=new ot;_manualClose=new ot;_resetTimeout=new ot;_countDuplicate=new ot;constructor(t){this._overlayRef=t}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(t,r){t&&this._resetTimeout.next(),r&&this._countDuplicate.next(++this.duplicatesCount)}}class Np{toastId;config;message;title;toastType;toastRef;_onTap=new ot;_onAction=new ot;constructor(t,r,i,s,o,a){this.toastId=t,this.config=r,this.message=i,this.title=s,this.toastType=o,this.toastRef=a,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(t){this._onAction.next(t)}onAction(){return this._onAction.asObservable()}}const SO=new K("ToastConfig");class cX extends oX{_hostDomElement;_componentFactoryResolver;_appRef;constructor(t,r,i){super(),this._hostDomElement=t,this._componentFactoryResolver=r,this._appRef=i}attachComponentPortal(t,r){const i=this._componentFactoryResolver.resolveComponentFactory(t.component);let s;return s=i.create(t.injector),this._appRef.attachView(s.hostView),this.setDisposeFn(()=>{this._appRef.detachView(s.hostView),s.destroy()}),r?this._hostDomElement.insertBefore(this._getComponentRootNode(s),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(s)),s}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}let lX=(()=>{class e{_document=P(Wt);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const r=this._document.createElement("div");r.classList.add("overlay-container"),r.setAttribute("aria-live","polite"),this._document.body.appendChild(r),this._containerElement=r}static \u0275fac=function(i){return new(i||e)};static \u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();class uX{_portalHost;constructor(t){this._portalHost=t}attach(t,r=!0){return this._portalHost.attach(t,r)}detach(){return this._portalHost.detach()}}let dX=(()=>{class e{_overlayContainer=P(lX);_componentFactoryResolver=P(sl);_appRef=P(Br);_document=P(Wt);_paneElements=new Map;create(r,i){return this._createOverlayRef(this.getPaneElement(r,i))}getPaneElement(r="",i){return this._paneElements.get(i)||this._paneElements.set(i,{}),this._paneElements.get(i)[r]||(this._paneElements.get(i)[r]=this._createPaneElement(r,i)),this._paneElements.get(i)[r]}_createPaneElement(r,i){const s=this._document.createElement("div");return s.id="toast-container",s.classList.add(r),s.classList.add("toast-container"),i?i.getContainerElement().appendChild(s):this._overlayContainer.getContainerElement().appendChild(s),s}_createPortalHost(r){return new cX(r,this._componentFactoryResolver,this._appRef)}_createOverlayRef(r){return new uX(this._createPortalHost(r))}static \u0275fac=function(i){return new(i||e)};static \u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),X_=(()=>{class e{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(r,i,s,o,a){this.overlay=i,this._injector=s,this.sanitizer=o,this.ngZone=a,this.toastrConfig={...r.default,...r.config},r.config.iconClasses&&(this.toastrConfig.iconClasses={...r.default.iconClasses,...r.config.iconClasses})}show(r,i,s={},o=""){return this._preBuildNotification(o,r,i,this.applyConfig(s))}success(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.success||"",r,i,this.applyConfig(s))}error(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.error||"",r,i,this.applyConfig(s))}info(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.info||"",r,i,this.applyConfig(s))}warning(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.warning||"",r,i,this.applyConfig(s))}clear(r){for(const i of this.toasts)if(void 0!==r){if(i.toastId===r)return void i.toastRef.manualClose()}else i.toastRef.manualClose()}remove(r){const i=this._findToast(r);if(!i||(i.activeToast.toastRef.close(),this.toasts.splice(i.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActivethis._buildNotification(r,i,s,o)):this._buildNotification(r,i,s,o)}_buildNotification(r,i,s,o){if(!o.toastComponent)throw new Error("toastComponent required");const a=this.findDuplicate(s,i,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&s||i)&&this.toastrConfig.preventDuplicates&&null!==a)return a;this.previousToastMessage=i;let c=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(c=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));const l=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let u=i;i&&o.enableHtml&&(u=this.sanitizer.sanitize(Nn.HTML,i));const d=new aX(l),f=new Np(this.index,o,u,s,r,d),p=qt.create({providers:[{provide:Np,useValue:f}],parent:this._injector}),g=new sX(o.toastComponent,p),m=l.attach(g,o.newestOnTop);d.componentInstance=m.instance;const y={toastId:this.index,title:s||"",message:i||"",toastRef:d,onShown:d.afterActivate(),onHidden:d.afterClosed(),onTap:f.onTap(),onAction:f.onAction(),portal:m};return c||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{y.toastRef.activate()})),this.toasts.push(y),y}static \u0275fac=function(i){return new(i||e)(G(SO),G(dX),G(qt),G(bA),G(Ne))};static \u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const fX={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing",toastComponent:(()=>{class e{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=ul(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if("inactive"===this.state().value)return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(r,i,s){this.toastrService=r,this.toastPackage=i,this.ngZone=s,this.message=i.message,this.title=i.title,this.options=i.config,this.originalTimeout=i.config.timeOut,this.toastClasses=`${i.toastType} ${i.config.toastClass}`,this.sub=i.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=i.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=i.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=i.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state=ul({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(r=>({...r,value:"active"})),!0!==this.options.disableTimeOut&&"timeOut"!==this.options.disableTimeOut&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(0===this.width()||100===this.width()||!this.options.timeOut)return;const r=(new Date).getTime();this.width.set((this.hideTime-r)/this.options.timeOut*100),"increasing"===this.options.progressAnimation&&this.width.update(s=>100-s),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(r=>({...r,value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){"removed"!==this.state().value&&(clearTimeout(this.timeout),this.state.update(r=>({...r,value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){"removed"!==this.state().value&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){"removed"!==this.state().value&&"extendedTimeOut"!==this.options.disableTimeOut&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){!0===this.options.disableTimeOut||"extendedTimeOut"===this.options.disableTimeOut||0===this.options.extendedTimeOut||"removed"===this.state().value||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(r,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(r),i)):this.timeout=setTimeout(()=>r(),i)}outsideInterval(r,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(r),i)):this.intervalId=setInterval(()=>r(),i)}runInsideAngular(r){this.ngZone?this.ngZone.run(()=>r()):r()}static \u0275fac=function(i){return new(i||e)(X(X_),X(Np),X(Ne))};static \u0275cmp=So({type:e,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(i,s){1&i&&kn("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),2&i&&(qy("@flyInOut",s._state),gi(s.toastClasses),fa("display",s.displayStyle))},standalone:!0,features:[Mf],attrs:DO,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(i,s){1&i&&Hn(0,WJ,3,0,"button",0)(1,KJ,3,5,"div",1)(2,QJ,1,3,"div",2)(3,YJ,2,4,"div",3)(4,JJ,2,2,"div",4),2&i&&(Ke("ngIf",s.options.closeButton),Ie(),Ke("ngIf",s.title),Ie(),Ke("ngIf",s.message&&s.options.enableHtml),Ie(),Ke("ngIf",s.message&&!s.options.enableHtml),Ie(),Ke("ngIf",s.options.progressBar))},dependencies:[sh],encapsulation:2,data:{animation:[$J("flyInOut",[Y_("inactive",Pu({opacity:0})),Y_("active",Pu({opacity:1})),Y_("removed",Pu({opacity:0})),bO("inactive => active",_O("{{ easeTime }}ms {{ easing }}")),bO("active => removed",_O("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return e})()},hX=(e={})=>function Dc(e){return{\u0275providers:e}}([{provide:SO,useValue:{default:fX,config:e}}]);let pX=(()=>{class e{static forRoot(r={}){return{ngModule:e,providers:[hX(r)]}}static \u0275fac=function(i){return new(i||e)};static \u0275mod=pn({type:e});static \u0275inj=Jt({})}return e})(),gX=(()=>{class e{constructor(r,i){this.error$=r,this.toastrService=i,this.subscriptions=new Rt}ngOnInit(){this.subscriptions.add(this.error$.subscribe(r=>this.toastrService.error(r)))}ngOnDestroy(){this.subscriptions.unsubscribe()}static#e=this.\u0275fac=function(i){return new(i||e)(X(Q_),X(X_))};static#t=this.\u0275cmp=So({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(i,s){1&i&&mi(0,"router-outlet")},dependencies:[F_],encapsulation:2})}return e})(),mX=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({imports:[Ea]})}return e})(),yX=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({providers:[m_,fp],imports:[Ea]})}return e})();function IO(e){return new M(3e3,!1)}function bs(e){switch(e.length){case 0:return new Lu;case 1:return e[0];default:return new EO(e)}}function TO(e,t,r=new Map,i=new Map){const s=[],o=[];let a=-1,c=null;if(t.forEach(l=>{const u=l.get("offset"),d=u==a,f=d&&c||new Map;l.forEach((h,p)=>{let g=p,m=h;if("offset"!==p)switch(g=e.normalizePropertyName(g,s),m){case"!":m=r.get(p);break;case Pi:m=i.get(p);break;default:m=e.normalizeStyleValue(p,g,m,s)}f.set(g,m)}),d||o.push(f),c=f,a=u}),s.length)throw function jX(e){return new M(3502,!1)}();return o}function eb(e,t,r,i){switch(t){case"start":e.onStart(()=>i(r&&tb(r,"start",e)));break;case"done":e.onDone(()=>i(r&&tb(r,"done",e)));break;case"destroy":e.onDestroy(()=>i(r&&tb(r,"destroy",e)))}}function tb(e,t,r){const o=nb(e.element,e.triggerName,e.fromState,e.toState,t||e.phaseName,r.totalTime??e.totalTime,!!r.disabled),a=e._data;return null!=a&&(o._data=a),o}function nb(e,t,r,i,s="",o=0,a){return{element:e,triggerName:t,fromState:r,toState:i,phaseName:s,totalTime:o,disabled:!!a}}function Bn(e,t,r){let i=e.get(t);return i||e.set(t,i=r),i}function xO(e){const t=e.indexOf(":");return[e.substring(1,t),e.slice(t+1)]}const JX=typeof document>"u"?null:document.documentElement;function rb(e){const t=e.parentNode||e.host||null;return t===JX?null:t}let fo=null,AO=!1;function MO(e,t){for(;t;){if(t===e)return!0;t=rb(t)}return!1}function NO(e,t,r){if(r)return Array.from(e.querySelectorAll(t));const i=e.querySelector(t);return i?[i]:[]}let ib=(()=>{class e{validateStyleProperty(r){return function eee(e){fo||(fo=function tee(){return typeof document<"u"?document.body:null}()||{},AO=!!fo.style&&"WebkitAppearance"in fo.style);let t=!0;return fo.style&&!function XX(e){return"ebkit"==e.substring(1,6)}(e)&&(t=e in fo.style,!t&&AO&&(t="Webkit"+e.charAt(0).toUpperCase()+e.slice(1)in fo.style)),t}(r)}matchesElement(r,i){return!1}containsElement(r,i){return MO(r,i)}getParentElement(r){return rb(r)}query(r,i,s){return NO(r,i,s)}computeStyle(r,i,s){return s||""}animate(r,i,s,o,a,c=[],l){return new Lu(s,o)}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();class sb{static#e=this.NOOP=new ib}class ob{}const ree=1e3,ab="ng-enter",Rp="ng-leave",Op="ng-trigger",kp=".ng-trigger",OO="ng-animating",cb=".ng-animating";function Li(e){if("number"==typeof e)return e;const t=e.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:lb(parseFloat(t[1]),t[2])}function lb(e,t){return"s"===t?e*ree:e}function Pp(e,t,r){return e.hasOwnProperty("duration")?e:function see(e,t,r){let s,o=0,a="";if("string"==typeof e){const c=e.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===c)return t.push(IO()),{duration:0,delay:0,easing:""};s=lb(parseFloat(c[1]),c[2]);const l=c[3];null!=l&&(o=lb(parseFloat(l),c[4]));const u=c[5];u&&(a=u)}else s=e;if(!r){let c=!1,l=t.length;s<0&&(t.push(function vX(){return new M(3100,!1)}()),c=!0),o<0&&(t.push(function wX(){return new M(3101,!1)}()),c=!0),c&&t.splice(l,0,IO())}return{duration:s,delay:o,easing:a}}(e,t,r)}function ri(e,t,r){t.forEach((i,s)=>{const o=db(s);r&&!r.has(s)&&r.set(s,e.style[o]),e.style[o]=i})}function ho(e,t){t.forEach((r,i)=>{const s=db(i);e.style[s]=""})}function Fu(e){return Array.isArray(e)?1==e.length?e[0]:function VJ(e,t=null){return{type:ce.Sequence,steps:e,options:t}}(e):e}const ub=new RegExp("{{\\s*(.+?)\\s*}}","g");function PO(e){let t=[];if("string"==typeof e){let r;for(;r=ub.exec(e);)t.push(r[1]);ub.lastIndex=0}return t}function Bu(e,t,r){const i=`${e}`,s=i.replace(ub,(o,a)=>{let c=t[a];return null==c&&(r.push(function bX(e){return new M(3003,!1)}()),c=""),c.toString()});return s==i?e:s}const cee=/-+([a-z0-9])/g;function db(e){return e.replace(cee,(...t)=>t[1].toUpperCase())}function Un(e,t,r){switch(t.type){case ce.Trigger:return e.visitTrigger(t,r);case ce.State:return e.visitState(t,r);case ce.Transition:return e.visitTransition(t,r);case ce.Sequence:return e.visitSequence(t,r);case ce.Group:return e.visitGroup(t,r);case ce.Animate:return e.visitAnimate(t,r);case ce.Keyframes:return e.visitKeyframes(t,r);case ce.Style:return e.visitStyle(t,r);case ce.Reference:return e.visitReference(t,r);case ce.AnimateChild:return e.visitAnimateChild(t,r);case ce.AnimateRef:return e.visitAnimateRef(t,r);case ce.Query:return e.visitQuery(t,r);case ce.Stagger:return e.visitStagger(t,r);default:throw function EX(e){return new M(3004,!1)}()}}function fb(e,t){return window.getComputedStyle(e)[t]}const dee=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]);class LO extends ob{normalizePropertyName(t,r){return db(t)}normalizeStyleValue(t,r,i,s){let o="";const a=i.toString().trim();if(dee.has(r)&&0!==i&&"0"!==i)if("number"==typeof i)o="px";else{const c=i.match(/^[+-]?[\d\.]+([a-z]*)$/);c&&0==c[1].length&&s.push(function DX(e,t){return new M(3005,!1)}())}return a+o}}const Lp="*";const Fp=new Set(["true","1"]),Bp=new Set(["false","0"]);function FO(e,t){const r=Fp.has(e)||Bp.has(e),i=Fp.has(t)||Bp.has(t);return(s,o)=>{let a=e==Lp||e==s,c=t==Lp||t==o;return!a&&r&&"boolean"==typeof s&&(a=s?Fp.has(e):Bp.has(e)),!c&&i&&"boolean"==typeof o&&(c=o?Fp.has(t):Bp.has(t)),a&&c}}const gee=new RegExp("s*:selfs*,?","g");function hb(e,t,r,i){return new mee(e).build(t,r,i)}class mee{constructor(t){this._driver=t}build(t,r,i){const s=new wee(r);return this._resetContextStyleTimingState(s),Un(this,Fu(t),s)}_resetContextStyleTimingState(t){t.currentQuerySelector="",t.collectedStyles=new Map,t.collectedStyles.set("",new Map),t.currentTime=0}visitTrigger(t,r){let i=r.queryCount=0,s=r.depCount=0;const o=[],a=[];return"@"==t.name.charAt(0)&&r.errors.push(function CX(){return new M(3006,!1)}()),t.definitions.forEach(c=>{if(this._resetContextStyleTimingState(r),c.type==ce.State){const l=c,u=l.name;u.toString().split(/\s*,\s*/).forEach(d=>{l.name=d,o.push(this.visitState(l,r))}),l.name=u}else if(c.type==ce.Transition){const l=this.visitTransition(c,r);i+=l.queryCount,s+=l.depCount,a.push(l)}else r.errors.push(function SX(){return new M(3007,!1)}())}),{type:ce.Trigger,name:t.name,states:o,transitions:a,queryCount:i,depCount:s,options:null}}visitState(t,r){const i=this.visitStyle(t.styles,r),s=t.options&&t.options.params||null;if(i.containsDynamicStyles){const o=new Set,a=s||{};i.styles.forEach(c=>{c instanceof Map&&c.forEach(l=>{PO(l).forEach(u=>{a.hasOwnProperty(u)||o.add(u)})})}),o.size&&r.errors.push(function IX(e,t){return new M(3008,!1)}(0,o.values()))}return{type:ce.State,name:t.name,style:i,options:s?{params:s}:null}}visitTransition(t,r){r.queryCount=0,r.depCount=0;const i=Un(this,Fu(t.animation),r),s=function fee(e,t){const r=[];return"string"==typeof e?e.split(/\s*,\s*/).forEach(i=>function hee(e,t,r){if(":"==e[0]){const l=function pee(e,t){switch(e){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(r,i)=>parseFloat(i)>parseFloat(r);case":decrement":return(r,i)=>parseFloat(i) *"}}(e,r);if("function"==typeof l)return void t.push(l);e=l}const i=e.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return r.push(function PX(e){return new M(3015,!1)}()),t;const s=i[1],o=i[2],a=i[3];t.push(FO(s,a)),"<"==o[0]&&(s!=Lp||a!=Lp)&&t.push(FO(a,s))}(i,r,t)):r.push(e),r}(t.expr,r.errors);return{type:ce.Transition,matchers:s,animation:i,queryCount:r.queryCount,depCount:r.depCount,options:po(t.options)}}visitSequence(t,r){return{type:ce.Sequence,steps:t.steps.map(i=>Un(this,i,r)),options:po(t.options)}}visitGroup(t,r){const i=r.currentTime;let s=0;const o=t.steps.map(a=>{r.currentTime=i;const c=Un(this,a,r);return s=Math.max(s,r.currentTime),c});return r.currentTime=s,{type:ce.Group,steps:o,options:po(t.options)}}visitAnimate(t,r){const i=function bee(e,t){if(e.hasOwnProperty("duration"))return e;if("number"==typeof e)return pb(Pp(e,t).duration,0,"");const r=e;if(r.split(/\s+/).some(o=>"{"==o.charAt(0)&&"{"==o.charAt(1))){const o=pb(0,0,"");return o.dynamic=!0,o.strValue=r,o}const s=Pp(r,t);return pb(s.duration,s.delay,s.easing)}(t.timings,r.errors);r.currentAnimateTimings=i;let s,o=t.styles?t.styles:Pu({});if(o.type==ce.Keyframes)s=this.visitKeyframes(o,r);else{let a=t.styles,c=!1;if(!a){c=!0;const u={};i.easing&&(u.easing=i.easing),a=Pu(u)}r.currentTime+=i.duration+i.delay;const l=this.visitStyle(a,r);l.isEmptyStep=c,s=l}return r.currentAnimateTimings=null,{type:ce.Animate,timings:i,style:s,options:null}}visitStyle(t,r){const i=this._makeStyleAst(t,r);return this._validateStyleAst(i,r),i}_makeStyleAst(t,r){const i=[],s=Array.isArray(t.styles)?t.styles:[t.styles];for(let c of s)"string"==typeof c?c===Pi?i.push(c):r.errors.push(new M(3002,!1)):i.push(new Map(Object.entries(c)));let o=!1,a=null;return i.forEach(c=>{if(c instanceof Map&&(c.has("easing")&&(a=c.get("easing"),c.delete("easing")),!o))for(let l of c.values())if(l.toString().indexOf("{{")>=0){o=!0;break}}),{type:ce.Style,styles:i,easing:a,offset:t.offset,containsDynamicStyles:o,options:null}}_validateStyleAst(t,r){const i=r.currentAnimateTimings;let s=r.currentTime,o=r.currentTime;i&&o>0&&(o-=i.duration+i.delay),t.styles.forEach(a=>{"string"!=typeof a&&a.forEach((c,l)=>{const u=r.collectedStyles.get(r.currentQuerySelector),d=u.get(l);let f=!0;d&&(o!=s&&o>=d.startTime&&s<=d.endTime&&(r.errors.push(function xX(e,t,r,i,s){return new M(3010,!1)}()),f=!1),o=d.startTime),f&&u.set(l,{startTime:o,endTime:s}),r.options&&function aee(e,t,r){const i=t.params||{},s=PO(e);s.length&&s.forEach(o=>{i.hasOwnProperty(o)||r.push(function _X(e){return new M(3001,!1)}())})}(c,r.options,r.errors)})})}visitKeyframes(t,r){const i={type:ce.Keyframes,styles:[],options:null};if(!r.currentAnimateTimings)return r.errors.push(function AX(){return new M(3011,!1)}()),i;let o=0;const a=[];let c=!1,l=!1,u=0;const d=t.steps.map(v=>{const w=this._makeStyleAst(v,r);let _=null!=w.offset?w.offset:function _ee(e){if("string"==typeof e)return null;let t=null;if(Array.isArray(e))e.forEach(r=>{if(r instanceof Map&&r.has("offset")){const i=r;t=parseFloat(i.get("offset")),i.delete("offset")}});else if(e instanceof Map&&e.has("offset")){const r=e;t=parseFloat(r.get("offset")),r.delete("offset")}return t}(w.styles),b=0;return null!=_&&(o++,b=w.offset=_),l=l||b<0||b>1,c=c||b0&&o{const _=h>0?w==p?1:h*w:a[w],b=_*y;r.currentTime=g+m.delay+b,m.duration=b,this._validateStyleAst(v,r),v.offset=_,i.styles.push(v)}),i}visitReference(t,r){return{type:ce.Reference,animation:Un(this,Fu(t.animation),r),options:po(t.options)}}visitAnimateChild(t,r){return r.depCount++,{type:ce.AnimateChild,options:po(t.options)}}visitAnimateRef(t,r){return{type:ce.AnimateRef,animation:this.visitReference(t.animation,r),options:po(t.options)}}visitQuery(t,r){const i=r.currentQuerySelector,s=t.options||{};r.queryCount++,r.currentQuery=t;const[o,a]=function yee(e){const t=!!e.split(/\s*,\s*/).find(r=>":self"==r);return t&&(e=e.replace(gee,"")),e=e.replace(/@\*/g,kp).replace(/@\w+/g,r=>kp+"-"+r.slice(1)).replace(/:animating/g,cb),[e,t]}(t.selector);r.currentQuerySelector=i.length?i+" "+o:o,Bn(r.collectedStyles,r.currentQuerySelector,new Map);const c=Un(this,Fu(t.animation),r);return r.currentQuery=null,r.currentQuerySelector=i,{type:ce.Query,selector:o,limit:s.limit||0,optional:!!s.optional,includeSelf:a,animation:c,originalSelector:t.selector,options:po(t.options)}}visitStagger(t,r){r.currentQuery||r.errors.push(function OX(){return new M(3013,!1)}());const i="full"===t.timings?{duration:0,delay:0,easing:"full"}:Pp(t.timings,r.errors,!0);return{type:ce.Stagger,animation:Un(this,Fu(t.animation),r),timings:i,options:null}}}class wee{constructor(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles=new Map,this.options=null,this.unsupportedCSSPropertiesFound=new Set}}function po(e){return e?(e={...e}).params&&(e.params=function vee(e){return e?{...e}:null}(e.params)):e={},e}function pb(e,t,r){return{duration:e,delay:t,easing:r}}function gb(e,t,r,i,s,o,a=null,c=!1){return{type:1,element:e,keyframes:t,preStyleProps:r,postStyleProps:i,duration:s,delay:o,totalTime:s+o,easing:a,subTimeline:c}}class Up{constructor(){this._map=new Map}get(t){return this._map.get(t)||[]}append(t,r){let i=this._map.get(t);i||this._map.set(t,i=[]),i.push(...r)}has(t){return this._map.has(t)}clear(){this._map.clear()}}const Cee=new RegExp(":enter","g"),Iee=new RegExp(":leave","g");function mb(e,t,r,i,s,o=new Map,a=new Map,c,l,u=[]){return(new Tee).buildKeyframes(e,t,r,i,s,o,a,c,l,u)}class Tee{buildKeyframes(t,r,i,s,o,a,c,l,u,d=[]){u=u||new Up;const f=new yb(t,r,u,s,o,d,[]);f.options=l;const h=l.delay?Li(l.delay):0;f.currentTimeline.delayNextStep(h),f.currentTimeline.setStyles([a],null,f.errors,l),Un(this,i,f);const p=f.timelines.filter(g=>g.containsAnimation());if(p.length&&c.size){let g;for(let m=p.length-1;m>=0;m--){const y=p[m];if(y.element===r){g=y;break}}g&&!g.allowOnlyTimelineStyles()&&g.setStyles([c],null,f.errors,l)}return p.length?p.map(g=>g.buildKeyframes()):[gb(r,[],[],[],0,h,"",!1)]}visitTrigger(t,r){}visitState(t,r){}visitTransition(t,r){}visitAnimateChild(t,r){const i=r.subInstructions.get(r.element);if(i){const s=r.createSubContext(t.options),o=r.currentTimeline.currentTime,a=this._visitSubInstructions(i,s,s.options);o!=a&&r.transformIntoNewTimeline(a)}r.previousNode=t}visitAnimateRef(t,r){const i=r.createSubContext(t.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([t.options,t.animation.options],r,i),this.visitReference(t.animation,i),r.transformIntoNewTimeline(i.currentTimeline.currentTime),r.previousNode=t}_applyAnimationRefDelays(t,r,i){for(const s of t){const o=s?.delay;if(o){const a="number"==typeof o?o:Li(Bu(o,s?.params??{},r.errors));i.delayNextStep(a)}}}_visitSubInstructions(t,r,i){let o=r.currentTimeline.currentTime;const a=null!=i.duration?Li(i.duration):null,c=null!=i.delay?Li(i.delay):null;return 0!==a&&t.forEach(l=>{const u=r.appendInstructionToTimeline(l,a,c);o=Math.max(o,u.duration+u.delay)}),o}visitReference(t,r){r.updateOptions(t.options,!0),Un(this,t.animation,r),r.previousNode=t}visitSequence(t,r){const i=r.subContextCount;let s=r;const o=t.options;if(o&&(o.params||o.delay)&&(s=r.createSubContext(o),s.transformIntoNewTimeline(),null!=o.delay)){s.previousNode.type==ce.Style&&(s.currentTimeline.snapshotCurrentStyles(),s.previousNode=jp);const a=Li(o.delay);s.delayNextStep(a)}t.steps.length&&(t.steps.forEach(a=>Un(this,a,s)),s.currentTimeline.applyStylesToKeyframe(),s.subContextCount>i&&s.transformIntoNewTimeline()),r.previousNode=t}visitGroup(t,r){const i=[];let s=r.currentTimeline.currentTime;const o=t.options&&t.options.delay?Li(t.options.delay):0;t.steps.forEach(a=>{const c=r.createSubContext(t.options);o&&c.delayNextStep(o),Un(this,a,c),s=Math.max(s,c.currentTimeline.currentTime),i.push(c.currentTimeline)}),i.forEach(a=>r.currentTimeline.mergeTimelineCollectedStyles(a)),r.transformIntoNewTimeline(s),r.previousNode=t}_visitTiming(t,r){if(t.dynamic){const i=t.strValue;return Pp(r.params?Bu(i,r.params,r.errors):i,r.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,r){const i=r.currentAnimateTimings=this._visitTiming(t.timings,r),s=r.currentTimeline;i.delay&&(r.incrementTime(i.delay),s.snapshotCurrentStyles());const o=t.style;o.type==ce.Keyframes?this.visitKeyframes(o,r):(r.incrementTime(i.duration),this.visitStyle(o,r),s.applyStylesToKeyframe()),r.currentAnimateTimings=null,r.previousNode=t}visitStyle(t,r){const i=r.currentTimeline,s=r.currentAnimateTimings;!s&&i.hasCurrentStyleProperties()&&i.forwardFrame();const o=s&&s.easing||t.easing;t.isEmptyStep?i.applyEmptyStep(o):i.setStyles(t.styles,o,r.errors,r.options),r.previousNode=t}visitKeyframes(t,r){const i=r.currentAnimateTimings,s=r.currentTimeline.duration,o=i.duration,c=r.createSubContext().currentTimeline;c.easing=i.easing,t.styles.forEach(l=>{c.forwardTime((l.offset||0)*o),c.setStyles(l.styles,l.easing,r.errors,r.options),c.applyStylesToKeyframe()}),r.currentTimeline.mergeTimelineCollectedStyles(c),r.transformIntoNewTimeline(s+o),r.previousNode=t}visitQuery(t,r){const i=r.currentTimeline.currentTime,s=t.options||{},o=s.delay?Li(s.delay):0;o&&(r.previousNode.type===ce.Style||0==i&&r.currentTimeline.hasCurrentStyleProperties())&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=jp);let a=i;const c=r.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!s.optional,r.errors);r.currentQueryTotal=c.length;let l=null;c.forEach((u,d)=>{r.currentQueryIndex=d;const f=r.createSubContext(t.options,u);o&&f.delayNextStep(o),u===r.element&&(l=f.currentTimeline),Un(this,t.animation,f),f.currentTimeline.applyStylesToKeyframe(),a=Math.max(a,f.currentTimeline.currentTime)}),r.currentQueryIndex=0,r.currentQueryTotal=0,r.transformIntoNewTimeline(a),l&&(r.currentTimeline.mergeTimelineCollectedStyles(l),r.currentTimeline.snapshotCurrentStyles()),r.previousNode=t}visitStagger(t,r){const i=r.parentContext,s=r.currentTimeline,o=t.timings,a=Math.abs(o.duration),c=a*(r.currentQueryTotal-1);let l=a*r.currentQueryIndex;switch(o.duration<0?"reverse":o.easing){case"reverse":l=c-l;break;case"full":l=i.currentStaggerTime}const d=r.currentTimeline;l&&d.delayNextStep(l);const f=d.currentTime;Un(this,t.animation,r),r.previousNode=t,i.currentStaggerTime=s.currentTime-f+(s.startTime-i.currentTimeline.startTime)}}const jp={};class yb{constructor(t,r,i,s,o,a,c,l){this._driver=t,this.element=r,this.subInstructions=i,this._enterClassName=s,this._leaveClassName=o,this.errors=a,this.timelines=c,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=jp,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new $p(this._driver,r,0),c.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,r){if(!t)return;const i=t;let s=this.options;null!=i.duration&&(s.duration=Li(i.duration)),null!=i.delay&&(s.delay=Li(i.delay));const o=i.params;if(o){let a=s.params;a||(a=this.options.params={}),Object.keys(o).forEach(c=>{(!r||!a.hasOwnProperty(c))&&(a[c]=Bu(o[c],a,this.errors))})}}_copyOptions(){const t={};if(this.options){const r=this.options.params;if(r){const i=t.params={};Object.keys(r).forEach(s=>{i[s]=r[s]})}}return t}createSubContext(t=null,r,i){const s=r||this.element,o=new yb(this._driver,s,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(s,i||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(t),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o}transformIntoNewTimeline(t){return this.previousNode=jp,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,r,i){const s={duration:r??t.duration,delay:this.currentTimeline.currentTime+(i??0)+t.delay,easing:""},o=new xee(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,s,t.stretchStartingKeyframe);return this.timelines.push(o),s}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,r,i,s,o,a){let c=[];if(s&&c.push(this.element),t.length>0){t=(t=t.replace(Cee,"."+this._enterClassName)).replace(Iee,"."+this._leaveClassName);let u=this._driver.query(this.element,t,1!=i);0!==i&&(u=i<0?u.slice(u.length+i,u.length):u.slice(0,i)),c.push(...u)}return!o&&0==c.length&&a.push(function kX(e){return new M(3014,!1)}()),c}}class $p{constructor(t,r,i,s){this._driver=t,this.element=r,this.startTime=i,this._elementTimelineStylesLookup=s,this.duration=0,this.easing=null,this._previousKeyframe=new Map,this._currentKeyframe=new Map,this._keyframes=new Map,this._styleSummary=new Map,this._localTimelineStyles=new Map,this._pendingStyles=new Map,this._backFill=new Map,this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(r),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(r,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(t){const r=1===this._keyframes.size&&this._pendingStyles.size;this.duration||r?(this.forwardTime(this.currentTime+t),r&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,r){return this.applyStylesToKeyframe(),new $p(this._driver,t,r||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,r){this._localTimelineStyles.set(t,r),this._globalTimelineStyles.set(t,r),this._styleSummary.set(t,{time:this.currentTime,value:r})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&this._previousKeyframe.set("easing",t);for(let[r,i]of this._globalTimelineStyles)this._backFill.set(r,i||Pi),this._currentKeyframe.set(r,Pi);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,r,i,s){r&&this._previousKeyframe.set("easing",r);const o=s&&s.params||{},a=function Aee(e,t){const r=new Map;let i;return e.forEach(s=>{if("*"===s){i??=t.keys();for(let o of i)r.set(o,Pi)}else for(let[o,a]of s)r.set(o,a)}),r}(t,this._globalTimelineStyles);for(let[c,l]of a){const u=Bu(l,o,i);this._pendingStyles.set(c,u),this._localTimelineStyles.has(c)||this._backFill.set(c,this._globalTimelineStyles.get(c)??Pi),this._updateStyle(c,u)}}applyStylesToKeyframe(){0!=this._pendingStyles.size&&(this._pendingStyles.forEach((t,r)=>{this._currentKeyframe.set(r,t)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((t,r)=>{this._currentKeyframe.has(r)||this._currentKeyframe.set(r,t)}))}snapshotCurrentStyles(){for(let[t,r]of this._localTimelineStyles)this._pendingStyles.set(t,r),this._updateStyle(t,r)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const t=[];for(let r in this._currentKeyframe)t.push(r);return t}mergeTimelineCollectedStyles(t){t._styleSummary.forEach((r,i)=>{const s=this._styleSummary.get(i);(!s||r.time>s.time)&&this._updateStyle(i,r.value)})}buildKeyframes(){this.applyStylesToKeyframe();const t=new Set,r=new Set,i=1===this._keyframes.size&&0===this.duration;let s=[];this._keyframes.forEach((c,l)=>{const u=new Map([...this._backFill,...c]);u.forEach((d,f)=>{"!"===d?t.add(f):d===Pi&&r.add(f)}),i||u.set("offset",l/this.duration),s.push(u)});const o=[...t.values()],a=[...r.values()];if(i){const c=s[0],l=new Map(c);c.set("offset",0),l.set("offset",1),s=[c,l]}return gb(this.element,s,o,a,this.duration,this.startTime,this.easing,!1)}}class xee extends $p{constructor(t,r,i,s,o,a,c=!1){super(t,r,a.delay),this.keyframes=i,this.preStyleProps=s,this.postStyleProps=o,this._stretchStartingKeyframe=c,this.timings={duration:a.duration,delay:a.delay,easing:a.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:r,duration:i,easing:s}=this.timings;if(this._stretchStartingKeyframe&&r){const o=[],a=i+r,c=r/a,l=new Map(t[0]);l.set("offset",0),o.push(l);const u=new Map(t[0]);u.set("offset",jO(c)),o.push(u);const d=t.length-1;for(let f=1;f<=d;f++){let h=new Map(t[f]);const p=h.get("offset");h.set("offset",jO((r+p*i)/a)),o.push(h)}i=a,r=0,s="",t=o}return gb(this.element,t,this.preStyleProps,this.postStyleProps,i,r,s,!0)}}function jO(e,t=3){const r=Math.pow(10,t-1);return Math.round(e*r)/r}function $O(e,t,r,i,s,o,a,c,l,u,d,f,h){return{type:0,element:e,triggerName:t,isRemovalTransition:s,fromState:r,fromStyles:o,toState:i,toStyles:a,timelines:c,queriedElements:l,preStyleProps:u,postStyleProps:d,totalTime:f,errors:h}}const vb={};class VO{constructor(t,r,i){this._triggerName=t,this.ast=r,this._stateStyles=i}match(t,r,i,s){return function Mee(e,t,r,i,s){return e.some(o=>o(t,r,i,s))}(this.ast.matchers,t,r,i,s)}buildStyles(t,r,i){let s=this._stateStyles.get("*");return void 0!==t&&(s=this._stateStyles.get(t?.toString())||s),s?s.buildStyles(r,i):new Map}build(t,r,i,s,o,a,c,l,u,d){const f=[],h=this.ast.options&&this.ast.options.params||vb,g=this.buildStyles(i,c&&c.params||vb,f),m=l&&l.params||vb,y=this.buildStyles(s,m,f),v=new Set,w=new Map,_=new Map,b="void"===s,C={params:HO(m,h),delay:this.ast.options?.delay},D=d?[]:mb(t,r,this.ast.animation,o,a,g,y,C,u,f);let S=0;return D.forEach(T=>{S=Math.max(T.duration+T.delay,S)}),f.length?$O(r,this._triggerName,i,s,b,g,y,[],[],w,_,S,f):(D.forEach(T=>{const O=T.element,U=Bn(w,O,new Set);T.preStyleProps.forEach(j=>U.add(j));const B=Bn(_,O,new Set);T.postStyleProps.forEach(j=>B.add(j)),O!==r&&v.add(O)}),$O(r,this._triggerName,i,s,b,g,y,D,[...v.values()],w,_,S))}}function HO(e,t){const r={...t};return Object.entries(e).forEach(([i,s])=>{null!=s&&(r[i]=s)}),r}class Nee{constructor(t,r,i){this.styles=t,this.defaultParams=r,this.normalizer=i}buildStyles(t,r){const i=new Map,s=HO(t,this.defaultParams);return this.styles.styles.forEach(o=>{"string"!=typeof o&&o.forEach((a,c)=>{a&&(a=Bu(a,s,r));const l=this.normalizer.normalizePropertyName(c,r);a=this.normalizer.normalizeStyleValue(c,l,a,r),i.set(c,a)})}),i}}class Oee{constructor(t,r,i){this.name=t,this.ast=r,this._normalizer=i,this.transitionFactories=[],this.states=new Map,r.states.forEach(s=>{this.states.set(s.name,new Nee(s.style,s.options&&s.options.params||{},i))}),zO(this.states,"true","1"),zO(this.states,"false","0"),r.transitions.forEach(s=>{this.transitionFactories.push(new VO(t,s,this.states))}),this.fallbackTransition=function kee(e,t,r){return new VO(e,{type:ce.Transition,animation:{type:ce.Sequence,steps:[],options:null},matchers:[(a,c)=>!0],options:null,queryCount:0,depCount:0},t)}(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,r,i,s){return this.transitionFactories.find(a=>a.match(t,r,i,s))||null}matchStyles(t,r,i){return this.fallbackTransition.buildStyles(t,r,i)}}function zO(e,t,r){e.has(t)?e.has(r)||e.set(r,e.get(t)):e.has(r)&&e.set(t,e.get(r))}const Pee=new Up;class Lee{constructor(t,r,i){this.bodyNode=t,this._driver=r,this._normalizer=i,this._animations=new Map,this._playersById=new Map,this.players=[]}register(t,r){const i=[],o=hb(this._driver,r,i,[]);if(i.length)throw function $X(e){return new M(3503,!1)}();this._animations.set(t,o)}_buildPlayer(t,r,i){const s=t.element,o=TO(this._normalizer,t.keyframes,r,i);return this._driver.animate(s,o,t.duration,t.delay,t.easing,[],!0)}create(t,r,i={}){const s=[],o=this._animations.get(t);let a;const c=new Map;if(o?(a=mb(this._driver,r,o,ab,Rp,new Map,new Map,i,Pee,s),a.forEach(d=>{const f=Bn(c,d.element,new Map);d.postStyleProps.forEach(h=>f.set(h,null))})):(s.push(function VX(){return new M(3300,!1)}()),a=[]),s.length)throw function HX(e){return new M(3504,!1)}();c.forEach((d,f)=>{d.forEach((h,p)=>{d.set(p,this._driver.computeStyle(f,p,Pi))})});const u=bs(a.map(d=>{const f=c.get(d.element);return this._buildPlayer(d,new Map,f)}));return this._playersById.set(t,u),u.onDestroy(()=>this.destroy(t)),this.players.push(u),u}destroy(t){const r=this._getPlayer(t);r.destroy(),this._playersById.delete(t);const i=this.players.indexOf(r);i>=0&&this.players.splice(i,1)}_getPlayer(t){const r=this._playersById.get(t);if(!r)throw function zX(e){return new M(3301,!1)}();return r}listen(t,r,i,s){const o=nb(r,"","","");return eb(this._getPlayer(t),i,o,s),()=>{}}command(t,r,i,s){if("register"==i)return void this.register(t,s[0]);if("create"==i)return void this.create(t,r,s[0]||{});const o=this._getPlayer(t);switch(i){case"play":o.play();break;case"pause":o.pause();break;case"reset":o.reset();break;case"restart":o.restart();break;case"finish":o.finish();break;case"init":o.init();break;case"setPosition":o.setPosition(parseFloat(s[0]));break;case"destroy":this.destroy(t)}}}const qO="ng-animate-queued",wb="ng-animate-disabled",$ee=[],GO={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Vee={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},_r="__ng_removed";class _b{get params(){return this.options.params}constructor(t,r=""){this.namespaceId=r;const i=t&&t.hasOwnProperty("value");if(this.value=function Gee(e){return e??null}(i?t.value:t),i){const{value:o,...a}=t;this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(t){const r=t.params;if(r){const i=this.options.params;Object.keys(r).forEach(s=>{null==i[s]&&(i[s]=r[s])})}}}const Uu="void",bb=new _b(Uu);class Hee{constructor(t,r,i){this.id=t,this.hostElement=r,this._engine=i,this.players=[],this._triggers=new Map,this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,Yn(r,this._hostClassName)}listen(t,r,i,s){if(!this._triggers.has(r))throw function qX(e,t){return new M(3302,!1)}();if(null==i||0==i.length)throw function GX(e){return new M(3303,!1)}();if(!function Wee(e){return"start"==e||"done"==e}(i))throw function WX(e,t){return new M(3400,!1)}();const o=Bn(this._elementListeners,t,[]),a={name:r,phase:i,callback:s};o.push(a);const c=Bn(this._engine.statesByElement,t,new Map);return c.has(r)||(Yn(t,Op),Yn(t,Op+"-"+r),c.set(r,bb)),()=>{this._engine.afterFlush(()=>{const l=o.indexOf(a);l>=0&&o.splice(l,1),this._triggers.has(r)||c.delete(r)})}}register(t,r){return!this._triggers.has(t)&&(this._triggers.set(t,r),!0)}_getTrigger(t){const r=this._triggers.get(t);if(!r)throw function ZX(e){return new M(3401,!1)}();return r}trigger(t,r,i,s=!0){const o=this._getTrigger(r),a=new Eb(this.id,r,t);let c=this._engine.statesByElement.get(t);c||(Yn(t,Op),Yn(t,Op+"-"+r),this._engine.statesByElement.set(t,c=new Map));let l=c.get(r);const u=new _b(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&u.absorbOptions(l.options),c.set(r,u),l||(l=bb),u.value!==Uu&&l.value===u.value){if(!function Qee(e,t){const r=Object.keys(e),i=Object.keys(t);if(r.length!=i.length)return!1;for(let s=0;s{ho(t,y),ri(t,v)})}return}const h=Bn(this._engine.playersByElement,t,[]);h.forEach(m=>{m.namespaceId==this.id&&m.triggerName==r&&m.queued&&m.destroy()});let p=o.matchTransition(l.value,u.value,t,u.params),g=!1;if(!p){if(!s)return;p=o.fallbackTransition,g=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:r,transition:p,fromState:l,toState:u,player:a,isFallbackTransition:g}),g||(Yn(t,qO),a.onStart(()=>{hc(t,qO)})),a.onDone(()=>{let m=this.players.indexOf(a);m>=0&&this.players.splice(m,1);const y=this._engine.playersByElement.get(t);if(y){let v=y.indexOf(a);v>=0&&y.splice(v,1)}}),this.players.push(a),h.push(a),a}deregister(t){this._triggers.delete(t),this._engine.statesByElement.forEach(r=>r.delete(t)),this._elementListeners.forEach((r,i)=>{this._elementListeners.set(i,r.filter(s=>s.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);const r=this._engine.playersByElement.get(t);r&&(r.forEach(i=>i.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,r){const i=this._engine.driver.query(t,kp,!0);i.forEach(s=>{if(s[_r])return;const o=this._engine.fetchNamespacesByElement(s);o.size?o.forEach(a=>a.triggerLeaveAnimation(s,r,!1,!0)):this.clearElementCache(s)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(s=>this.clearElementCache(s)))}triggerLeaveAnimation(t,r,i,s){const o=this._engine.statesByElement.get(t),a=new Map;if(o){const c=[];if(o.forEach((l,u)=>{if(a.set(u,l.value),this._triggers.has(u)){const d=this.trigger(t,u,Uu,s);d&&c.push(d)}}),c.length)return this._engine.markElementAsRemoved(this.id,t,!0,r,a),i&&bs(c).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){const r=this._elementListeners.get(t),i=this._engine.statesByElement.get(t);if(r&&i){const s=new Set;r.forEach(o=>{const a=o.name;if(s.has(a))return;s.add(a);const l=this._triggers.get(a).fallbackTransition,u=i.get(a)||bb,d=new _b(Uu),f=new Eb(this.id,a,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:a,transition:l,fromState:u,toState:d,player:f,isFallbackTransition:!0})})}}removeNode(t,r){const i=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,r),this.triggerLeaveAnimation(t,r,!0))return;let s=!1;if(i.totalAnimations){const o=i.players.length?i.playersByQueriedElement.get(t):[];if(o&&o.length)s=!0;else{let a=t;for(;a=a.parentNode;)if(i.statesByElement.get(a)){s=!0;break}}}if(this.prepareLeaveAnimationListeners(t),s)i.markElementAsRemoved(this.id,t,!1,r);else{const o=t[_r];(!o||o===GO)&&(i.afterFlush(()=>this.clearElementCache(t)),i.destroyInnerAnimations(t),i._onRemovalComplete(t,r))}}insertNode(t,r){Yn(t,this._hostClassName)}drainQueuedTransitions(t){const r=[];return this._queue.forEach(i=>{const s=i.player;if(s.destroyed)return;const o=i.element,a=this._elementListeners.get(o);a&&a.forEach(c=>{if(c.name==i.triggerName){const l=nb(o,i.triggerName,i.fromState.value,i.toState.value);l._data=t,eb(i.player,c.phase,l,c.callback)}}),s.markedForDestroy?this._engine.afterFlush(()=>{s.destroy()}):r.push(i)}),this._queue=[],r.sort((i,s)=>{const o=i.transition.ast.depCount,a=s.transition.ast.depCount;return 0==o||0==a?o-a:this._engine.driver.containsElement(i.element,s.element)?1:-1})}destroy(t){this.players.forEach(r=>r.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}}class zee{_onRemovalComplete(t,r){this.onRemovalComplete(t,r)}constructor(t,r,i,s){this.bodyNode=t,this.driver=r,this._normalizer=i,this.scheduler=s,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(o,a)=>{}}get queuedPlayers(){const t=[];return this._namespaceList.forEach(r=>{r.players.forEach(i=>{i.queued&&t.push(i)})}),t}createNamespace(t,r){const i=new Hee(t,r,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,r)?this._balanceNamespaceList(i,r):(this.newHostElements.set(r,i),this.collectEnterElement(r)),this._namespaceLookup[t]=i}_balanceNamespaceList(t,r){const i=this._namespaceList,s=this.namespacesByHostElement;if(i.length-1>=0){let a=!1,c=this.driver.getParentElement(r);for(;c;){const l=s.get(c);if(l){const u=i.indexOf(l);i.splice(u+1,0,t),a=!0;break}c=this.driver.getParentElement(c)}a||i.unshift(t)}else i.push(t);return s.set(r,t),t}register(t,r){let i=this._namespaceLookup[t];return i||(i=this.createNamespace(t,r)),i}registerTrigger(t,r,i){let s=this._namespaceLookup[t];s&&s.register(r,i)&&this.totalAnimations++}destroy(t,r){t&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{const i=this._fetchNamespace(t);this.namespacesByHostElement.delete(i.hostElement);const s=this._namespaceList.indexOf(i);s>=0&&this._namespaceList.splice(s,1),i.destroy(r),delete this._namespaceLookup[t]}))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){const r=new Set,i=this.statesByElement.get(t);if(i)for(let s of i.values())if(s.namespaceId){const o=this._fetchNamespace(s.namespaceId);o&&r.add(o)}return r}trigger(t,r,i,s){if(Vp(r)){const o=this._fetchNamespace(t);if(o)return o.trigger(r,i,s),!0}return!1}insertNode(t,r,i,s){if(!Vp(r))return;const o=r[_r];if(o&&o.setForRemoval){o.setForRemoval=!1,o.setForMove=!0;const a=this.collectedLeaveElements.indexOf(r);a>=0&&this.collectedLeaveElements.splice(a,1)}if(t){const a=this._fetchNamespace(t);a&&a.insertNode(r,i)}s&&this.collectEnterElement(r)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,r){r?this.disabledNodes.has(t)||(this.disabledNodes.add(t),Yn(t,wb)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),hc(t,wb))}removeNode(t,r,i){if(Vp(r)){this.scheduler?.notify();const s=t?this._fetchNamespace(t):null;s?s.removeNode(r,i):this.markElementAsRemoved(t,r,!1,i);const o=this.namespacesByHostElement.get(r);o&&o.id!==t&&o.removeNode(r,i)}else this._onRemovalComplete(r,i)}markElementAsRemoved(t,r,i,s,o){this.collectedLeaveElements.push(r),r[_r]={namespaceId:t,setForRemoval:s,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:o}}listen(t,r,i,s,o){return Vp(r)?this._fetchNamespace(t).listen(r,i,s,o):()=>{}}_buildInstruction(t,r,i,s,o){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,i,s,t.fromState.options,t.toState.options,r,o)}destroyInnerAnimations(t){let r=this.driver.query(t,kp,!0);r.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(r=this.driver.query(t,cb,!0),r.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(t){const r=this.playersByElement.get(t);r&&r.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(t){const r=this.playersByQueriedElement.get(t);r&&r.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return bs(this.players).onDone(()=>t());t()})}processLeaveNode(t){const r=t[_r];if(r&&r.setForRemoval){if(t[_r]=GO,r.namespaceId){this.destroyInnerAnimations(t);const i=this._fetchNamespace(r.namespaceId);i&&i.clearElementCache(t)}this._onRemovalComplete(t,r.setForRemoval)}t.classList?.contains(wb)&&this.markElementAsDisabled(t,!1),this.driver.query(t,".ng-animate-disabled",!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(t=-1){let r=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,s)=>this._balanceNamespaceList(i,s)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){const i=this._whenQuietFns;this._whenQuietFns=[],r.length?bs(r).onDone(()=>{i.forEach(s=>s())}):i.forEach(s=>s())}}reportError(t){throw function KX(e){return new M(3402,!1)}()}_flushAnimations(t,r){const i=new Up,s=[],o=new Map,a=[],c=new Map,l=new Map,u=new Map,d=new Set;this.disabledNodes.forEach(E=>{d.add(E);const x=this.driver.query(E,".ng-animate-queued",!0);for(let R=0;R{const R=ab+m++;g.set(x,R),E.forEach(A=>Yn(A,R))});const y=[],v=new Set,w=new Set;for(let E=0;Ev.add(A)):w.add(x))}const _=new Map,b=KO(h,Array.from(v));b.forEach((E,x)=>{const R=Rp+m++;_.set(x,R),E.forEach(A=>Yn(A,R))}),t.push(()=>{p.forEach((E,x)=>{const R=g.get(x);E.forEach(A=>hc(A,R))}),b.forEach((E,x)=>{const R=_.get(x);E.forEach(A=>hc(A,R))}),y.forEach(E=>{this.processLeaveNode(E)})});const C=[],D=[];for(let E=this._namespaceList.length-1;E>=0;E--)this._namespaceList[E].drainQueuedTransitions(r).forEach(R=>{const A=R.player,H=R.element;if(C.push(A),this.collectedEnterElements.length){const Se=H[_r];if(Se&&Se.setForMove){if(Se.previousTriggersValues&&Se.previousTriggersValues.has(R.triggerName)){const tt=Se.previousTriggersValues.get(R.triggerName),Ae=this.statesByElement.get(R.element);if(Ae&&Ae.has(R.triggerName)){const Cn=Ae.get(R.triggerName);Cn.value=tt,Ae.set(R.triggerName,Cn)}}return void A.destroy()}}const Q=!f||!this.driver.containsElement(f,H),J=_.get(H),_e=g.get(H),le=this._buildInstruction(R,i,_e,J,Q);if(le.errors&&le.errors.length)return void D.push(le);if(Q)return A.onStart(()=>ho(H,le.fromStyles)),A.onDestroy(()=>ri(H,le.toStyles)),void s.push(A);if(R.isFallbackTransition)return A.onStart(()=>ho(H,le.fromStyles)),A.onDestroy(()=>ri(H,le.toStyles)),void s.push(A);const lt=[];le.timelines.forEach(Se=>{Se.stretchStartingKeyframe=!0,this.disabledNodes.has(Se.element)||lt.push(Se)}),le.timelines=lt,i.append(H,le.timelines),a.push({instruction:le,player:A,element:H}),le.queriedElements.forEach(Se=>Bn(c,Se,[]).push(A)),le.preStyleProps.forEach((Se,tt)=>{if(Se.size){let Ae=l.get(tt);Ae||l.set(tt,Ae=new Set),Se.forEach((Cn,Bt)=>Ae.add(Bt))}}),le.postStyleProps.forEach((Se,tt)=>{let Ae=u.get(tt);Ae||u.set(tt,Ae=new Set),Se.forEach((Cn,Bt)=>Ae.add(Bt))})});if(D.length){const E=[];D.forEach(x=>{E.push(function QX(e,t){return new M(3505,!1)}())}),C.forEach(x=>x.destroy()),this.reportError(E)}const S=new Map,T=new Map;a.forEach(E=>{const x=E.element;i.has(x)&&(T.set(x,x),this._beforeAnimationBuild(E.player.namespaceId,E.instruction,S))}),s.forEach(E=>{const x=E.element;this._getPreviousPlayers(x,!1,E.namespaceId,E.triggerName,null).forEach(A=>{Bn(S,x,[]).push(A),A.destroy()})});const O=y.filter(E=>YO(E,l,u)),U=new Map;ZO(U,this.driver,w,u,Pi).forEach(E=>{YO(E,l,u)&&O.push(E)});const j=new Map;p.forEach((E,x)=>{ZO(j,this.driver,new Set(E),l,"!")}),O.forEach(E=>{const x=U.get(E),R=j.get(E);U.set(E,new Map([...x?.entries()??[],...R?.entries()??[]]))});const Y=[],k=[],I={};a.forEach(E=>{const{element:x,player:R,instruction:A}=E;if(i.has(x)){if(d.has(x))return R.onDestroy(()=>ri(x,A.toStyles)),R.disabled=!0,R.overrideTotalTime(A.totalTime),void s.push(R);let H=I;if(T.size>1){let J=x;const _e=[];for(;J=J.parentNode;){const le=T.get(J);if(le){H=le;break}_e.push(J)}_e.forEach(le=>T.set(le,H))}const Q=this._buildAnimation(R.namespaceId,A,S,o,j,U);if(R.setRealPlayer(Q),H===I)Y.push(R);else{const J=this.playersByElement.get(H);J&&J.length&&(R.parentPlayer=bs(J)),s.push(R)}}else ho(x,A.fromStyles),R.onDestroy(()=>ri(x,A.toStyles)),k.push(R),d.has(x)&&s.push(R)}),k.forEach(E=>{const x=o.get(E.element);if(x&&x.length){const R=bs(x);E.setRealPlayer(R)}}),s.forEach(E=>{E.parentPlayer?E.syncPlayerEvents(E.parentPlayer):E.destroy()});for(let E=0;E!Q.destroyed);H.length?Zee(this,x,H):this.processLeaveNode(x)}return y.length=0,Y.forEach(E=>{this.players.push(E),E.onDone(()=>{E.destroy();const x=this.players.indexOf(E);this.players.splice(x,1)}),E.play()}),Y}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,r,i,s,o){let a=[];if(r){const c=this.playersByQueriedElement.get(t);c&&(a=c)}else{const c=this.playersByElement.get(t);if(c){const l=!o||o==Uu;c.forEach(u=>{u.queued||!l&&u.triggerName!=s||a.push(u)})}}return(i||s)&&(a=a.filter(c=>!(i&&i!=c.namespaceId||s&&s!=c.triggerName))),a}_beforeAnimationBuild(t,r,i){const o=r.element,a=r.isRemovalTransition?void 0:t,c=r.isRemovalTransition?void 0:r.triggerName;for(const l of r.timelines){const u=l.element,d=u!==o,f=Bn(i,u,[]);this._getPreviousPlayers(u,d,a,c,r.toState).forEach(p=>{const g=p.getRealPlayer();g.beforeDestroy&&g.beforeDestroy(),p.destroy(),f.push(p)})}ho(o,r.fromStyles)}_buildAnimation(t,r,i,s,o,a){const c=r.triggerName,l=r.element,u=[],d=new Set,f=new Set,h=r.timelines.map(g=>{const m=g.element;d.add(m);const y=m[_r];if(y&&y.removedBeforeQueried)return new Lu(g.duration,g.delay);const v=m!==l,w=function Kee(e){const t=[];return QO(e,t),t}((i.get(m)||$ee).map(S=>S.getRealPlayer())).filter(S=>!!S.element&&S.element===m),_=o.get(m),b=a.get(m),C=TO(this._normalizer,g.keyframes,_,b),D=this._buildPlayer(g,C,w);if(g.subTimeline&&s&&f.add(m),v){const S=new Eb(t,c,m);S.setRealPlayer(D),u.push(S)}return D});u.forEach(g=>{Bn(this.playersByQueriedElement,g.element,[]).push(g),g.onDone(()=>function qee(e,t,r){let i=e.get(t);if(i){if(i.length){const s=i.indexOf(r);i.splice(s,1)}0==i.length&&e.delete(t)}return i}(this.playersByQueriedElement,g.element,g))}),d.forEach(g=>Yn(g,OO));const p=bs(h);return p.onDestroy(()=>{d.forEach(g=>hc(g,OO)),ri(l,r.toStyles)}),f.forEach(g=>{Bn(s,g,[]).push(p)}),p}_buildPlayer(t,r,i){return r.length>0?this.driver.animate(t.element,r,t.duration,t.delay,t.easing,i):new Lu(t.duration,t.delay)}}class Eb{constructor(t,r,i){this.namespaceId=t,this.triggerName=r,this.element=i,this._player=new Lu,this._containsRealPlayer=!1,this._queuedCallbacks=new Map,this.destroyed=!1,this.parentPlayer=null,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(t){this._containsRealPlayer||(this._player=t,this._queuedCallbacks.forEach((r,i)=>{r.forEach(s=>eb(t,i,void 0,s))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){const r=this._player;r.triggerCallback&&t.onStart(()=>r.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,r){Bn(this._queuedCallbacks,t,[]).push(r)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){const r=this._player;r.triggerCallback&&r.triggerCallback(t)}}function Vp(e){return e&&1===e.nodeType}function WO(e,t){const r=e.style.display;return e.style.display=t??"none",r}function ZO(e,t,r,i,s){const o=[];r.forEach(l=>o.push(WO(l)));const a=[];i.forEach((l,u)=>{const d=new Map;l.forEach(f=>{const h=t.computeStyle(u,f,s);d.set(f,h),(!h||0==h.length)&&(u[_r]=Vee,a.push(u))}),e.set(u,d)});let c=0;return r.forEach(l=>WO(l,o[c++])),a}function KO(e,t){const r=new Map;if(e.forEach(c=>r.set(c,[])),0==t.length)return r;const s=new Set(t),o=new Map;function a(c){if(!c)return 1;let l=o.get(c);if(l)return l;const u=c.parentNode;return l=r.has(u)?u:s.has(u)?1:a(u),o.set(c,l),l}return t.forEach(c=>{const l=a(c);1!==l&&r.get(l).push(c)}),r}function Yn(e,t){e.classList?.add(t)}function hc(e,t){e.classList?.remove(t)}function Zee(e,t,r){bs(r).onDone(()=>e.processLeaveNode(t))}function QO(e,t){for(let r=0;rs.add(o)):t.set(e,i),r.delete(e),!0}class ju{constructor(t,r,i,s){this._driver=r,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(o,a)=>{},this._transitionEngine=new zee(t.body,r,i,s),this._timelineEngine=new Lee(t.body,r,i),this._transitionEngine.onRemovalComplete=(o,a)=>this.onRemovalComplete(o,a)}registerTrigger(t,r,i,s,o){const a=t+"-"+s;let c=this._triggerCache[a];if(!c){const l=[],d=hb(this._driver,o,l,[]);if(l.length)throw function UX(e,t){return new M(3404,!1)}();c=function Ree(e,t,r){return new Oee(e,t,r)}(s,d,this._normalizer),this._triggerCache[a]=c}this._transitionEngine.registerTrigger(r,s,c)}register(t,r){this._transitionEngine.register(t,r)}destroy(t,r){this._transitionEngine.destroy(t,r)}onInsert(t,r,i,s){this._transitionEngine.insertNode(t,r,i,s)}onRemove(t,r,i){this._transitionEngine.removeNode(t,r,i)}disableAnimations(t,r){this._transitionEngine.markElementAsDisabled(t,r)}process(t,r,i,s){if("@"==i.charAt(0)){const[o,a]=xO(i);this._timelineEngine.command(o,r,a,s)}else this._transitionEngine.trigger(t,r,i,s)}listen(t,r,i,s,o){if("@"==i.charAt(0)){const[a,c]=xO(i);return this._timelineEngine.listen(a,r,c,o)}return this._transitionEngine.listen(t,r,i,s,o)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(t){this._transitionEngine.afterFlushAnimationsDone(t)}}class $u{static#e=this.initialStylesByElement=new WeakMap;constructor(t,r,i){this._element=t,this._startStyles=r,this._endStyles=i,this._state=0;let s=$u.initialStylesByElement.get(t);s||$u.initialStylesByElement.set(t,s=new Map),this._initialStyles=s}start(){this._state<1&&(this._startStyles&&ri(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(ri(this._element,this._initialStyles),this._endStyles&&(ri(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&($u.initialStylesByElement.delete(this._element),this._startStyles&&(ho(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(ho(this._element,this._endStyles),this._endStyles=null),ri(this._element,this._initialStyles),this._state=3)}}function Db(e){let t=null;return e.forEach((r,i)=>{(function Jee(e){return"display"===e||"position"===e})(i)&&(t=t||new Map,t.set(i,r))}),t}class JO{constructor(t,r,i,s){this.element=t,this.keyframes=r,this.options=i,this._specialStyles=s,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this._originalOnDoneFns=[],this._originalOnStartFns=[],this.time=0,this.parentPlayer=null,this.currentSnapshot=new Map,this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:new Map;const r=()=>this._onFinish();this.domPlayer.addEventListener("finish",r),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",r)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(t){const r=[];return t.forEach(i=>{r.push(Object.fromEntries(i))}),r}_triggerWebAnimation(t,r,i){return t.animate(this._convertKeyframesToObject(r),i)}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const t=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,s)=>{"offset"!==s&&t.set(s,this._finished?i:fb(this.element,s))}),this.currentSnapshot=t}triggerCallback(t){const r="start"===t?this._onStartFns:this._onDoneFns;r.forEach(i=>i()),r.length=0}}class XO{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}matchesElement(t,r){return!1}containsElement(t,r){return MO(t,r)}getParentElement(t){return rb(t)}query(t,r,i){return NO(t,r,i)}computeStyle(t,r,i){return fb(t,r)}animate(t,r,i,s,o,a=[]){const l={duration:i,delay:s,fill:0==s?"both":"forwards"};o&&(l.easing=o);const u=new Map,d=a.filter(p=>p instanceof JO);(function lee(e,t){return 0===e||0===t})(i,s)&&d.forEach(p=>{p.currentSnapshot.forEach((g,m)=>u.set(m,g))});let f=function oee(e){return e.length?e[0]instanceof Map?e:e.map(t=>new Map(Object.entries(t))):[]}(r).map(p=>new Map(p));f=function uee(e,t,r){if(r.size&&t.length){let i=t[0],s=[];if(r.forEach((o,a)=>{i.has(a)||s.push(a),i.set(a,o)}),s.length)for(let o=1;oa.set(c,fb(e,c)))}}return t}(t,f,u);const h=function Yee(e,t){let r=null,i=null;return Array.isArray(t)&&t.length?(r=Db(t[0]),t.length>1&&(i=Db(t[t.length-1]))):t instanceof Map&&(r=Db(t)),r||i?new $u(e,r,i):null}(t,f);return new JO(t,f,l,h)}}const ek="@.disabled";class tk{constructor(t,r,i,s){this.namespaceId=t,this.delegate=r,this.engine=i,this._onDestroy=s,this.\u0275type=0}get data(){return this.delegate.data}destroyNode(t){this.delegate.destroyNode?.(t)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(t,r){return this.delegate.createElement(t,r)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,r){this.delegate.appendChild(t,r),this.engine.onInsert(this.namespaceId,r,t,!1)}insertBefore(t,r,i,s=!0){this.delegate.insertBefore(t,r,i),this.engine.onInsert(this.namespaceId,r,t,s)}removeChild(t,r,i){this.engine.onRemove(this.namespaceId,r,this.delegate)}selectRootElement(t,r){return this.delegate.selectRootElement(t,r)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,r,i,s){this.delegate.setAttribute(t,r,i,s)}removeAttribute(t,r,i){this.delegate.removeAttribute(t,r,i)}addClass(t,r){this.delegate.addClass(t,r)}removeClass(t,r){this.delegate.removeClass(t,r)}setStyle(t,r,i,s){this.delegate.setStyle(t,r,i,s)}removeStyle(t,r,i){this.delegate.removeStyle(t,r,i)}setProperty(t,r,i){"@"==r.charAt(0)&&r==ek?this.disableAnimations(t,!!i):this.delegate.setProperty(t,r,i)}setValue(t,r){this.delegate.setValue(t,r)}listen(t,r,i){return this.delegate.listen(t,r,i)}disableAnimations(t,r){this.engine.disableAnimations(t,r)}}class Xee extends tk{constructor(t,r,i,s,o){super(r,i,s,o),this.factory=t,this.namespaceId=r}setProperty(t,r,i){"@"==r.charAt(0)?"."==r.charAt(1)&&r==ek?this.disableAnimations(t,i=void 0===i||!!i):this.engine.process(this.namespaceId,t,r.slice(1),i):this.delegate.setProperty(t,r,i)}listen(t,r,i){if("@"==r.charAt(0)){const s=function ete(e){switch(e){case"body":return document.body;case"document":return document;case"window":return window;default:return e}}(t);let o=r.slice(1),a="";return"@"!=o.charAt(0)&&([o,a]=function tte(e){const t=e.indexOf(".");return[e.substring(0,t),e.slice(t+1)]}(o)),this.engine.listen(this.namespaceId,s,o,a,c=>{this.factory.scheduleListenerCallback(c._data||-1,i,c)})}return this.delegate.listen(t,r,i)}}class nte{constructor(t,r,i){this.delegate=t,this.engine=r,this._zone=i,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,r.onRemovalComplete=(s,o)=>{const a=o?.parentNode(s);a&&o.removeChild(a,s)}}createRenderer(t,r){const s=this.delegate.createRenderer(t,r);if(!t||!r?.data?.animation){const u=this._rendererCache;let d=u.get(s);return d||(d=new tk("",s,this.engine,()=>u.delete(s)),u.set(s,d)),d}const o=r.id,a=r.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);const c=u=>{Array.isArray(u)?u.forEach(c):this.engine.registerTrigger(o,a,t,u.name,u)};return r.data.animation.forEach(c),new Xee(this,a,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(t,r,i){if(t>=0&&tr(i));const s=this._animationCallbacksBuffer;0==s.length&&queueMicrotask(()=>{this._zone.run(()=>{s.forEach(o=>{const[a,c]=o;a(c)}),this._animationCallbacksBuffer=[]})}),s.push([r,i])}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}let rte=(()=>{class e extends ju{constructor(r,i,s){super(r,i,s,P(sf,{optional:!0}))}ngOnDestroy(){this.flush()}static#e=this.\u0275fac=function(i){return new(i||e)(G(Wt),G(sb),G(ob))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();const nk=[{provide:ob,useFactory:function ite(){return new LO}},{provide:ju,useClass:rte},{provide:sy,useFactory:function ste(e,t,r){return new nte(e,t,r)},deps:[Gv,ju,Ne]}],Cb=[{provide:sb,useFactory:()=>new XO},{provide:VD,useValue:"BrowserAnimations"},...nk],rk=[{provide:sb,useClass:ib},{provide:VD,useValue:"NoopAnimations"},...nk];let ote=(()=>{class e{static withConfig(r){return{ngModule:e,providers:r.disableAnimations?rk:Cb}}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({providers:Cb,imports:[vA]})}return e})(),ik=(()=>{class e extends $n{constructor(r){super(),this.error$=r}handleError(r){/^AbortError/.test(String(r))||(r.errors&&r.errors.length?r.errors.forEach(i=>{console.error((new Date).toLocaleString(),i.message),this.error$.next(i.message)}):r.message?(console.error((new Date).toLocaleString(),r.message),this.error$.next(r.message)):(console.error((new Date).toLocaleString(),"application throw unkown error"),this.error$.next("application throw unkown error")))}static#e=this.\u0275fac=function(i){return new(i||e)(G(Q_))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),ate=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({providers:[Q_,ik,{provide:$n,useClass:ik}],imports:[Ea,ote]})}return e})(),cte=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e,bootstrap:[gX]});static#r=this.\u0275inj=Jt({imports:[mX,vA,jJ,PH,NK,yX,pX.forRoot({timeOut:1e4,positionClass:"toast-top-center",preventDuplicates:!0}),ate]})}return e})();xH().bootstrapModule(cte).catch(e=>console.error(e))}},zp=>{zp(zp.s=45)}]); \ No newline at end of file +"use strict";(self.webpackChunkomeglestr=self.webpackChunkomeglestr||[]).push([[792],{45:(zp,Sb,pc)=>{var gc={};pc.r(gc),pc.d(gc,{OG:()=>o0,My:()=>Da,Ph:()=>wn,lX:()=>r0,Id:()=>Gs,fg:()=>NA,qj:()=>Zt,aT:()=>Ca,lq:()=>Yi,z:()=>s0,Q5:()=>Bl});var qp={};function Ib(e,t,r,i,s,o,a){try{var c=e[o](a),l=c.value}catch(u){return void r(u)}c.done?t(l):Promise.resolve(l).then(i,s)}function $(e){return function(){var t=this,r=arguments;return new Promise(function(i,s){var o=e.apply(t,r);function a(l){Ib(o,i,s,a,c,"next",l)}function c(l){Ib(o,i,s,a,c,"throw",l)}a(void 0)})}}pc.r(qp),pc.d(qp,{aK:()=>ro,e8:()=>Ua,DO:()=>Xl,dJ:()=>zN,OG:()=>Tw,My:()=>ja,Ph:()=>no,lX:()=>Cw,Id:()=>eu,fg:()=>GN,qj:()=>gr,aT:()=>Va,r4:()=>Wh,aY:()=>to,x:()=>Aw,lq:()=>Ha,z:()=>Sw,zW:()=>$a,Q5:()=>tu});let wt=null,mc=!1,Hu=1;const Er=Symbol("SIGNAL");function me(e){const t=wt;return wt=e,t}const Tb={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Gp(e){if(mc)throw new Error("");if(null===wt)return;wt.consumerOnSignalRead(e);const t=wt.nextProducerIndex++;mo(wt),t0}function mo(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function Lb(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}let Fb=function fk(){throw new Error};function Bb(){Fb()}let Zp=null;function Ub(e,t){Mb()||Bb(),e.equal(e.value,t)||(e.value=t,function yk(e){e.version++,function lk(){Hu++}(),Ab(e),Zp?.()}(e))}const mk={...Tb,equal:function ok(e,t){return Object.is(e,t)},value:void 0};function nt(e){return"function"==typeof e}function qu(e){const r=e(i=>{Error.call(i),i.stack=(new Error).stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}const Kp=qu(e=>function(r){e(this),this.message=r?`${r.length} errors occurred during unsubscription:\n${r.map((i,s)=>`${s+1}) ${i.toString()}`).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=r});function Gu(e,t){if(e){const r=e.indexOf(t);0<=r&&e.splice(r,1)}}class Rt{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(const o of r)o.remove(this);else r.remove(this);const{initialTeardown:i}=this;if(nt(i))try{i()}catch(o){t=o instanceof Kp?o.errors:[o]}const{_finalizers:s}=this;if(s){this._finalizers=null;for(const o of s)try{Hb(o)}catch(a){t=t??[],a instanceof Kp?t=[...t,...a.errors]:t.push(a)}}if(t)throw new Kp(t)}}add(t){var r;if(t&&t!==this)if(this.closed)Hb(t);else{if(t instanceof Rt){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}}_hasParent(t){const{_parentage:r}=this;return r===t||Array.isArray(r)&&r.includes(t)}_addParent(t){const{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t}_removeParent(t){const{_parentage:r}=this;r===t?this._parentage=null:Array.isArray(r)&&Gu(r,t)}remove(t){const{_finalizers:r}=this;r&&Gu(r,t),t instanceof Rt&&t._removeParent(this)}}Rt.EMPTY=(()=>{const e=new Rt;return e.closed=!0,e})();const $b=Rt.EMPTY;function Vb(e){return e instanceof Rt||e&&"closed"in e&&nt(e.remove)&&nt(e.add)&&nt(e.unsubscribe)}function Hb(e){nt(e)?e():e.unsubscribe()}const Es={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Wu={setTimeout(e,t,...r){const{delegate:i}=Wu;return i?.setTimeout?i.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){const{delegate:t}=Wu;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function zb(e){Wu.setTimeout(()=>{const{onUnhandledError:t}=Es;if(!t)throw e;t(e)})}function Qp(){}const wk=Yp("C",void 0,void 0);function Yp(e,t,r){return{kind:e,value:t,error:r}}let Ds=null;function Zu(e){if(Es.useDeprecatedSynchronousErrorHandling){const t=!Ds;if(t&&(Ds={errorThrown:!1,error:null}),e(),t){const{errorThrown:r,error:i}=Ds;if(Ds=null,r)throw i}}else e()}class Jp extends Rt{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,Vb(t)&&t.add(this)):this.destination=Ik}static create(t,r,i){return new eg(t,r,i)}next(t){this.isStopped?tg(function bk(e){return Yp("N",e,void 0)}(t),this):this._next(t)}error(t){this.isStopped?tg(function _k(e){return Yp("E",void 0,e)}(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?tg(wk,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const Dk=Function.prototype.bind;function Xp(e,t){return Dk.call(e,t)}class Ck{constructor(t){this.partialObserver=t}next(t){const{partialObserver:r}=this;if(r.next)try{r.next(t)}catch(i){Ku(i)}}error(t){const{partialObserver:r}=this;if(r.error)try{r.error(t)}catch(i){Ku(i)}else Ku(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(r){Ku(r)}}}class eg extends Jp{constructor(t,r,i){let s;if(super(),nt(t)||!t)s={next:t??void 0,error:r??void 0,complete:i??void 0};else{let o;this&&Es.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=()=>this.unsubscribe(),s={next:t.next&&Xp(t.next,o),error:t.error&&Xp(t.error,o),complete:t.complete&&Xp(t.complete,o)}):s=t}this.destination=new Ck(s)}}function Ku(e){Es.useDeprecatedSynchronousErrorHandling?function Ek(e){Es.useDeprecatedSynchronousErrorHandling&&Ds&&(Ds.errorThrown=!0,Ds.error=e)}(e):zb(e)}function tg(e,t){const{onStoppedNotification:r}=Es;r&&Wu.setTimeout(()=>r(e,t))}const Ik={closed:!0,next:Qp,error:function Sk(e){throw e},complete:Qp},ng="function"==typeof Symbol&&Symbol.observable||"@@observable";function Cs(e){return e}function qb(e){return 0===e.length?Cs:1===e.length?e[0]:function(r){return e.reduce((i,s)=>s(i),r)}}let Ot=(()=>{class e{constructor(r){r&&(this._subscribe=r)}lift(r){const i=new e;return i.source=this,i.operator=r,i}subscribe(r,i,s){const o=function Ak(e){return e&&e instanceof Jp||function xk(e){return e&&nt(e.next)&&nt(e.error)&&nt(e.complete)}(e)&&Vb(e)}(r)?r:new eg(r,i,s);return Zu(()=>{const{operator:a,source:c}=this;o.add(a?a.call(o,c):c?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(r){try{return this._subscribe(r)}catch(i){r.error(i)}}forEach(r,i){return new(i=Gb(i))((s,o)=>{const a=new eg({next:c=>{try{r(c)}catch(l){o(l),a.unsubscribe()}},error:o,complete:s});this.subscribe(a)})}_subscribe(r){var i;return null===(i=this.source)||void 0===i?void 0:i.subscribe(r)}[ng](){return this}pipe(...r){return qb(r)(this)}toPromise(r){return new(r=Gb(r))((i,s)=>{let o;this.subscribe(a=>o=a,a=>s(a),()=>i(o))})}}return e.create=t=>new e(t),e})();function Gb(e){var t;return null!==(t=e??Es.Promise)&&void 0!==t?t:Promise}const Mk=qu(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});let ot=(()=>{class e extends Ot{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){const i=new Wb(this,this);return i.operator=r,i}_throwIfClosed(){if(this.closed)throw new Mk}next(r){Zu(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(r)}})}error(r){Zu(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;const{observers:i}=this;for(;i.length;)i.shift().error(r)}})}complete(){Zu(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return(null===(r=this.observers)||void 0===r?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){const{hasError:i,isStopped:s,observers:o}=this;return i||s?$b:(this.currentObservers=null,o.push(r),new Rt(()=>{this.currentObservers=null,Gu(o,r)}))}_checkFinalizedStatuses(r){const{hasError:i,thrownError:s,isStopped:o}=this;i?r.error(s):o&&r.complete()}asObservable(){const r=new Ot;return r.source=this,r}}return e.create=(t,r)=>new Wb(t,r),e})();class Wb extends ot{constructor(t,r){super(),this.destination=t,this.source=r}next(t){var r,i;null===(i=null===(r=this.destination)||void 0===r?void 0:r.next)||void 0===i||i.call(r,t)}error(t){var r,i;null===(i=null===(r=this.destination)||void 0===r?void 0:r.error)||void 0===i||i.call(r,t)}complete(){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===r||r.call(t)}_subscribe(t){var r,i;return null!==(i=null===(r=this.source)||void 0===r?void 0:r.subscribe(t))&&void 0!==i?i:$b}}class jn extends ot{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const r=super._subscribe(t);return!r.closed&&t.next(this._value),r}getValue(){const{hasError:t,thrownError:r,_value:i}=this;if(t)throw r;return this._throwIfClosed(),i}next(t){super.next(this._value=t)}}function Zb(e){return nt(e?.lift)}function Nt(e){return t=>{if(Zb(t))return t.lift(function(r){try{return e(r,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function _t(e,t,r,i,s){return new Nk(e,t,r,i,s)}class Nk extends Jp{constructor(t,r,i,s,o,a){super(t),this.onFinalize=o,this.shouldUnsubscribe=a,this._next=r?function(c){try{r(c)}catch(l){t.error(l)}}:super._next,this._error=s?function(c){try{s(c)}catch(l){t.error(l)}finally{this.unsubscribe()}}:super._error,this._complete=i?function(){try{i()}catch(c){t.error(c)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){const{closed:r}=this;super.unsubscribe(),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}}}function Ue(e,t){return Nt((r,i)=>{let s=0;r.subscribe(_t(i,o=>{i.next(e.call(t,o,s++))}))})}const Kb="https://g.co/ng/security#xss";class M extends Error{constructor(t,r){super(function yo(e,t){return`NG0${Math.abs(e)}${t?": "+t:""}`}(t,r)),this.code=t}}function ii(e){return{toString:e}.toString()}const wo="__parameters__";function bo(e,t,r){return ii(()=>{const i=function rg(e){return function(...r){if(e){const i=e(...r);for(const s in i)this[s]=i[s]}}}(t);function s(...o){if(this instanceof s)return i.apply(this,o),this;const a=new s(...o);return c.annotation=a,c;function c(l,u,d){const f=l.hasOwnProperty(wo)?l[wo]:Object.defineProperty(l,wo,{value:[]})[wo];for(;f.length<=d;)f.push(null);return(f[d]=f[d]||[]).push(a),l}}return r&&(s.prototype=Object.create(r.prototype)),s.prototype.ngMetadataName=e,s.annotationCls=s,s})}const Pe=globalThis;function Fe(e){for(let t in e)if(e[t]===Fe)return t;throw Error("Could not find renamed property on target object.")}function bt(e){if("string"==typeof e)return e;if(Array.isArray(e))return"["+e.map(bt).join(", ")+"]";if(null==e)return""+e;if(e.overriddenName)return`${e.overriddenName}`;if(e.name)return`${e.name}`;const t=e.toString();if(null==t)return""+t;const r=t.indexOf("\n");return-1===r?t:t.substring(0,r)}function ig(e,t){return null==e||""===e?null===t?"":t:null==t||""===t?e:e+" "+t}const Ok=Fe({__forward_ref__:Fe});function sg(e){return e.__forward_ref__=sg,e.toString=function(){return bt(this())},e}function re(e){return Yu(e)?e():e}function Yu(e){return"function"==typeof e&&e.hasOwnProperty(Ok)&&e.__forward_ref__===sg}function z(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function Jt(e){return{providers:e.providers||[],imports:e.imports||[]}}function Ju(e){return Xb(e,ed)||Xb(e,eE)}function Xb(e,t){return e.hasOwnProperty(t)?e[t]:null}function Xu(e){return e&&(e.hasOwnProperty(og)||e.hasOwnProperty(Uk))?e[og]:null}const ed=Fe({\u0275prov:Fe}),og=Fe({\u0275inj:Fe}),eE=Fe({ngInjectableDef:Fe}),Uk=Fe({ngInjectorDef:Fe});class K{constructor(t,r){this._desc=t,this.ngMetadataName="InjectionToken",this.\u0275prov=void 0,"number"==typeof r?this.__NG_ELEMENT_ID__=r:void 0!==r&&(this.\u0275prov=z({token:this,providedIn:r.providedIn||"root",factory:r.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}}function dg(e){return e&&!!e.\u0275providers}const vc=Fe({\u0275cmp:Fe}),fg=Fe({\u0275dir:Fe}),hg=Fe({\u0275pipe:Fe}),nE=Fe({\u0275mod:Fe}),si=Fe({\u0275fac:Fe}),wc=Fe({__NG_ELEMENT_ID__:Fe}),rE=Fe({__NG_ENV_ID__:Fe});function de(e){return"string"==typeof e?e:null==e?"":String(e)}function pg(e,t){throw new M(-201,!1)}var Ee=function(e){return e[e.Default=0]="Default",e[e.Host=1]="Host",e[e.Self=2]="Self",e[e.SkipSelf=4]="SkipSelf",e[e.Optional=8]="Optional",e}(Ee||{});let gg;function iE(){return gg}function fn(e){const t=gg;return gg=e,t}function sE(e,t,r){const i=Ju(e);return i&&"root"==i.providedIn?void 0===i.value?i.value=i.factory():i.value:r&Ee.Optional?null:void 0!==t?t:void pg()}const _c={},mg="__NG_DI_FLAG__",td="ngTempTokenPath",qk=/\n/gm,oE="__source";let Eo;function Bi(e){const t=Eo;return Eo=e,t}function Zk(e,t=Ee.Default){if(void 0===Eo)throw new M(-203,!1);return null===Eo?sE(e,void 0,t):Eo.get(e,t&Ee.Optional?null:void 0,t)}function G(e,t=Ee.Default){return(iE()||Zk)(re(e),t)}function P(e,t=Ee.Default){return G(e,nd(t))}function nd(e){return typeof e>"u"||"number"==typeof e?e:(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function yg(e){const t=[];for(let r=0;rArray.isArray(r)?Do(r,t):t(r))}function cE(e,t,r){t>=e.length?e.push(r):e.splice(t,0,r)}function sd(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function Tn(e,t,r){let i=Co(e,t);return i>=0?e[1|i]=r:(i=~i,function lE(e,t,r,i){let s=e.length;if(s==t)e.push(r,i);else if(1===s)e.push(i,e[0]),e[0]=r;else{for(s--,e.push(e[s-1],e[s]);s>t;)e[s]=e[s-2],s--;e[t]=r,e[t+1]=i}}(e,i,t,r)),i}function wg(e,t){const r=Co(e,t);if(r>=0)return e[1|r]}function Co(e,t){return function uE(e,t,r){let i=0,s=e.length>>r;for(;s!==i;){const o=i+(s-i>>1),a=e[o<t?s=o:i=o+1}return~(s<t){a=o-1;break}}}for(;o-1){let o;for(;++so?"":s[d+1].toLowerCase(),2&i&&u!==f){if(er(i))return!1;a=!0}}}}else{if(!a&&!er(i)&&!er(l))return!1;if(a&&er(l))continue;a=!1,i=l|1&i}}return er(i)||a}function er(e){return!(1&e)}function oP(e,t,r,i){if(null===t)return-1;let s=0;if(i||!r){let o=!1;for(;s-1)for(r++;r0?'="'+c+'"':"")+"]"}else 8&i?s+="."+a:4&i&&(s+=" "+a);else""!==s&&!er(a)&&(t+=yE(o,s),s=""),i=a,o=o||!er(i);r++}return""!==s&&(t+=yE(o,s)),t}function So(e){return ii(()=>{const t=wE(e),r={...t,decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection===cd.OnPush,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||Jn.Emulated,styles:e.styles||Me,_:null,schemas:e.schemas||null,tView:null,id:""};_E(r);const i=e.dependencies;return r.directiveDefs=ld(i,!1),r.pipeDefs=ld(i,!0),r.id=function yP(e){let t=0;const r=[e.selectors,e.ngContentSelectors,e.hostVars,e.hostAttrs,e.consts,e.vars,e.decls,e.encapsulation,e.standalone,e.signals,e.exportAs,JSON.stringify(e.inputs),JSON.stringify(e.outputs),Object.getOwnPropertyNames(e.type.prototype),!!e.contentQueries,!!e.viewQuery].join("|");for(const s of r)t=Math.imul(31,t)+s.charCodeAt(0)|0;return t+=2147483648,"c"+t}(r),r})}function pP(e){return we(e)||Et(e)}function gP(e){return null!==e}function pn(e){return ii(()=>({type:e.type,bootstrap:e.bootstrap||Me,declarations:e.declarations||Me,imports:e.imports||Me,exports:e.exports||Me,transitiveCompileScopes:null,schemas:e.schemas||null,id:e.id||null}))}function vE(e,t){if(null==e)return Dr;const r={};for(const i in e)if(e.hasOwnProperty(i)){const s=e[i];let o,a,c=Xn.None;Array.isArray(s)?(c=s[0],o=s[1],a=s[2]??o):(o=s,a=s),t?(r[o]=c!==Xn.None?[i,c]:i,t[o]=a):r[o]=i}return r}function Xt(e){return ii(()=>{const t=wE(e);return _E(t),t})}function en(e){return{type:e.type,name:e.name,factory:null,pure:!1!==e.pure,standalone:!0===e.standalone,onDestroy:e.type.prototype.ngOnDestroy||null}}function we(e){return e[vc]||null}function Et(e){return e[fg]||null}function kt(e){return e[hg]||null}function jt(e,t){const r=e[nE]||null;if(!r&&!0===t)throw new Error(`Type ${bt(e)} does not have '\u0275mod' property.`);return r}function wE(e){const t={};return{type:e.type,providersResolver:null,factory:null,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputTransforms:null,inputConfig:e.inputs||Dr,exportAs:e.exportAs||null,standalone:!0===e.standalone,signals:!0===e.signals,selectors:e.selectors||Me,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:vE(e.inputs,t),outputs:vE(e.outputs),debugInfo:null}}function _E(e){e.features?.forEach(t=>t(e))}function ld(e,t){if(!e)return null;const r=t?kt:pP;return()=>("function"==typeof e?e():e).map(i=>r(i)).filter(gP)}function vP(...e){return{\u0275providers:Dg(0,e),\u0275fromNgModule:!0}}function Dg(e,...t){const r=[],i=new Set;let s;const o=a=>{r.push(a)};return Do(t,a=>{const c=a;ud(c,o,[],i)&&(s||=[],s.push(c))}),void 0!==s&&bE(s,o),r}function bE(e,t){for(let r=0;r{t(o,i)})}}function ud(e,t,r,i){if(!(e=re(e)))return!1;let s=null,o=Xu(e);const a=!o&&we(e);if(o||a){if(a&&!a.standalone)return!1;s=e}else{const l=e.ngModule;if(o=Xu(l),!o)return!1;s=l}const c=i.has(s);if(a){if(c)return!1;if(i.add(s),a.dependencies){const l="function"==typeof a.dependencies?a.dependencies():a.dependencies;for(const u of l)ud(u,t,r,i)}}else{if(!o)return!1;{if(null!=o.imports&&!c){let u;i.add(s);try{Do(o.imports,d=>{ud(d,t,r,i)&&(u||=[],u.push(d))})}finally{}void 0!==u&&bE(u,t)}if(!c){const u=Ss(s)||(()=>new s);t({provide:s,useFactory:u,deps:Me},s),t({provide:_g,useValue:s,multi:!0},s),t({provide:Is,useValue:()=>G(s),multi:!0},s)}const l=o.providers;if(null!=l&&!c){const u=e;Cg(l,d=>{t(d,u)})}}}return s!==e&&void 0!==e.providers}function Cg(e,t){for(let r of e)dg(r)&&(r=r.\u0275providers),Array.isArray(r)?Cg(r,t):t(r)}const wP=Fe({provide:String,useValue:Fe});function Sg(e){return null!==e&&"object"==typeof e&&wP in e}function Ts(e){return"function"==typeof e}const Ig=new K(""),dd={},bP={};let Tg;function fd(){return void 0===Tg&&(Tg=new ad),Tg}class gn{}class Io extends gn{get destroyed(){return this._destroyed}constructor(t,r,i,s){super(),this.parent=r,this.source=i,this.scopes=s,this.records=new Map,this._ngOnDestroyHooks=new Set,this._onDestroyHooks=[],this._destroyed=!1,Ag(t,a=>this.processProvider(a)),this.records.set(dE,To(void 0,this)),s.has("environment")&&this.records.set(gn,To(void 0,this));const o=this.records.get(Ig);null!=o&&"string"==typeof o.value&&this.scopes.add(o.value),this.injectorDefTypes=new Set(this.get(_g,Me,Ee.Self))}destroy(){this.assertNotDestroyed(),this._destroyed=!0;const t=me(null);try{for(const i of this._ngOnDestroyHooks)i.ngOnDestroy();const r=this._onDestroyHooks;this._onDestroyHooks=[];for(const i of r)i()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),me(t)}}onDestroy(t){return this.assertNotDestroyed(),this._onDestroyHooks.push(t),()=>this.removeOnDestroy(t)}runInContext(t){this.assertNotDestroyed();const r=Bi(this),i=fn(void 0);try{return t()}finally{Bi(r),fn(i)}}get(t,r=_c,i=Ee.Default){if(this.assertNotDestroyed(),t.hasOwnProperty(rE))return t[rE](this);i=nd(i);const o=Bi(this),a=fn(void 0);try{if(!(i&Ee.SkipSelf)){let l=this.records.get(t);if(void 0===l){const u=function IP(e){return"function"==typeof e||"object"==typeof e&&e instanceof K}(t)&&Ju(t);l=u&&this.injectableDefInScope(u)?To(xg(t),dd):null,this.records.set(t,l)}if(null!=l)return this.hydrate(t,l)}return(i&Ee.Self?fd():this.parent).get(t,r=i&Ee.Optional&&r===_c?null:r)}catch(c){if("NullInjectorError"===c.name){if((c[td]=c[td]||[]).unshift(bt(t)),o)throw c;return function Qk(e,t,r,i){const s=e[td];throw t[oE]&&s.unshift(t[oE]),e.message=function Yk(e,t,r,i=null){e=e&&"\n"===e.charAt(0)&&"\u0275"==e.charAt(1)?e.slice(2):e;let s=bt(t);if(Array.isArray(t))s=t.map(bt).join(" -> ");else if("object"==typeof t){let o=[];for(let a in t)if(t.hasOwnProperty(a)){let c=t[a];o.push(a+":"+("string"==typeof c?JSON.stringify(c):bt(c)))}s=`{${o.join(", ")}}`}return`${r}${i?"("+i+")":""}[${s}]: ${e.replace(qk,"\n ")}`}("\n"+e.message,s,r,i),e.ngTokenPath=s,e[td]=null,e}(c,t,"R3InjectorError",this.source)}throw c}finally{fn(a),Bi(o)}}resolveInjectorInitializers(){const t=me(null),r=Bi(this),i=fn(void 0);try{const o=this.get(Is,Me,Ee.Self);for(const a of o)a()}finally{Bi(r),fn(i),me(t)}}toString(){const t=[],r=this.records;for(const i of r.keys())t.push(bt(i));return`R3Injector[${t.join(", ")}]`}assertNotDestroyed(){if(this._destroyed)throw new M(205,!1)}processProvider(t){let r=Ts(t=re(t))?t:re(t&&t.provide);const i=function DP(e){return Sg(e)?To(void 0,e.useValue):To(function CE(e,t,r){let i;if(Ts(e)){const s=re(e);return Ss(s)||xg(s)}if(Sg(e))i=()=>re(e.useValue);else if(function DE(e){return!(!e||!e.useFactory)}(e))i=()=>e.useFactory(...yg(e.deps||[]));else if(function EE(e){return!(!e||!e.useExisting)}(e))i=()=>G(re(e.useExisting));else{const s=re(e&&(e.useClass||e.provide));if(!function CP(e){return!!e.deps}(e))return Ss(s)||xg(s);i=()=>new s(...yg(e.deps))}return i}(e),dd)}(t);if(!Ts(t)&&!0===t.multi){let s=this.records.get(r);s||(s=To(void 0,dd,!0),s.factory=()=>yg(s.multi),this.records.set(r,s)),r=t,s.multi.push(t)}this.records.set(r,i)}hydrate(t,r){const i=me(null);try{return r.value===dd&&(r.value=bP,r.value=r.factory()),"object"==typeof r.value&&r.value&&function SP(e){return null!==e&&"object"==typeof e&&"function"==typeof e.ngOnDestroy}(r.value)&&this._ngOnDestroyHooks.add(r.value),r.value}finally{me(i)}}injectableDefInScope(t){if(!t.providedIn)return!1;const r=re(t.providedIn);return"string"==typeof r?"any"===r||this.scopes.has(r):this.injectorDefTypes.has(r)}removeOnDestroy(t){const r=this._onDestroyHooks.indexOf(t);-1!==r&&this._onDestroyHooks.splice(r,1)}}function xg(e){const t=Ju(e),r=null!==t?t.factory:Ss(e);if(null!==r)return r;if(e instanceof K)throw new M(204,!1);if(e instanceof Function)return function EP(e){if(e.length>0)throw new M(204,!1);const r=function Bk(e){return e&&(e[ed]||e[eE])||null}(e);return null!==r?()=>r.factory(e):()=>new e}(e);throw new M(204,!1)}function To(e,t,r=!1){return{factory:e,value:t,multi:r?[]:void 0}}function Ag(e,t){for(const r of e)Array.isArray(r)?Ag(r,t):r&&dg(r)?Ag(r.\u0275providers,t):t(r)}function oi(e,t){e instanceof Io&&e.assertNotDestroyed();const i=Bi(e),s=fn(void 0);try{return t()}finally{Bi(i),fn(s)}}function SE(){return void 0!==iE()||null!=function Wk(){return Eo}()}const rt=0,F=1,ee=2,ut=3,tr=4,$t=5,xn=6,Ao=7,We=8,mt=9,nr=10,ie=11,Sc=12,TE=13,Mo=14,it=15,Ic=16,No=17,ai=18,Tc=19,xE=20,ji=21,gd=22,xs=23,fe=25,Ng=1,Cr=7,Ro=9,dt=10;var Rg=function(e){return e[e.None=0]="None",e[e.HasTransplantedViews=2]="HasTransplantedViews",e}(Rg||{});function Vt(e){return Array.isArray(e)&&"object"==typeof e[Ng]}function Ht(e){return Array.isArray(e)&&!0===e[Ng]}function Og(e){return!!(4&e.flags)}function As(e){return e.componentOffset>-1}function yd(e){return!(1&~e.flags)}function rr(e){return!!e.template}function kg(e){return!!(512&e[ee])}class UP{constructor(t,r,i){this.previousValue=t,this.currentValue=r,this.firstChange=i}isFirstChange(){return this.firstChange}}function RE(e,t,r,i){null!==t?t.applyValueToInputSignal(t,i):e[r]=i}function Ms(){return OE}function OE(e){return e.type.prototype.ngOnChanges&&(e.setInput=$P),jP}function jP(){const e=PE(this),t=e?.current;if(t){const r=e.previous;if(r===Dr)e.previous=t;else for(let i in t)r[i]=t[i];e.current=null,this.ngOnChanges(t)}}function $P(e,t,r,i,s){const o=this.declaredInputs[i],a=PE(e)||function VP(e,t){return e[kE]=t}(e,{previous:Dr,current:null}),c=a.current||(a.current={}),l=a.previous,u=l[o];c[o]=new UP(u&&u.currentValue,r,l===Dr),RE(e,t,s,r)}Ms.ngInherit=!0;const kE="__ngSimpleChanges__";function PE(e){return e[kE]||null}const Sr=function(e,t,r){};let BE=!1;function je(e){for(;Array.isArray(e);)e=e[rt];return e}function Ac(e,t){return je(t[e])}function tn(e,t){return je(t[e.index])}function Mc(e,t){return e.data[t]}function Oo(e,t){return e[t]}function An(e,t){const r=t[e];return Vt(r)?r:r[rt]}function Ug(e){return!(128&~e[ee])}function Ir(e,t){return null==t?null:e[t]}function UE(e){e[No]=0}function ZP(e){1024&e[ee]||(e[ee]|=1024,Ug(e)&&Nc(e))}function jg(e){return!!(9216&e[ee]||e[xs]?.dirty)}function $g(e){e[nr].changeDetectionScheduler?.notify(1),jg(e)?Nc(e):64&e[ee]&&(function zP(){return BE}()?(e[ee]|=1024,Nc(e)):e[nr].changeDetectionScheduler?.notify())}function Nc(e){e[nr].changeDetectionScheduler?.notify();let t=Ns(e);for(;null!==t&&!(8192&t[ee])&&(t[ee]|=8192,Ug(t));)t=Ns(t)}function vd(e,t){if(!(256&~e[ee]))throw new M(911,!1);null===e[ji]&&(e[ji]=[]),e[ji].push(t)}function Ns(e){const t=e[ut];return Ht(t)?t[ut]:t}const se={lFrame:KE(null),bindingsEnabled:!0,skipHydrationRootTNode:null};function VE(){return se.bindingsEnabled}function N(){return se.lFrame.lView}function De(){return se.lFrame.tView}function ci(e){return se.lFrame.contextLView=e,e[We]}function li(e){return se.lFrame.contextLView=null,e}function Be(){let e=HE();for(;null!==e&&64===e.type;)e=e.parent;return e}function HE(){return se.lFrame.currentTNode}function Tr(e,t){const r=se.lFrame;r.currentTNode=e,r.isParent=t}function Hg(){return se.lFrame.isParent}function zg(){se.lFrame.isParent=!1}function ir(){return se.lFrame.bindingIndex++}function di(e){const t=se.lFrame,r=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,r}function sL(e,t){const r=se.lFrame;r.bindingIndex=r.bindingRootIndex=e,qg(t)}function qg(e){se.lFrame.currentDirectiveIndex=e}function Gg(e){const t=se.lFrame.currentDirectiveIndex;return-1===t?null:e[t]}function Wg(){return se.lFrame.currentQueryIndex}function wd(e){se.lFrame.currentQueryIndex=e}function aL(e){const t=e[F];return 2===t.type?t.declTNode:1===t.type?e[$t]:null}function WE(e,t,r){if(r&Ee.SkipSelf){let s=t,o=e;for(;!(s=s.parent,null!==s||r&Ee.Host||(s=aL(o),null===s||(o=o[Mo],10&s.type))););if(null===s)return!1;t=s,e=o}const i=se.lFrame=ZE();return i.currentTNode=t,i.lView=e,!0}function Zg(e){const t=ZE(),r=e[F];se.lFrame=t,t.currentTNode=r.firstChild,t.lView=e,t.tView=r,t.contextLView=e,t.bindingIndex=r.bindingStartIndex,t.inI18n=!1}function ZE(){const e=se.lFrame,t=null===e?null:e.child;return null===t?KE(e):t}function KE(e){const t={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:e,child:null,inI18n:!1};return null!==e&&(e.child=t),t}function QE(){const e=se.lFrame;return se.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}const YE=QE;function Kg(){const e=QE();e.isParent=!0,e.tView=null,e.selectedIndex=-1,e.contextLView=null,e.elementDepthCount=0,e.currentDirectiveIndex=-1,e.currentNamespace=null,e.bindingRootIndex=-1,e.bindingIndex=-1,e.currentQueryIndex=0}function zt(){return se.lFrame.selectedIndex}function Rs(e){se.lFrame.selectedIndex=e}function Ze(){const e=se.lFrame;return Mc(e.tView,e.selectedIndex)}let XE=!0;function Oc(){return XE}function xr(e){XE=e}function _d(e,t){for(let r=t.directiveStart,i=t.directiveEnd;r=i)break}else t[l]<0&&(e[No]+=65536),(c>14>16&&(3&e[ee])===t&&(e[ee]+=16384,tD(c,o)):tD(c,o)}const Po=-1;class kc{constructor(t,r,i){this.factory=t,this.resolving=!1,this.canSeeViewProviders=r,this.injectImpl=i}}function Jg(e){return e!==Po}function Pc(e){return 32767&e}function Lc(e,t){let r=function wL(e){return e>>16}(e),i=t;for(;r>0;)i=i[Mo],r--;return i}let Xg=!0;function Dd(e){const t=Xg;return Xg=e,t}const nD=255,rD=5;let _L=0;const Ar={};function Cd(e,t){const r=iD(e,t);if(-1!==r)return r;const i=t[F];i.firstCreatePass&&(e.injectorIndex=t.length,em(i.data,e),em(t,null),em(i.blueprint,null));const s=Sd(e,t),o=e.injectorIndex;if(Jg(s)){const a=Pc(s),c=Lc(s,t),l=c[F].data;for(let u=0;u<8;u++)t[o+u]=c[a+u]|l[a+u]}return t[o+8]=s,o}function em(e,t){e.push(0,0,0,0,0,0,0,0,t)}function iD(e,t){return-1===e.injectorIndex||e.parent&&e.parent.injectorIndex===e.injectorIndex||null===t[e.injectorIndex+8]?-1:e.injectorIndex}function Sd(e,t){if(e.parent&&-1!==e.parent.injectorIndex)return e.parent.injectorIndex;let r=0,i=null,s=t;for(;null!==s;){if(i=dD(s),null===i)return Po;if(r++,s=s[Mo],-1!==i.injectorIndex)return i.injectorIndex|r<<16}return Po}function tm(e,t,r){!function bL(e,t,r){let i;"string"==typeof r?i=r.charCodeAt(0)||0:r.hasOwnProperty(wc)&&(i=r[wc]),null==i&&(i=r[wc]=_L++);const s=i&nD;t.data[e+(s>>rD)]|=1<=0?t&nD:SL:t}(r);if("function"==typeof o){if(!WE(t,e,i))return i&Ee.Host?sD(s,0,i):oD(t,r,i,s);try{let a;if(a=o(i),null!=a||i&Ee.Optional)return a;pg()}finally{YE()}}else if("number"==typeof o){let a=null,c=iD(e,t),l=Po,u=i&Ee.Host?t[it][$t]:null;for((-1===c||i&Ee.SkipSelf)&&(l=-1===c?Sd(e,t):t[c+8],l!==Po&&uD(i,!1)?(a=t[F],c=Pc(l),t=Lc(l,t)):c=-1);-1!==c;){const d=t[F];if(lD(o,c,d.data)){const f=DL(c,t,r,a,i,u);if(f!==Ar)return f}l=t[c+8],l!==Po&&uD(i,t[F].data[c+8]===u)&&lD(o,c,t)?(a=d,c=Pc(l),t=Lc(l,t)):c=-1}}return s}function DL(e,t,r,i,s,o){const a=t[F],c=a.data[e+8],d=Id(c,a,r,null==i?As(c)&&Xg:i!=a&&!!(3&c.type),s&Ee.Host&&o===c);return null!==d?Os(t,a,d,c):Ar}function Id(e,t,r,i,s){const o=e.providerIndexes,a=t.data,c=1048575&o,l=e.directiveStart,d=o>>20,h=s?c+d:e.directiveEnd;for(let p=i?c:c+d;p=l&&g.type===r)return p}if(s){const p=a[l];if(p&&rr(p)&&p.type===r)return l}return null}function Os(e,t,r,i){let s=e[r];const o=t.data;if(function gL(e){return e instanceof kc}(s)){const a=s;a.resolving&&function Vk(e,t){throw t&&t.join(" > "),new M(-200,e)}(function Re(e){return"function"==typeof e?e.name||e.toString():"object"==typeof e&&null!=e&&"function"==typeof e.type?e.type.name||e.type.toString():de(e)}(o[r]));const c=Dd(a.canSeeViewProviders);a.resolving=!0;const u=a.injectImpl?fn(a.injectImpl):null;WE(e,i,Ee.Default);try{s=e[r]=a.factory(void 0,o,e,i),t.firstCreatePass&&r>=i.directiveStart&&function hL(e,t,r){const{ngOnChanges:i,ngOnInit:s,ngDoCheck:o}=t.type.prototype;if(i){const a=OE(t);(r.preOrderHooks??=[]).push(e,a),(r.preOrderCheckHooks??=[]).push(e,a)}s&&(r.preOrderHooks??=[]).push(0-e,s),o&&((r.preOrderHooks??=[]).push(e,o),(r.preOrderCheckHooks??=[]).push(e,o))}(r,o[r],t)}finally{null!==u&&fn(u),Dd(c),a.resolving=!1,YE()}}return s}function lD(e,t,r){return!!(r[t+(e>>rD)]&1<{const t=e.prototype.constructor,r=t[si]||rm(t),i=Object.prototype;let s=Object.getPrototypeOf(e.prototype).constructor;for(;s&&s!==i;){const o=s[si]||rm(s);if(o&&o!==r)return o;s=Object.getPrototypeOf(s)}return o=>new o})}function rm(e){return Yu(e)?()=>{const t=rm(re(e));return t&&t()}:Ss(e)}function dD(e){const t=e[F],r=t.type;return 2===r?t.declTNode:1===r?e[$t]:null}function mD(e,t=null,r=null,i){const s=yD(e,t,r,i);return s.resolveInjectorInitializers(),s}function yD(e,t=null,r=null,i,s=new Set){const o=[r||Me,vP(e)];return i=i||("object"==typeof e?void 0:bt(e)),new Io(o,t||fd(),i||null,s)}let qt=(()=>{class e{static#e=this.THROW_IF_NOT_FOUND=_c;static#t=this.NULL=new ad;static create(r,i){if(Array.isArray(r))return mD({name:""},i,r,"");{const s=r.name??"";return mD({name:s},r.parent,r.providers,s)}}static#r=this.\u0275prov=z({token:e,providedIn:"any",factory:()=>G(dE)});static#h=this.__NG_ELEMENT_ID__=-1}return e})();function sm(e){return e.ngOriginalError}class $n{constructor(){this._console=console}handleError(t){const r=this._findOriginalError(t);this._console.error("ERROR",t),r&&this._console.error("ORIGINAL ERROR",r)}_findOriginalError(t){let r=t&&sm(t);for(;r&&sm(r);)r=sm(r);return r||null}}const wD=new K("",{providedIn:"root",factory:()=>P($n).handleError.bind(void 0)});let Bo=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=PL;static#t=this.__NG_ENV_ID__=r=>r}return e})();class kL extends Bo{constructor(t){super(),this._lView=t}onDestroy(t){return vd(this._lView,t),()=>function Vg(e,t){if(null===e[ji])return;const r=e[ji].indexOf(t);-1!==r&&e[ji].splice(r,1)}(this._lView,t)}}function PL(){return new kL(N())}function LL(){return Uo(Be(),N())}function Uo(e,t){return new $i(tn(e,t))}let $i=(()=>{class e{constructor(r){this.nativeElement=r}static#e=this.__NG_ELEMENT_ID__=LL}return e})();function bD(e){return e instanceof $i?e.nativeElement:e}function om(e){return t=>{setTimeout(e,void 0,t)}}const rn=class FL extends ot{constructor(t=!1){super(),this.destroyRef=void 0,this.__isAsync=t,SE()&&(this.destroyRef=P(Bo,{optional:!0})??void 0)}emit(t){const r=me(null);try{super.next(t)}finally{me(r)}}subscribe(t,r,i){let s=t,o=r||(()=>null),a=i;if(t&&"object"==typeof t){const l=t;s=l.next?.bind(l),o=l.error?.bind(l),a=l.complete?.bind(l)}this.__isAsync&&(o=om(o),s&&(s=om(s)),a&&(a=om(a)));const c=super.subscribe({next:s,error:o,complete:a});return t instanceof Rt&&t.add(c),c}};function BL(){return this._results[Symbol.iterator]()}class am{static#e=Symbol.iterator;get changes(){return this._changes??=new rn}constructor(t=!1){this._emitDistinctChangesOnly=t,this.dirty=!0,this._onDirty=void 0,this._results=[],this._changesDetected=!1,this._changes=void 0,this.length=0,this.first=void 0,this.last=void 0;const r=am.prototype;r[Symbol.iterator]||(r[Symbol.iterator]=BL)}get(t){return this._results[t]}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,r){return this._results.reduce(t,r)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t,r){this.dirty=!1;const i=function hn(e){return e.flat(Number.POSITIVE_INFINITY)}(t);(this._changesDetected=!function tP(e,t,r){if(e.length!==t.length)return!1;for(let i=0;ioF}),oF="ng",$D=new K(""),ks=new K("",{providedIn:"platform",factory:()=>"unknown"}),VD=new K(""),HD=new K("",{providedIn:"root",factory:()=>Vi().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});let zD=()=>null;function wm(e,t,r=!1){return zD(e,t,r)}const KD=new K("",{providedIn:"root",factory:()=>!1});let Bd,Ud;function Vo(e){return function Dm(){if(void 0===Bd&&(Bd=null,Pe.trustedTypes))try{Bd=Pe.trustedTypes.createPolicy("angular",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return Bd}()?.createHTML(e)||e}function YD(e){return function Cm(){if(void 0===Ud&&(Ud=null,Pe.trustedTypes))try{Ud=Pe.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e})}catch{}return Ud}()?.createHTML(e)||e}class Ps{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${Kb})`}}class _F extends Ps{getTypeName(){return"HTML"}}class bF extends Ps{getTypeName(){return"Style"}}class EF extends Ps{getTypeName(){return"Script"}}class DF extends Ps{getTypeName(){return"URL"}}class CF extends Ps{getTypeName(){return"ResourceURL"}}function Mn(e){return e instanceof Ps?e.changingThisBreaksApplicationSecurity:e}function Mr(e,t){const r=function SF(e){return e instanceof Ps&&e.getTypeName()||null}(e);if(null!=r&&r!==t){if("ResourceURL"===r&&"URL"===t)return!0;throw new Error(`Required a safe ${t}, got a ${r} (see ${Kb})`)}return r===t}class NF{constructor(t){this.inertDocumentHelper=t}getInertBodyElement(t){t=""+t;try{const r=(new window.DOMParser).parseFromString(Vo(t),"text/html").body;return null===r?this.inertDocumentHelper.getInertBodyElement(t):(r.removeChild(r.firstChild),r)}catch{return null}}}class RF{constructor(t){this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(t){const r=this.inertDocument.createElement("template");return r.innerHTML=Vo(t),r}}const kF=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function jd(e){return(e=String(e)).match(kF)?e:"unsafe:"+e}function fi(e){const t={};for(const r of e.split(","))t[r]=!0;return t}function zc(...e){const t={};for(const r of e)for(const i in r)r.hasOwnProperty(i)&&(t[i]=!0);return t}const tC=fi("area,br,col,hr,img,wbr"),nC=fi("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),rC=fi("rp,rt"),Sm=zc(tC,zc(nC,fi("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),zc(rC,fi("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),zc(rC,nC)),Im=fi("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),iC=zc(Im,fi("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),fi("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),PF=fi("script,style,template");class LF{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(t){let r=t.firstChild,i=!0,s=[];for(;r;)if(r.nodeType===Node.ELEMENT_NODE?i=this.startElement(r):r.nodeType===Node.TEXT_NODE?this.chars(r.nodeValue):this.sanitizedSomething=!0,i&&r.firstChild)s.push(r),r=UF(r);else for(;r;){r.nodeType===Node.ELEMENT_NODE&&this.endElement(r);let o=BF(r);if(o){r=o;break}r=s.pop()}return this.buf.join("")}startElement(t){const r=sC(t).toLowerCase();if(!Sm.hasOwnProperty(r))return this.sanitizedSomething=!0,!PF.hasOwnProperty(r);this.buf.push("<"),this.buf.push(r);const i=t.attributes;for(let s=0;s"),!0}endElement(t){const r=sC(t).toLowerCase();Sm.hasOwnProperty(r)&&!tC.hasOwnProperty(r)&&(this.buf.push(""))}chars(t){this.buf.push(aC(t))}}function BF(e){const t=e.nextSibling;if(t&&e!==t.previousSibling)throw oC(t);return t}function UF(e){const t=e.firstChild;if(t&&function FF(e,t){return(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}(e,t))throw oC(t);return t}function sC(e){const t=e.nodeName;return"string"==typeof t?t:"FORM"}function oC(e){return new Error(`Failed to sanitize html because the element is clobbered: ${e.outerHTML}`)}const jF=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,$F=/([^\#-~ |!])/g;function aC(e){return e.replace(/&/g,"&").replace(jF,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace($F,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}let $d;function cC(e,t){let r=null;try{$d=$d||function eC(e){const t=new RF(e);return function OF(){try{return!!(new window.DOMParser).parseFromString(Vo(""),"text/html")}catch{return!1}}()?new NF(t):t}(e);let i=t?String(t):"";r=$d.getInertBodyElement(i);let s=5,o=i;do{if(0===s)throw new Error("Failed to sanitize html because the input is unstable");s--,i=o,o=r.innerHTML,r=$d.getInertBodyElement(i)}while(i!==o);return Vo((new LF).sanitizeChildren(Tm(r)||r))}finally{if(r){const i=Tm(r)||r;for(;i.firstChild;)i.removeChild(i.firstChild)}}}function Tm(e){return"content"in e&&function VF(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var Nn=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}(Nn||{});function xm(e){const t=function qc(){const e=N();return e&&e[nr].sanitizer}();return t?YD(t.sanitize(Nn.HTML,e)||""):Mr(e,"HTML")?YD(Mn(e)):cC(Vi(),de(e))}const ZF=/^>|^->||--!>|)/g,QF="\u200b$1\u200b";function gC(e){return e.ownerDocument.defaultView}function Rn(e){return e instanceof Function?e():e}var Hi=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}(Hi||{});let Rm;function Om(e,t){return Rm(e,t)}function zo(e,t,r,i,s){if(null!=i){let o,a=!1;Ht(i)?o=i:Vt(i)&&(a=!0,i=i[rt]);const c=je(i);0===e&&null!==r?null==s?CC(t,r,c):Ls(t,r,c,s||null,!0):1===e&&null!==r?Ls(t,r,c,s||null,!0):2===e?function Zc(e,t,r){const i=Gd(e,t);i&&function p3(e,t,r,i){e.removeChild(t,r,i)}(e,i,t,r)}(t,c,a):3===e&&t.destroyNode(c),null!=o&&function y3(e,t,r,i,s){const o=r[Cr];o!==je(r)&&zo(t,e,i,o,s);for(let c=dt;ct.replace(KF,QF))}(t))}function zd(e,t,r){return e.createElement(t,r)}function bC(e,t){t[nr].changeDetectionScheduler?.notify(1),Zd(e,t,t[ie],2,null,null)}function EC(e,t){const r=e[Ro],i=r.indexOf(t);r.splice(i,1)}function Gc(e,t){if(e.length<=dt)return;const r=dt+t,i=e[r];if(i){const s=i[Ic];null!==s&&s!==e&&EC(s,i),t>0&&(e[r-1][tr]=i[tr]);const o=sd(e,dt+t);!function a3(e,t){bC(e,t),t[rt]=null,t[$t]=null}(i[F],i);const a=o[ai];null!==a&&a.detachView(o[F]),i[ut]=null,i[tr]=null,i[ee]&=-129}return i}function qd(e,t){if(!(256&t[ee])){const r=t[ie];r.destroyNode&&Zd(e,t,r,3,null,null),function l3(e){let t=e[Sc];if(!t)return Lm(e[F],e);for(;t;){let r=null;if(Vt(t))r=t[Sc];else{const i=t[dt];i&&(r=i)}if(!r){for(;t&&!t[tr]&&t!==e;)Vt(t)&&Lm(t[F],t),t=t[ut];null===t&&(t=e),Vt(t)&&Lm(t[F],t),r=t&&t[tr]}t=r}}(t)}}function Lm(e,t){if(256&t[ee])return;const r=me(null);try{t[ee]&=-129,t[ee]|=256,t[xs]&&function kb(e){if(mo(e),yc(e))for(let t=0;t=0?i[a]():i[-a].unsubscribe(),o+=2}else r[o].call(i[r[o+1]]);null!==i&&(t[Ao]=null);const s=t[ji];if(null!==s){t[ji]=null;for(let o=0;o-1){const{encapsulation:o}=e.data[i.directiveStart+s];if(o===Jn.None||o===Jn.Emulated)return null}return tn(i,r)}}(e,t.parent,r)}function Ls(e,t,r,i,s){e.insertBefore(t,r,i,s)}function CC(e,t,r){e.appendChild(t,r)}function SC(e,t,r,i,s){null!==i?Ls(e,t,r,i,s):CC(e,t,r)}function Gd(e,t){return e.parentNode(t)}let Bm,xC=function TC(e,t,r){return 40&e.type?tn(e,r):null};function Wd(e,t,r,i){const s=Fm(e,i,t),o=t[ie],c=function IC(e,t,r){return xC(e,t,r)}(i.parent||t[$t],i,t);if(null!=s)if(Array.isArray(r))for(let l=0;lfe&&PC(e,t,fe,!1),Sr(a?2:0,s),r(i,s)}finally{Rs(o),Sr(a?3:1,s)}}function Vm(e,t,r){if(Og(t)){const i=me(null);try{const o=t.directiveEnd;for(let a=t.directiveStart;anull;function $C(e,t,r,i,s){for(let o in t){if(!t.hasOwnProperty(o))continue;const a=t[o];if(void 0===a)continue;i??={};let c,l=Xn.None;Array.isArray(a)?(c=a[0],l=a[1]):c=a;let u=o;if(null!==s){if(!s.hasOwnProperty(o))continue;u=s[o]}0===e?VC(i,r,u,c,l):VC(i,r,u,c)}return i}function VC(e,t,r,i,s){let o;e.hasOwnProperty(r)?(o=e[r]).push(t,i):o=e[r]=[t,i],void 0!==s&&o.push(s)}function yn(e,t,r,i,s,o,a,c){const l=tn(t,r);let d,u=t.inputs;!c&&null!=u&&(d=u[i])?(Qm(e,r,d,i,s),As(t)&&function M3(e,t){const r=An(t,e);16&r[ee]||(r[ee]|=64)}(r,t.index)):3&t.type&&(i=function A3(e){return"class"===e?"className":"for"===e?"htmlFor":"formaction"===e?"formAction":"innerHtml"===e?"innerHTML":"readonly"===e?"readOnly":"tabindex"===e?"tabIndex":e}(i),s=null!=a?a(s,t.value||"",i):s,o.setProperty(l,i,s))}function Gm(e,t,r,i){if(VE()){const s=null===i?null:{"":-1},o=function L3(e,t){const r=e.directiveRegistry;let i=null,s=null;if(r)for(let o=0;o0;){const r=e[--t];if("number"==typeof r&&r<0)return r}return 0})(a)!=c&&a.push(c),a.push(r,i,o)}}(e,t,i,Kc(e,r,s.hostVars,he),s)}function Nr(e,t,r,i,s,o){const a=tn(e,t);!function Zm(e,t,r,i,s,o,a){if(null==o)e.removeAttribute(t,s,r);else{const c=null==a?de(o):a(o,i||"",s);e.setAttribute(t,s,c,r)}}(t[ie],a,o,e.value,r,i,s)}function V3(e,t,r,i,s,o){const a=o[t];if(null!==a)for(let c=0;c0&&(r[s-1][tr]=t),i{Nc(e.lView)},consumerOnSignalRead(){this.lView[xs]=this}},XC=100;function Jd(e,t=!0,r=0){const i=e[nr],s=i.rendererFactory;s.begin?.();try{!function Y3(e,t){Xm(e,t);let r=0;for(;jg(e);){if(r===XC)throw new M(103,!1);r++,Xm(e,1)}}(e,r)}catch(a){throw t&&Yd(e,a),a}finally{s.end?.(),i.inlineEffectRunner?.flush()}}function J3(e,t,r,i){const s=t[ee];if(!(256&~s))return;t[nr].inlineEffectRunner?.flush(),Zg(t);let a=null,c=null;(function X3(e){return 2!==e.type})(e)&&(c=function W3(e){return e[xs]??function Z3(e){const t=JC.pop()??Object.create(Q3);return t.lView=e,t}(e)}(t),a=function Rb(e){return e&&(e.nextProducerIndex=0),me(e)}(c));try{UE(t),function qE(e){return se.lFrame.bindingIndex=e}(e.bindingStartIndex),null!==r&&BC(e,t,r,2,i);const l=!(3&~s);if(l){const f=e.preOrderCheckHooks;null!==f&&bd(t,f,null)}else{const f=e.preOrderHooks;null!==f&&Ed(t,f,0,null),Qg(t,0)}if(function eB(e){for(let t=ND(e);null!==t;t=RD(t)){if(!(t[ee]&Rg.HasTransplantedViews))continue;const r=t[Ro];for(let i=0;ie.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}(c,a),function K3(e){e.lView[xs]!==e&&(e.lView=null,JC.push(e))}(c)),Kg()}}function eS(e,t){for(let r=ND(e);null!==r;r=RD(r))for(let i=dt;i-1&&(Gc(t,i),sd(r,i))}this._attachedToViewContainer=!1}qd(this._lView[F],this._lView)}onDestroy(t){vd(this._lView,t)}markForCheck(){Xc(this._cdRefInjectingView||this._lView)}detach(){this._lView[ee]&=-129}reattach(){$g(this._lView),this._lView[ee]|=128}detectChanges(){this._lView[ee]|=1024,Jd(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new M(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null,bC(this._lView[F],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new M(902,!1);this._appRef=t,$g(this._lView)}}let pi=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=iB}return e})();const nB=pi,rB=class extends nB{constructor(t,r,i){super(),this._declarationLView=t,this._declarationTContainer=r,this.elementRef=i}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(t,r){return this.createEmbeddedViewImpl(t,r)}createEmbeddedViewImpl(t,r,i){const s=function Qc(e,t,r,i){const s=me(null);try{const o=t.tView,l=Kd(e,o,r,4096&e[ee]?4096:16,null,t,null,null,i?.injector??null,i?.embeddedViewInjector??null,i?.dehydratedView??null);l[Ic]=e[t.index];const d=e[ai];return null!==d&&(l[ai]=d.createEmbeddedView(o)),Ym(o,l,r),l}finally{me(s)}}(this._declarationLView,this._declarationTContainer,t,{embeddedViewInjector:r,dehydratedView:i});return new el(s)}};function iB(){return Xd(Be(),N())}function Xd(e,t){return 4&e.type?new rB(t,e,Uo(e,t)):null}class sf{}class xB{}class lS{}class MB{resolveComponentFactory(t){throw function AB(e){const t=Error(`No component factory found for ${bt(e)}.`);return t.ngComponent=e,t}(t)}}let sl=(()=>{class e{static#e=this.NULL=new MB}return e})();class sy{}let RB=(()=>{class e{static#e=this.\u0275prov=z({token:e,providedIn:"root",factory:()=>null})}return e})();const oy={},dS=new Set;function Rr(e){dS.has(e)||(dS.add(e),performance?.mark?.("mark_feature_usage",{detail:{feature:e}}))}function fS(...e){}class Ne{constructor({enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:i=!1}){if(this.hasPendingMacrotasks=!1,this.hasPendingMicrotasks=!1,this.isStable=!0,this.onUnstable=new rn(!1),this.onMicrotaskEmpty=new rn(!1),this.onStable=new rn(!1),this.onError=new rn(!1),typeof Zone>"u")throw new M(908,!1);Zone.assertZonePatched();const s=this;s._nesting=0,s._outer=s._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(s._inner=s._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(s._inner=s._inner.fork(Zone.longStackTraceZoneSpec)),s.shouldCoalesceEventChangeDetection=!i&&r,s.shouldCoalesceRunChangeDetection=i,s.lastRequestAnimationFrameId=-1,s.nativeRequestAnimationFrame=function OB(){const e="function"==typeof Pe.requestAnimationFrame;let t=Pe[e?"requestAnimationFrame":"setTimeout"],r=Pe[e?"cancelAnimationFrame":"clearTimeout"];if(typeof Zone<"u"&&t&&r){const i=t[Zone.__symbol__("OriginalDelegate")];i&&(t=i);const s=r[Zone.__symbol__("OriginalDelegate")];s&&(r=s)}return{nativeRequestAnimationFrame:t,nativeCancelAnimationFrame:r}}().nativeRequestAnimationFrame,function LB(e){const t=()=>{!function PB(e){e.isCheckStableRunning||-1!==e.lastRequestAnimationFrameId||(e.lastRequestAnimationFrameId=e.nativeRequestAnimationFrame.call(Pe,()=>{e.fakeTopEventTask||(e.fakeTopEventTask=Zone.root.scheduleEventTask("fakeTopEventTask",()=>{e.lastRequestAnimationFrameId=-1,cy(e),e.isCheckStableRunning=!0,ay(e),e.isCheckStableRunning=!1},void 0,()=>{},()=>{})),e.fakeTopEventTask.invoke()}),cy(e))}(e)};e._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(r,i,s,o,a,c)=>{if(function FB(e){return!(!Array.isArray(e)||1!==e.length)&&!0===e[0].data?.__ignore_ng_zone__}(c))return r.invokeTask(s,o,a,c);try{return hS(e),r.invokeTask(s,o,a,c)}finally{(e.shouldCoalesceEventChangeDetection&&"eventTask"===o.type||e.shouldCoalesceRunChangeDetection)&&t(),pS(e)}},onInvoke:(r,i,s,o,a,c,l)=>{try{return hS(e),r.invoke(s,o,a,c,l)}finally{e.shouldCoalesceRunChangeDetection&&t(),pS(e)}},onHasTask:(r,i,s,o)=>{r.hasTask(s,o),i===s&&("microTask"==o.change?(e._hasPendingMicrotasks=o.microTask,cy(e),ay(e)):"macroTask"==o.change&&(e.hasPendingMacrotasks=o.macroTask))},onHandleError:(r,i,s,o)=>(r.handleError(s,o),e.runOutsideAngular(()=>e.onError.emit(o)),!1)})}(s)}static isInAngularZone(){return typeof Zone<"u"&&!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Ne.isInAngularZone())throw new M(909,!1)}static assertNotInAngularZone(){if(Ne.isInAngularZone())throw new M(909,!1)}run(t,r,i){return this._inner.run(t,r,i)}runTask(t,r,i,s){const o=this._inner,a=o.scheduleEventTask("NgZoneEvent: "+s,t,kB,fS,fS);try{return o.runTask(a,r,i)}finally{o.cancelTask(a)}}runGuarded(t,r,i){return this._inner.runGuarded(t,r,i)}runOutsideAngular(t){return this._outer.run(t)}}const kB={};function ay(e){if(0==e._nesting&&!e.hasPendingMicrotasks&&!e.isStable)try{e._nesting++,e.onMicrotaskEmpty.emit(null)}finally{if(e._nesting--,!e.hasPendingMicrotasks)try{e.runOutsideAngular(()=>e.onStable.emit(null))}finally{e.isStable=!0}}}function cy(e){e.hasPendingMicrotasks=!!(e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&-1!==e.lastRequestAnimationFrameId)}function hS(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function pS(e){e._nesting--,ay(e)}class gS{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new rn,this.onMicrotaskEmpty=new rn,this.onStable=new rn,this.onError=new rn}run(t,r,i){return t.apply(r,i)}runGuarded(t,r,i){return t.apply(r,i)}runOutsideAngular(t){return t()}runTask(t,r,i,s){return t.apply(r,i)}}var Fs=function(e){return e[e.EarlyRead=0]="EarlyRead",e[e.Write=1]="Write",e[e.MixedReadWrite=2]="MixedReadWrite",e[e.Read=3]="Read",e}(Fs||{});const mS={destroy(){}};function uy(e,t){!t&&function hd(e){if(!SE())throw new M(-203,!1)}();const r=t?.injector??P(qt);if(!function sr(e){return"browser"===(e??P(qt)).get(ks)}(r))return mS;Rr("NgAfterNextRender");const i=r.get(ol),s=i.handler??=new vS,o=t?.phase??Fs.MixedReadWrite,a=()=>{s.unregister(l),c()},c=r.get(Bo).onDestroy(a),l=oi(r,()=>new yS(o,()=>{a(),e()}));return s.register(l),{destroy:a}}class yS{constructor(t,r){this.phase=t,this.callbackFn=r,this.zone=P(Ne),this.errorHandler=P($n,{optional:!0}),P(sf,{optional:!0})?.notify(1)}invoke(){try{this.zone.runOutsideAngular(this.callbackFn)}catch(t){this.errorHandler?.handleError(t)}}}class vS{constructor(){this.executingCallbacks=!1,this.buckets={[Fs.EarlyRead]:new Set,[Fs.Write]:new Set,[Fs.MixedReadWrite]:new Set,[Fs.Read]:new Set},this.deferredCallbacks=new Set}register(t){(this.executingCallbacks?this.deferredCallbacks:this.buckets[t.phase]).add(t)}unregister(t){this.buckets[t.phase].delete(t),this.deferredCallbacks.delete(t)}execute(){this.executingCallbacks=!0;for(const t of Object.values(this.buckets))for(const r of t)r.invoke();this.executingCallbacks=!1;for(const t of this.deferredCallbacks)this.buckets[t.phase].add(t);this.deferredCallbacks.clear()}destroy(){for(const t of Object.values(this.buckets))t.clear();this.deferredCallbacks.clear()}}let ol=(()=>{class e{constructor(){this.handler=null,this.internalCallbacks=[]}execute(){this.executeInternalCallbacks(),this.handler?.execute()}executeInternalCallbacks(){const r=[...this.internalCallbacks];this.internalCallbacks.length=0;for(const i of r)i()}ngOnDestroy(){this.handler?.destroy(),this.handler=null,this.internalCallbacks.length=0}static#e=this.\u0275prov=z({token:e,providedIn:"root",factory:()=>new e})}return e})();function lf(e,t,r){let i=r?e.styles:null,s=r?e.classes:null,o=0;if(null!==t)for(let a=0;a0&&OC(e,r,o.join(" "))}}(p,D,m,i),void 0!==r&&function KB(e,t,r){const i=e.projection=[];for(let s=0;s{class e{static#e=this.__NG_ELEMENT_ID__=YB}return e})();function YB(){return SS(Be(),N())}const JB=or,DS=class extends JB{constructor(t,r,i){super(),this._lContainer=t,this._hostTNode=r,this._hostLView=i}get element(){return Uo(this._hostTNode,this._hostLView)}get injector(){return new Ct(this._hostTNode,this._hostLView)}get parentInjector(){const t=Sd(this._hostTNode,this._hostLView);if(Jg(t)){const r=Lc(t,this._hostLView),i=Pc(t);return new Ct(r[F].data[i+8],r)}return new Ct(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){const r=CS(this._lContainer);return null!==r&&r[t]||null}get length(){return this._lContainer.length-dt}createEmbeddedView(t,r,i){let s,o;"number"==typeof i?s=i:null!=i&&(s=i.index,o=i.injector);const c=t.createEmbeddedViewImpl(r||{},o,null);return this.insertImpl(c,s,Go(this._hostTNode,null)),c}createComponent(t,r,i,s,o){const a=t&&!function Cc(e){return"function"==typeof e}(t);let c;if(a)c=r;else{const g=r||{};c=g.index,i=g.injector,s=g.projectableNodes,o=g.environmentInjector||g.ngModuleRef}const l=a?t:new ll(we(t)),u=i||this.parentInjector;if(!o&&null==l.ngModule){const m=(a?u:this.parentInjector).get(gn,null);m&&(o=m)}we(l.componentType??{});const p=l.create(u,s,null,o);return this.insertImpl(p.hostView,c,Go(this._hostTNode,null)),p}insert(t,r){return this.insertImpl(t,r,!0)}insertImpl(t,r,i){const s=t._lView;if(function WP(e){return Ht(e[ut])}(s)){const c=this.indexOf(t);if(-1!==c)this.detach(c);else{const l=s[ut],u=new DS(l,l[$t],l[ut]);u.detach(u.indexOf(t))}}const o=this._adjustIndex(r),a=this._lContainer;return Yc(a,s,o,i),t.attachToViewContainerRef(),cE(hy(a),o,t),t}move(t,r){return this.insert(t,r)}indexOf(t){const r=CS(this._lContainer);return null!==r?r.indexOf(t):-1}remove(t){const r=this._adjustIndex(t,-1),i=Gc(this._lContainer,r);i&&(sd(hy(this._lContainer),r),qd(i[F],i))}detach(t){const r=this._adjustIndex(t,-1),i=Gc(this._lContainer,r);return i&&null!=sd(hy(this._lContainer),r)?new el(i):null}_adjustIndex(t,r=0){return t??this.length+r}};function CS(e){return e[8]}function hy(e){return e[8]||(e[8]=[])}function SS(e,t){let r;const i=t[e.index];return Ht(i)?r=i:(r=qC(i,t,null,e),t[e.index]=r,Qd(t,r)),IS(r,t,e,i),new DS(r,e,t)}let IS=function xS(e,t,r,i){if(e[Cr])return;let s;s=8&r.type?je(i):function XB(e,t){const r=e[ie],i=r.createComment(""),s=tn(t,e);return Ls(r,Gd(r,s),i,function g3(e,t){return e.nextSibling(t)}(r,s),!1),i}(t,r),e[Cr]=s},py=()=>!1;class gy{constructor(t){this.queryList=t,this.matches=null}clone(){return new gy(this.queryList)}setDirty(){this.queryList.setDirty()}}class my{constructor(t=[]){this.queries=t}createEmbeddedView(t){const r=t.queries;if(null!==r){const i=null!==t.contentQueries?t.contentQueries[0]:r.length,s=[];for(let o=0;ot.trim())}(t):t}}class yy{constructor(t=[]){this.queries=t}elementStart(t,r){for(let i=0;i0)i.push(a[c/2]);else{const u=o[c+1],d=t[-l];for(let f=dt;f(Gp(t),t.value);return r[Er]=t,r}(e),i=r[Er];return t?.equal&&(i.equal=t.equal),r.set=s=>Ub(i,s),r.update=s=>function gk(e,t){Mb()||Bb(),Ub(e,t(e.value))}(i,s),r.asReadonly=FS.bind(r),r}function FS(){const e=this[Er];if(void 0===e.readonlyFn){const t=()=>this();t[Er]=e,e.readonlyFn=t}return e.readonlyFn}class Bs{}class tI{}class Dy extends Bs{constructor(t,r,i){super(),this._parent=r,this._bootstrapComponents=[],this.destroyCbs=[],this.componentFactoryResolver=new bS(this);const s=jt(t);this._bootstrapComponents=Rn(s.bootstrap),this._r3Injector=yD(t,r,[{provide:Bs,useValue:this},{provide:sl,useValue:this.componentFactoryResolver},...i],bt(t),new Set(["environment"])),this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(t)}get injector(){return this._r3Injector}destroy(){const t=this._r3Injector;!t.destroyed&&t.destroy(),this.destroyCbs.forEach(r=>r()),this.destroyCbs=null}onDestroy(t){this.destroyCbs.push(t)}}class Cy extends tI{constructor(t){super(),this.moduleType=t}create(t){return new Dy(this.moduleType,t,[])}}class nI extends Bs{constructor(t){super(),this.componentFactoryResolver=new bS(this),this.instance=null;const r=new Io([...t.providers,{provide:Bs,useValue:this},{provide:sl,useValue:this.componentFactoryResolver}],t.parent||fd(),t.debugName,new Set(["environment"]));this.injector=r,t.runEnvironmentInitializers&&r.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}}function hf(e,t,r=null){return new nI({providers:e,parent:t,debugName:r,runEnvironmentInitializers:!0}).injector}let Ko=(()=>{class e{constructor(){this.taskId=0,this.pendingTasks=new Set,this.hasPendingTasks=new jn(!1)}get _hasPendingTasks(){return this.hasPendingTasks.value}add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);const r=this.taskId++;return this.pendingTasks.add(r),r}remove(r){this.pendingTasks.delete(r),0===this.pendingTasks.size&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function gf(e){return!!function Sy(e){return null!==e&&("function"==typeof e||"object"==typeof e)}(e)&&(Array.isArray(e)||!(e instanceof Map)&&Symbol.iterator in e)}function ft(e,t,r){return!Object.is(e[t],r)&&(e[t]=r,!0)}function Hn(e,t,r,i,s,o,a,c){const l=N(),u=De(),d=e+fe,f=u.firstCreatePass?function P8(e,t,r,i,s,o,a,c,l){const u=t.consts,d=qo(t,e,4,a||null,Ir(u,c));Gm(t,r,d,Ir(u,l)),_d(t,d);const f=d.tView=qm(2,d,i,s,o,t.directiveRegistry,t.pipeRegistry,null,t.schemas,u,null);return null!==t.queries&&(t.queries.template(t,d),f.queries=t.queries.embeddedTView(d)),d}(d,u,l,t,r,i,s,o,a):u.data[d];Tr(f,!1);const h=rI(u,l,f,e);Oc()&&Wd(u,l,h,f),Gt(h,l);const p=qC(h,l,h,f);return l[d]=p,Qd(l,p),function TS(e,t,r){return py(e,t,r)}(p,f,l),yd(f)&&Hm(u,l,f),null!=a&&zm(l,f,c),Hn}let rI=function iI(e,t,r,i){return xr(!0),t[ie].createComment("")};function kr(e,t,r,i){const s=N();return ft(s,ir(),t)&&(De(),Nr(Ze(),s,e,t,r,i)),kr}function Ef(e,t){return e<<17|t<<2}function Wi(e){return e>>17&32767}function Py(e){return 2|e}function $s(e){return(131068&e)>>2}function Ly(e,t){return-131069&e|t<<2}function Fy(e){return 1|e}function PI(e,t,r,i){const s=e[r+1],o=null===t;let a=i?Wi(s):$s(s),c=!1;for(;0!==a&&(!1===c||o);){const u=e[a+1];bU(e[a],t)&&(c=!0,e[a+1]=i?Fy(u):Py(u)),a=i?Wi(u):$s(u)}c&&(e[r+1]=i?Py(s):Fy(s))}function bU(e,t){return null===e||null==t||(Array.isArray(e)?e[1]:e)===t||!(!Array.isArray(e)||"string"!=typeof t)&&Co(e,t)>=0}const St={textEnd:0,key:0,keyEnd:0,value:0,valueEnd:0};function LI(e){return e.substring(St.key,St.keyEnd)}function FI(e,t){const r=St.textEnd;return r===t?-1:(t=St.keyEnd=function SU(e,t,r){for(;t32;)t++;return t}(e,St.key=t,r),da(e,t,r))}function da(e,t,r){for(;t=0;r=FI(t,r))Tn(e,LI(t),!0)}function ar(e,t,r,i){const s=N(),o=De(),a=di(2);o.firstUpdatePass&&HI(o,e,a,i),t!==he&&ft(s,a,t)&&qI(o,o.data[zt()],s,s[ie],e,s[a+1]=function LU(e,t){return null==e||""===e||("string"==typeof t?e+=t:"object"==typeof e&&(e=bt(Mn(e)))),e}(t,r),i,a)}function VI(e,t){return t>=e.expandoStartIndex}function HI(e,t,r,i){const s=e.data;if(null===s[r+1]){const o=s[zt()],a=VI(e,r);WI(o,i)&&null===t&&!a&&(t=!1),t=function AU(e,t,r,i){const s=Gg(e);let o=i?t.residualClasses:t.residualStyles;if(null===s)0===(i?t.classBindings:t.styleBindings)&&(r=yl(r=jy(null,e,t,r,i),t.attrs,i),o=null);else{const a=t.directiveStylingLast;if(-1===a||e[a]!==s)if(r=jy(s,e,t,r,i),null===o){let l=function MU(e,t,r){const i=r?t.classBindings:t.styleBindings;if(0!==$s(i))return e[Wi(i)]}(e,t,i);void 0!==l&&Array.isArray(l)&&(l=jy(null,e,t,l[1],i),l=yl(l,t.attrs,i),function NU(e,t,r,i){e[Wi(r?t.classBindings:t.styleBindings)]=i}(e,t,i,l))}else o=function RU(e,t,r){let i;const s=t.directiveEnd;for(let o=1+t.directiveStylingLast;o0)&&(u=!0)):d=r,s)if(0!==l){const h=Wi(e[c+1]);e[i+1]=Ef(h,c),0!==h&&(e[h+1]=Ly(e[h+1],i)),e[c+1]=function yU(e,t){return 131071&e|t<<17}(e[c+1],i)}else e[i+1]=Ef(c,0),0!==c&&(e[c+1]=Ly(e[c+1],i)),c=i;else e[i+1]=Ef(l,0),0===c?c=i:e[l+1]=Ly(e[l+1],i),l=i;u&&(e[i+1]=Py(e[i+1])),PI(e,d,i,!0),PI(e,d,i,!1),function _U(e,t,r,i,s){const o=s?e.residualClasses:e.residualStyles;null!=o&&"string"==typeof t&&Co(o,t)>=0&&(r[i+1]=Fy(r[i+1]))}(t,d,e,i,o),a=Ef(c,l),o?t.classBindings=a:t.styleBindings=a}(s,o,t,r,a,i)}}function jy(e,t,r,i,s){let o=null;const a=r.directiveEnd;let c=r.directiveStylingLast;for(-1===c?c=r.directiveStart:c++;c0;){const l=e[s],u=Array.isArray(l),d=u?l[1]:l,f=null===d;let h=r[s+1];h===he&&(h=f?Me:void 0);let p=f?wg(h,i):d===i?h:void 0;if(u&&!Df(p)&&(p=wg(l,i)),Df(p)&&(c=p,a))return c;const g=e[s+1];s=a?Wi(g):$s(g)}if(null!==t){let l=o?t.residualClasses:t.residualStyles;null!=l&&(c=wg(l,i))}return c}function Df(e){return void 0!==e}function WI(e,t){return!!(e.flags&(t?8:16))}function Le(e,t,r,i){const s=N(),o=De(),a=fe+e,c=s[ie],l=o.firstCreatePass?function s4(e,t,r,i,s,o){const a=t.consts,l=qo(t,e,2,i,Ir(a,s));return Gm(t,r,l,Ir(a,o)),null!==l.attrs&&lf(l,l.attrs,!1),null!==l.mergedAttrs&&lf(l,l.mergedAttrs,!0),null!==t.queries&&t.queries.elementStart(t,l),l}(a,o,s,t,r,i):o.data[a],u=YI(o,s,l,c,t,e);s[a]=u;const d=yd(l);return Tr(l,!0),kC(c,u,l),!function hl(e){return!(32&~e.flags)}(l)&&Oc()&&Wd(o,s,u,l),0===function KP(){return se.lFrame.elementDepthCount}()&&Gt(u,s),function QP(){se.lFrame.elementDepthCount++}(),d&&(Hm(o,s,l),Vm(o,l,s)),null!==i&&zm(s,l),Le}function Qe(){let e=Be();Hg()?zg():(e=e.parent,Tr(e,!1));const t=e;(function JP(e){return se.skipHydrationRootTNode===e})(t)&&function nL(){se.skipHydrationRootTNode=null}(),function YP(){se.lFrame.elementDepthCount--}();const r=De();return r.firstCreatePass&&(_d(r,e),Og(e)&&r.queries.elementEnd(e)),null!=t.classesWithoutHost&&function yL(e){return!!(8&e.flags)}(t)&&By(r,t,N(),t.classesWithoutHost,!0),null!=t.stylesWithoutHost&&function vL(e){return!!(16&e.flags)}(t)&&By(r,t,N(),t.stylesWithoutHost,!1),Qe}function mi(e,t,r,i){return Le(e,t,r,i),Qe(),mi}let YI=(e,t,r,i,s,o)=>(xr(!0),zd(i,s,function JE(){return se.lFrame.currentNamespace}()));function ha(e,t,r){const i=N(),s=De(),o=e+fe,a=s.firstCreatePass?function c4(e,t,r,i,s){const o=t.consts,a=Ir(o,i),c=qo(t,e,8,"ng-container",a);return null!==a&&lf(c,a,!0),Gm(t,r,c,Ir(o,s)),null!==t.queries&&t.queries.elementStart(t,c),c}(o,s,i,t,r):s.data[o];Tr(a,!0);const c=XI(s,i,a,e);return i[o]=c,Oc()&&Wd(s,i,c,a),Gt(c,i),yd(a)&&(Hm(s,i,a),Vm(s,a,i)),null!=r&&zm(i,a),ha}function pa(){let e=Be();const t=De();return Hg()?zg():(e=e.parent,Tr(e,!1)),t.firstCreatePass&&(_d(t,e),Og(e)&&t.queries.elementEnd(e)),pa}let XI=(e,t,r,i)=>(xr(!0),Pm(t[ie],""));function Vs(){return N()}function qy(e,t,r){const i=N();if(ft(i,ir(),t)){const o=De(),a=Ze();yn(o,a,i,e,t,KC(Gg(o.data),a,i),r,!0)}return qy}const ma="en-US";let rT=ma;function kn(e,t,r,i){const s=N(),o=De(),a=Be();return function Zy(e,t,r,i,s,o,a){const c=yd(i),u=e.firstCreatePass&&ZC(e),d=t[We],f=WC(t);let h=!0;if(3&i.type||a){const m=tn(i,t),y=a?a(m):m,v=f.length,w=a?b=>a(je(b[i.index])):i.index;let _=null;if(!a&&c&&(_=function lj(e,t,r,i){const s=e.cleanup;if(null!=s)for(let o=0;ol?c[l]:null}"string"==typeof a&&(o+=2)}return null}(e,t,s,i.index)),null!==_)(_.__ngLastListenerFn__||_).__ngNextListenerFn__=o,_.__ngLastListenerFn__=o,h=!1;else{o=NT(i,t,d,o,!1);const b=r.listen(y,s,o);f.push(o,b),u&&u.push(s,w,v,v+1)}}else o=NT(i,t,d,o,!1);const p=i.outputs;let g;if(h&&null!==p&&(g=p[s])){const m=g.length;if(m)for(let y=0;y-1?An(e.index,t):t);let l=MT(t,r,i,a),u=o.__ngNextListenerFn__;for(;u;)l=MT(t,r,u,a)&&l,u=u.__ngNextListenerFn__;return s&&!1===l&&a.preventDefault(),l}}function It(e=1){return function cL(e){return(se.lFrame.contextLView=function jE(e,t){for(;e>0;)t=t[Mo],e--;return t}(e,se.lFrame.contextLView))[We]}(e)}function Yy(){return function _y(e,t){return e[ai].queries[t].queryList}(N(),Wg())}function xf(e){return Oo(function rL(){return se.lFrame.contextLView}(),fe+e)}function at(e,t=""){const r=N(),i=De(),s=e+fe,o=i.firstCreatePass?qo(i,s,1,t,null):i.data[s],a=JT(i,r,o,t,e);r[s]=a,Oc()&&Wd(i,r,a,o),Tr(o,!1)}let JT=(e,t,r,i,s)=>(xr(!0),function km(e,t){return e.createText(t)}(t[ie],i));function Af(e){return Fr("",e,""),Af}function Fr(e,t,r){const i=N(),s=function ra(e,t,r,i){return ft(e,ir(),r)?t+de(r)+i:he}(i,e,t,r);return s!==he&&function hi(e,t,r){const i=Ac(t,e);!function _C(e,t,r){e.setValue(t,r)}(e[ie],i,r)}(i,zt(),s),Fr}let kj=(()=>{class e{constructor(r){this._injector=r,this.cachedInjectors=new Map}getOrCreateStandaloneInjector(r){if(!r.standalone)return null;if(!this.cachedInjectors.has(r)){const i=Dg(0,r.type),s=i.length>0?hf([i],this._injector,`Standalone[${r.type.name}]`):null;this.cachedInjectors.set(r,s)}return this.cachedInjectors.get(r)}ngOnDestroy(){try{for(const r of this.cachedInjectors.values())null!==r&&r.destroy()}finally{this.cachedInjectors.clear()}}static#e=this.\u0275prov=z({token:e,providedIn:"environment",factory:()=>new e(G(gn))})}return e})();function Mf(e){Rr("NgStandalone"),e.getStandaloneInjector=t=>t.get(kj).getOrCreateStandaloneInjector(e)}function d1(e,t,r,i,s,o){const a=t+r;return ft(e,a,s)?function Or(e,t,r){return e[t]=r}(e,a+1,o?i.call(o,s):i(s)):function Cl(e,t){const r=e[t];return r===he?void 0:r}(e,a+1)}function y1(e,t,r){const i=e+fe,s=N(),o=Oo(s,i);return function Sl(e,t){return e[F].data[t].pure}(s,i)?d1(s,function nn(){const e=se.lFrame;let t=e.bindingRootIndex;return-1===t&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}(),t,o.transform,r,o):o.transform(r)}let O1=(()=>{class e{log(r){console.log(r)}warn(r){console.warn(r)}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();const B1=new K(""),Pf=new K("");let lv,av=(()=>{class e{constructor(r,i,s){this._ngZone=r,this.registry=i,this._pendingCount=0,this._isZoneStable=!0,this._callbacks=[],this.taskTrackingZone=null,lv||(function q6(e){lv=e}(s),s.addToWindow(i)),this._watchAngularEvents(),r.run(()=>{this.taskTrackingZone=typeof Zone>"u"?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Ne.assertNotInAngularZone(),queueMicrotask(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())queueMicrotask(()=>{for(;0!==this._callbacks.length;){let r=this._callbacks.pop();clearTimeout(r.timeoutId),r.doneCb()}});else{let r=this.getPendingTasks();this._callbacks=this._callbacks.filter(i=>!i.updateCb||!i.updateCb(r)||(clearTimeout(i.timeoutId),!1))}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(r=>({source:r.source,creationLocation:r.creationLocation,data:r.data})):[]}addCallback(r,i,s){let o=-1;i&&i>0&&(o=setTimeout(()=>{this._callbacks=this._callbacks.filter(a=>a.timeoutId!==o),r()},i)),this._callbacks.push({doneCb:r,timeoutId:o,updateCb:s})}whenStable(r,i,s){if(s&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/plugins/task-tracking" loaded?');this.addCallback(r,i,s),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}registerApplication(r){this.registry.registerApplication(r,this)}unregisterApplication(r){this.registry.unregisterApplication(r)}findProviders(r,i,s){return[]}static#e=this.\u0275fac=function(i){return new(i||e)(G(Ne),G(cv),G(Pf))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})(),cv=(()=>{class e{constructor(){this._applications=new Map}registerApplication(r,i){this._applications.set(r,i)}unregisterApplication(r){this._applications.delete(r)}unregisterAllApplications(){this._applications.clear()}getTestability(r){return this._applications.get(r)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(r,i=!0){return lv?.findTestabilityInTree(this,r,i)??null}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})();function Lf(e){return!!e&&"function"==typeof e.then}function U1(e){return!!e&&"function"==typeof e.subscribe}const uv=new K("");let dv=(()=>{class e{constructor(){this.initialized=!1,this.done=!1,this.donePromise=new Promise((r,i)=>{this.resolve=r,this.reject=i}),this.appInits=P(uv,{optional:!0})??[]}runInitializers(){if(this.initialized)return;const r=[];for(const s of this.appInits){const o=s();if(Lf(o))r.push(o);else if(U1(o)){const a=new Promise((c,l)=>{o.subscribe({complete:c,error:l})});r.push(a)}}const i=()=>{this.done=!0,this.resolve()};Promise.all(r).then(()=>{i()}).catch(s=>{this.reject(s)}),0===r.length&&i(),this.initialized=!0}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const fv=new K("");function V1(e,t){return Array.isArray(t)?t.reduce(V1,e):{...e,...t}}let Br=(()=>{class e{constructor(){this._bootstrapListeners=[],this._runningTick=!1,this._destroyed=!1,this._destroyListeners=[],this._views=[],this.internalErrorHandler=P(wD),this.afterRenderEffectManager=P(ol),this.externalTestViews=new Set,this.beforeRender=new ot,this.afterTick=new ot,this.componentTypes=[],this.components=[],this.isStable=P(Ko).hasPendingTasks.pipe(Ue(r=>!r)),this._injector=P(gn)}get destroyed(){return this._destroyed}get injector(){return this._injector}bootstrap(r,i){const s=r instanceof lS;if(!this._injector.get(dv).done)throw!s&&function Ui(e){const t=we(e)||Et(e)||kt(e);return null!==t&&t.standalone}(r),new M(405,!1);let a;a=s?r:this._injector.get(sl).resolveComponentFactory(r),this.componentTypes.push(a.componentType);const c=function G6(e){return e.isBoundToModule}(a)?void 0:this._injector.get(Bs),u=a.create(qt.NULL,[],i||a.selector,c),d=u.location.nativeElement,f=u.injector.get(B1,null);return f?.registerApplication(d),u.onDestroy(()=>{this.detachView(u.hostView),Ff(this.components,u),f?.unregisterApplication(d)}),this._loadComponent(u),u}tick(){this._tick(!0)}_tick(r){if(this._runningTick)throw new M(101,!1);const i=me(null);try{this._runningTick=!0,this.detectChangesInAttachedViews(r)}catch(s){this.internalErrorHandler(s)}finally{this.afterTick.next(),this._runningTick=!1,me(i)}}detectChangesInAttachedViews(r){let i=0;const s=this.afterRenderEffectManager;for(;;){if(i===XC)throw new M(103,!1);if(r){const o=0===i;this.beforeRender.next(o);for(let{_lView:a,notifyErrorHandler:c}of this._views)Z6(a,o,c)}if(i++,s.executeInternalCallbacks(),![...this.externalTestViews.keys(),...this._views].some(({_lView:o})=>hv(o))&&(s.execute(),![...this.externalTestViews.keys(),...this._views].some(({_lView:o})=>hv(o))))break}}attachView(r){const i=r;this._views.push(i),i.attachToAppRef(this)}detachView(r){const i=r;Ff(this._views,i),i.detachFromAppRef()}_loadComponent(r){this.attachView(r.hostView),this.tick(),this.components.push(r);const i=this._injector.get(fv,[]);[...this._bootstrapListeners,...i].forEach(s=>s(r))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(r=>r()),this._views.slice().forEach(r=>r.destroy())}finally{this._destroyed=!0,this._views=[],this._bootstrapListeners=[],this._destroyListeners=[]}}onDestroy(r){return this._destroyListeners.push(r),()=>Ff(this._destroyListeners,r)}destroy(){if(this._destroyed)throw new M(406,!1);const r=this._injector;r.destroy&&!r.destroyed&&r.destroy()}get viewCount(){return this._views.length}warnIfDestroyed(){}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Ff(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}function Z6(e,t,r){!t&&!hv(e)||function K6(e,t,r){let i;r?(i=0,e[ee]|=1024):i=64&e[ee]?0:1,Jd(e,t,i)}(e,r,t)}function hv(e){return jg(e)}class Q6{constructor(t,r){this.ngModuleFactory=t,this.componentFactories=r}}let H1=(()=>{class e{compileModuleSync(r){return new Cy(r)}compileModuleAsync(r){return Promise.resolve(this.compileModuleSync(r))}compileModuleAndAllComponentsSync(r){const i=this.compileModuleSync(r),o=Rn(jt(r).declarations).reduce((a,c)=>{const l=we(c);return l&&a.push(new ll(l)),a},[]);return new Q6(i,o)}compileModuleAndAllComponentsAsync(r){return Promise.resolve(this.compileModuleAndAllComponentsSync(r))}clearCache(){}clearCacheFor(r){}getModuleId(r){}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),X6=(()=>{class e{constructor(){this.zone=P(Ne),this.applicationRef=P(Br)}initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function e$(){const e=P(Ne),t=P($n);return r=>e.runOutsideAngular(()=>t.handleError(r))}let n$=(()=>{class e{constructor(){this.subscription=new Rt,this.initialized=!1,this.zone=P(Ne),this.pendingTasks=P(Ko)}initialize(){if(this.initialized)return;this.initialized=!0;let r=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(r=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{Ne.assertNotInAngularZone(),queueMicrotask(()=>{null!==r&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(r),r=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{Ne.assertInAngularZone(),r??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const yi=new K("",{providedIn:"root",factory:()=>P(yi,Ee.Optional|Ee.SkipSelf)||function r$(){return typeof $localize<"u"&&$localize.locale||ma}()}),pv=new K("");let W1=(()=>{class e{constructor(r){this._injector=r,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(r,i){const s=function BB(e="zone.js",t){return"noop"===e?new gS:"zone.js"===e?new Ne(t):e}(i?.ngZone,function G1(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:e?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:e?.runCoalescing??!1}}({eventCoalescing:i?.ngZoneEventCoalescing,runCoalescing:i?.ngZoneRunCoalescing}));return s.run(()=>{const o=function A8(e,t,r){return new Dy(e,t,r)}(r.moduleType,this.injector,function q1(e){return[{provide:Ne,useFactory:e},{provide:Is,multi:!0,useFactory:()=>{const t=P(X6,{optional:!0});return()=>t.initialize()}},{provide:Is,multi:!0,useFactory:()=>{const t=P(n$);return()=>{t.initialize()}}},{provide:wD,useFactory:e$}]}(()=>s)),a=o.injector.get($n,null);return s.runOutsideAngular(()=>{const c=s.onError.subscribe({next:l=>{a.handleError(l)}});o.onDestroy(()=>{Ff(this._modules,o),c.unsubscribe()})}),function $1(e,t,r){try{const i=r();return Lf(i)?i.catch(s=>{throw t.runOutsideAngular(()=>e.handleError(s)),s}):i}catch(i){throw t.runOutsideAngular(()=>e.handleError(i)),i}}(a,s,()=>{const c=o.injector.get(dv);return c.runInitializers(),c.donePromise.then(()=>(function iT(e){"string"==typeof e&&(rT=e.toLowerCase().replace(/_/g,"-"))}(o.injector.get(yi,ma)||ma),this._moduleDoBootstrap(o),o))})})}bootstrapModule(r,i=[]){const s=V1({},i);return function J6(e,t,r){const i=new Cy(r);return Promise.resolve(i)}(0,0,r).then(o=>this.bootstrapModuleFactory(o,s))}_moduleDoBootstrap(r){const i=r.injector.get(Br);if(r._bootstrapComponents.length>0)r._bootstrapComponents.forEach(s=>i.bootstrap(s));else{if(!r.instance.ngDoBootstrap)throw new M(-403,!1);r.instance.ngDoBootstrap(i)}this._modules.push(r)}onDestroy(r){this._destroyListeners.push(r)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new M(404,!1);this._modules.slice().forEach(i=>i.destroy()),this._destroyListeners.forEach(i=>i());const r=this._injector.get(pv,null);r&&(r.forEach(i=>i()),r.clear()),this._destroyed=!0}get destroyed(){return this._destroyed}static#e=this.\u0275fac=function(i){return new(i||e)(G(qt))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"platform"})}return e})(),Zi=null;const Z1=new K("");function K1(e,t,r=[]){const i=`Platform: ${t}`,s=new K(i);return(o=[])=>{let a=gv();if(!a||a.injector.get(Z1,!1)){const c=[...r,...o,{provide:s,useValue:!0}];e?e(c):function o$(e){if(Zi&&!Zi.get(Z1,!1))throw new M(400,!1);(function j1(){!function hk(e){Fb=e}(()=>{throw new M(600,!1)})})(),Zi=e;const t=e.get(W1);(function Y1(e){e.get($D,null)?.forEach(r=>r())})(e)}(function Q1(e=[],t){return qt.create({name:t,providers:[{provide:Ig,useValue:"platform"},{provide:pv,useValue:new Set([()=>Zi=null])},...e]})}(c,i))}return function a$(e){const t=gv();if(!t)throw new M(401,!1);return t}()}}function gv(){return Zi?.get(W1)??null}let Uf=(()=>{class e{static#e=this.__NG_ELEMENT_ID__=l$}return e})();function l$(e){return function u$(e,t,r){if(As(e)&&!r){const i=An(e.index,t);return new el(i,i)}return 47&e.type?new el(t[it],t):null}(Be(),N(),!(16&~e))}class nx{constructor(){}supports(t){return gf(t)}create(t){return new g$(t)}}const p$=(e,t)=>t;class g${constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||p$}forEachItem(t){let r;for(r=this._itHead;null!==r;r=r._next)t(r)}forEachOperation(t){let r=this._itHead,i=this._removalsHead,s=0,o=null;for(;r||i;){const a=!i||r&&r.currentIndex{a=this._trackByFn(s,c),null!==r&&Object.is(r.trackById,a)?(i&&(r=this._verifyReinsertion(r,c,a,s)),Object.is(r.item,c)||this._addIdentityChange(r,c)):(r=this._mismatch(r,c,a,s),i=!0),r=r._next,s++}),this.length=s;return this._truncate(r),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=t._nextMoved)t.previousIndex=t.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,r,i,s){let o;return null===t?o=this._itTail:(o=t._prev,this._remove(t)),null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null))?(Object.is(t.item,r)||this._addIdentityChange(t,r),this._reinsertAfter(t,o,s)):null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(i,s))?(Object.is(t.item,r)||this._addIdentityChange(t,r),this._moveAfter(t,o,s)):t=this._addAfter(new m$(r,i),o,s),t}_verifyReinsertion(t,r,i,s){let o=null===this._unlinkedRecords?null:this._unlinkedRecords.get(i,null);return null!==o?t=this._reinsertAfter(o,t._prev,s):t.currentIndex!=s&&(t.currentIndex=s,this._addToMoves(t,s)),t}_truncate(t){for(;null!==t;){const r=t._next;this._addToRemovals(this._unlink(t)),t=r}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,r,i){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const s=t._prevRemoved,o=t._nextRemoved;return null===s?this._removalsHead=o:s._nextRemoved=o,null===o?this._removalsTail=s:o._prevRemoved=s,this._insertAfter(t,r,i),this._addToMoves(t,i),t}_moveAfter(t,r,i){return this._unlink(t),this._insertAfter(t,r,i),this._addToMoves(t,i),t}_addAfter(t,r,i){return this._insertAfter(t,r,i),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,r,i){const s=null===r?this._itHead:r._next;return t._next=s,t._prev=r,null===s?this._itTail=t:s._prev=t,null===r?this._itHead=t:r._next=t,null===this._linkedRecords&&(this._linkedRecords=new rx),this._linkedRecords.put(t),t.currentIndex=i,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const r=t._prev,i=t._next;return null===r?this._itHead=i:r._next=i,null===i?this._itTail=r:i._prev=r,t}_addToMoves(t,r){return t.previousIndex===r||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new rx),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,r){return t.item=r,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class m${constructor(t,r){this.item=t,this.trackById=r,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class y${constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,r){let i;for(i=this._head;null!==i;i=i._nextDup)if((null===r||r<=i.currentIndex)&&Object.is(i.trackById,t))return i;return null}remove(t){const r=t._prevDup,i=t._nextDup;return null===r?this._head=i:r._nextDup=i,null===i?this._tail=r:i._prevDup=r,null===this._head}}class rx{constructor(){this.map=new Map}put(t){const r=t.trackById;let i=this.map.get(r);i||(i=new y$,this.map.set(r,i)),i.add(t)}get(t,r){const s=this.map.get(t);return s?s.get(t,r):null}remove(t){const r=t.trackById;return this.map.get(r).remove(t)&&this.map.delete(r),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function ix(e,t,r){const i=e.previousIndex;if(null===i)return i;let s=0;return r&&i{class e{static#e=this.\u0275prov=z({token:e,providedIn:"root",factory:ox});constructor(r){this.factories=r}static create(r,i){if(null!=i){const s=i.factories.slice();r=r.concat(s)}return new e(r)}static extend(r){return{provide:e,useFactory:i=>e.create(r,i||ox()),deps:[[e,new id,new rd]]}}find(r){const i=this.factories.find(s=>s.supports(r));if(null!=i)return i;throw new M(901,!1)}}return e})();const E$=K1(null,"core",[]);let D$=(()=>{class e{constructor(r){}static#e=this.\u0275fac=function(i){return new(i||e)(G(Br))};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({})}return e})(),Mx=null;function _a(){return Mx}class oV{}const Wt=new K("");let Cv=(()=>{class e{historyGo(r){throw new Error("")}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>P(cV),providedIn:"platform"})}return e})();const aV=new K("");let cV=(()=>{class e extends Cv{constructor(){super(),this._doc=P(Wt),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return _a().getBaseHref(this._doc)}onPopState(r){const i=_a().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",r,!1),()=>i.removeEventListener("popstate",r)}onHashChange(r){const i=_a().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",r,!1),()=>i.removeEventListener("hashchange",r)}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(r){this._location.pathname=r}pushState(r,i,s){this._history.pushState(r,i,s)}replaceState(r,i,s){this._history.replaceState(r,i,s)}forward(){this._history.forward()}back(){this._history.back()}historyGo(r=0){this._history.go(r)}getState(){return this._history.state}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>new e,providedIn:"platform"})}return e})();function Sv(e,t){if(0==e.length)return t;if(0==t.length)return e;let r=0;return e.endsWith("/")&&r++,t.startsWith("/")&&r++,2==r?e+t.substring(1):1==r?e+t:e+"/"+t}function Nx(e){const t=e.match(/#|\?|$/),r=t&&t.index||e.length;return e.slice(0,r-("/"===e[r-1]?1:0))+e.slice(r)}function vi(e){return e&&"?"!==e[0]?"?"+e:e}let qs=(()=>{class e{historyGo(r){throw new Error("")}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>P(Ox),providedIn:"root"})}return e})();const Rx=new K("");let Ox=(()=>{class e extends qs{constructor(r,i){super(),this._platformLocation=r,this._removeListenerFns=[],this._baseHref=i??this._platformLocation.getBaseHrefFromDOM()??P(Wt).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(r){this._removeListenerFns.push(this._platformLocation.onPopState(r),this._platformLocation.onHashChange(r))}getBaseHref(){return this._baseHref}prepareExternalUrl(r){return Sv(this._baseHref,r)}path(r=!1){const i=this._platformLocation.pathname+vi(this._platformLocation.search),s=this._platformLocation.hash;return s&&r?`${i}${s}`:i}pushState(r,i,s,o){const a=this.prepareExternalUrl(s+vi(o));this._platformLocation.pushState(r,i,a)}replaceState(r,i,s,o){const a=this.prepareExternalUrl(s+vi(o));this._platformLocation.replaceState(r,i,a)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}static#e=this.\u0275fac=function(i){return new(i||e)(G(Cv),G(Rx,8))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),lV=(()=>{class e extends qs{constructor(r,i){super(),this._platformLocation=r,this._baseHref="",this._removeListenerFns=[],null!=i&&(this._baseHref=i)}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(r){this._removeListenerFns.push(this._platformLocation.onPopState(r),this._platformLocation.onHashChange(r))}getBaseHref(){return this._baseHref}path(r=!1){const i=this._platformLocation.hash??"#";return i.length>0?i.substring(1):i}prepareExternalUrl(r){const i=Sv(this._baseHref,r);return i.length>0?"#"+i:i}pushState(r,i,s,o){let a=this.prepareExternalUrl(s+vi(o));0==a.length&&(a=this._platformLocation.pathname),this._platformLocation.pushState(r,i,a)}replaceState(r,i,s,o){let a=this.prepareExternalUrl(s+vi(o));0==a.length&&(a=this._platformLocation.pathname),this._platformLocation.replaceState(r,i,a)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(r=0){this._platformLocation.historyGo?.(r)}static#e=this.\u0275fac=function(i){return new(i||e)(G(Cv),G(Rx,8))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})(),Ml=(()=>{class e{constructor(r){this._subject=new rn,this._urlChangeListeners=[],this._urlChangeSubscription=null,this._locationStrategy=r;const i=this._locationStrategy.getBaseHref();this._basePath=function fV(e){if(new RegExp("^(https?:)?//").test(e)){const[,r]=e.split(/\/\/[^\/]+/);return r}return e}(Nx(kx(i))),this._locationStrategy.onPopState(s=>{this._subject.emit({url:this.path(!0),pop:!0,state:s.state,type:s.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(r=!1){return this.normalize(this._locationStrategy.path(r))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(r,i=""){return this.path()==this.normalize(r+vi(i))}normalize(r){return e.stripTrailingSlash(function dV(e,t){if(!e||!t.startsWith(e))return t;const r=t.substring(e.length);return""===r||["/",";","?","#"].includes(r[0])?r:t}(this._basePath,kx(r)))}prepareExternalUrl(r){return r&&"/"!==r[0]&&(r="/"+r),this._locationStrategy.prepareExternalUrl(r)}go(r,i="",s=null){this._locationStrategy.pushState(s,"",r,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+vi(i)),s)}replaceState(r,i="",s=null){this._locationStrategy.replaceState(s,"",r,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(r+vi(i)),s)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(r=0){this._locationStrategy.historyGo?.(r)}onUrlChange(r){return this._urlChangeListeners.push(r),this._urlChangeSubscription??=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}),()=>{const i=this._urlChangeListeners.indexOf(r);this._urlChangeListeners.splice(i,1),0===this._urlChangeListeners.length&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(r="",i){this._urlChangeListeners.forEach(s=>s(r,i))}subscribe(r,i,s){return this._subject.subscribe({next:r,error:i,complete:s})}static#e=this.normalizeQueryParams=vi;static#t=this.joinWithSlash=Sv;static#r=this.stripTrailingSlash=Nx;static#h=this.\u0275fac=function(i){return new(i||e)(G(qs))};static#T=this.\u0275prov=z({token:e,factory:()=>function uV(){return new Ml(G(qs))}(),providedIn:"root"})}return e})();function kx(e){return e.replace(/\/index.html$/,"")}class XV{constructor(t,r,i,s){this.$implicit=t,this.ngForOf=r,this.index=i,this.count=s}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}let qx=(()=>{class e{set ngForOf(r){this._ngForOf=r,this._ngForOfDirty=!0}set ngForTrackBy(r){this._trackByFn=r}get ngForTrackBy(){return this._trackByFn}constructor(r,i,s){this._viewContainer=r,this._template=i,this._differs=s,this._ngForOf=null,this._ngForOfDirty=!0,this._differ=null}set ngForTemplate(r){r&&(this._template=r)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const r=this._ngForOf;!this._differ&&r&&(this._differ=this._differs.find(r).create(this.ngForTrackBy))}if(this._differ){const r=this._differ.diff(this._ngForOf);r&&this._applyChanges(r)}}_applyChanges(r){const i=this._viewContainer;r.forEachOperation((s,o,a)=>{if(null==s.previousIndex)i.createEmbeddedView(this._template,new XV(s.item,this._ngForOf,-1,-1),null===a?void 0:a);else if(null==a)i.remove(null===o?void 0:o);else if(null!==o){const c=i.get(o);i.move(c,a),Gx(c,s)}});for(let s=0,o=i.length;s{Gx(i.get(s.currentIndex),s)})}static ngTemplateContextGuard(r,i){return!0}static#e=this.\u0275fac=function(i){return new(i||e)(X(or),X(pi),X(_v))};static#t=this.\u0275dir=Xt({type:e,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"},standalone:!0})}return e})();function Gx(e,t){e.context.$implicit=t.item}let sh=(()=>{class e{constructor(r,i){this._viewContainer=r,this._context=new e5,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=i}set ngIf(r){this._context.$implicit=this._context.ngIf=r,this._updateView()}set ngIfThen(r){Wx("ngIfThen",r),this._thenTemplateRef=r,this._thenViewRef=null,this._updateView()}set ngIfElse(r){Wx("ngIfElse",r),this._elseTemplateRef=r,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 ngTemplateContextGuard(r,i){return!0}static#e=this.\u0275fac=function(i){return new(i||e)(X(or),X(pi))};static#t=this.\u0275dir=Xt({type:e,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"},standalone:!0})}return e})();class e5{constructor(){this.$implicit=null,this.ngIf=null}}function Wx(e,t){if(t&&!t.createEmbeddedView)throw new Error(`${e} must be a TemplateRef, but received '${bt(t)}'.`)}let Ea=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({})}return e})();const Qx="browser";function Yx(e){return"server"===e}let M5=(()=>{class e{static#e=this.\u0275prov=z({token:e,providedIn:"root",factory:()=>function A5(e){return e===Qx}(P(ks))?new N5(P(Wt),window):new O5})}return e})();class N5{constructor(t,r){this.document=t,this.window=r,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return[this.window.scrollX,this.window.scrollY]}scrollToPosition(t){this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){const r=function R5(e,t){const r=e.getElementById(t)||e.getElementsByName(t)[0];if(r)return r;if("function"==typeof e.createTreeWalker&&e.body&&"function"==typeof e.body.attachShadow){const i=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT);let s=i.currentNode;for(;s;){const o=s.shadowRoot;if(o){const a=o.getElementById(t)||o.querySelector(`[name="${t}"]`);if(a)return a}s=i.nextNode()}}return null}(this.document,t);r&&(this.scrollToElement(r),r.focus())}setHistoryScrollRestoration(t){this.window.history.scrollRestoration=t}scrollToElement(t){const r=t.getBoundingClientRect(),i=r.left+this.window.pageXOffset,s=r.top+this.window.pageYOffset,o=this.offset();this.window.scrollTo(i-o[0],s-o[1])}}class O5{setOffset(t){}getScrollPosition(){return[0,0]}scrollToPosition(t){}scrollToAnchor(t){}setHistoryScrollRestoration(t){}}class cH extends oV{constructor(){super(...arguments),this.supportsDOMEvents=!0}}class $v extends cH{static makeCurrent(){!function sV(e){Mx??=e}(new $v)}onAndCancel(t,r,i){return t.addEventListener(r,i),()=>{t.removeEventListener(r,i)}}dispatchEvent(t,r){t.dispatchEvent(r)}remove(t){t.parentNode&&t.parentNode.removeChild(t)}createElement(t,r){return(r=r||this.getDefaultDocument()).createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,r){return"window"===r?window:"document"===r?t:"body"===r?t.body:null}getBaseHref(t){const r=function lH(){return kl=kl||document.querySelector("base"),kl?kl.getAttribute("href"):null}();return null==r?null:function uH(e){return new URL(e,document.baseURI).pathname}(r)}resetBaseElement(){kl=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return function QV(e,t){t=encodeURIComponent(t);for(const r of e.split(";")){const i=r.indexOf("="),[s,o]=-1==i?[r,""]:[r.slice(0,i),r.slice(i+1)];if(s.trim()===t)return decodeURIComponent(o)}return null}(document.cookie,t)}}let kl=null,fH=(()=>{class e{build(){return new XMLHttpRequest}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();const Vv=new K("");let oA=(()=>{class e{constructor(r,i){this._zone=i,this._eventNameToPlugin=new Map,r.forEach(s=>{s.manager=this}),this._plugins=r.slice().reverse()}addEventListener(r,i,s){return this._findPluginFor(i).addEventListener(r,i,s)}getZone(){return this._zone}_findPluginFor(r){let i=this._eventNameToPlugin.get(r);if(i)return i;if(i=this._plugins.find(o=>o.supports(r)),!i)throw new M(5101,!1);return this._eventNameToPlugin.set(r,i),i}static#e=this.\u0275fac=function(i){return new(i||e)(G(Vv),G(Ne))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();class aA{constructor(t){this._doc=t}}const Hv="ng-app-id";let cA=(()=>{class e{constructor(r,i,s,o={}){this.doc=r,this.appId=i,this.nonce=s,this.platformId=o,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=Yx(o),this.resetHostNodes()}addStyles(r){for(const i of r)1===this.changeUsageCount(i,1)&&this.onStyleAdded(i)}removeStyles(r){for(const i of r)this.changeUsageCount(i,-1)<=0&&this.onStyleRemoved(i)}ngOnDestroy(){const r=this.styleNodesInDOM;r&&(r.forEach(i=>i.remove()),r.clear());for(const i of this.getAllStyles())this.onStyleRemoved(i);this.resetHostNodes()}addHost(r){this.hostNodes.add(r);for(const i of this.getAllStyles())this.addStyleToHost(r,i)}removeHost(r){this.hostNodes.delete(r)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(r){for(const i of this.hostNodes)this.addStyleToHost(i,r)}onStyleRemoved(r){const i=this.styleRef;i.get(r)?.elements?.forEach(s=>s.remove()),i.delete(r)}collectServerRenderedStyles(){const r=this.doc.head?.querySelectorAll(`style[${Hv}="${this.appId}"]`);if(r?.length){const i=new Map;return r.forEach(s=>{null!=s.textContent&&i.set(s.textContent,s)}),i}return null}changeUsageCount(r,i){const s=this.styleRef;if(s.has(r)){const o=s.get(r);return o.usage+=i,o.usage}return s.set(r,{usage:i,elements:[]}),i}getStyleElement(r,i){const s=this.styleNodesInDOM,o=s?.get(i);if(o?.parentNode===r)return s.delete(i),o.removeAttribute(Hv),o;{const a=this.doc.createElement("style");return this.nonce&&a.setAttribute("nonce",this.nonce),a.textContent=i,this.platformIsServer&&a.setAttribute(Hv,this.appId),r.appendChild(a),a}}addStyleToHost(r,i){const s=this.getStyleElement(r,i),o=this.styleRef,a=o.get(i)?.elements;a?a.push(s):o.set(i,{elements:[s],usage:1})}resetHostNodes(){const r=this.hostNodes;r.clear(),r.add(this.doc.head)}static#e=this.\u0275fac=function(i){return new(i||e)(G(Wt),G(Nd),G(HD,8),G(ks))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();const zv={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/MathML/"},qv=/%COMP%/g,mH=new K("",{providedIn:"root",factory:()=>!0});function uA(e,t){return t.map(r=>r.replace(qv,e))}let Gv=(()=>{class e{constructor(r,i,s,o,a,c,l,u=null){this.eventManager=r,this.sharedStylesHost=i,this.appId=s,this.removeStylesOnCompDestroy=o,this.doc=a,this.platformId=c,this.ngZone=l,this.nonce=u,this.rendererByCompId=new Map,this.platformIsServer=Yx(c),this.defaultRenderer=new Wv(r,a,l,this.platformIsServer)}createRenderer(r,i){if(!r||!i)return this.defaultRenderer;this.platformIsServer&&i.encapsulation===Jn.ShadowDom&&(i={...i,encapsulation:Jn.Emulated});const s=this.getOrCreateRenderer(r,i);return s instanceof fA?s.applyToHost(r):s instanceof Zv&&s.applyStyles(),s}getOrCreateRenderer(r,i){const s=this.rendererByCompId;let o=s.get(i.id);if(!o){const a=this.doc,c=this.ngZone,l=this.eventManager,u=this.sharedStylesHost,d=this.removeStylesOnCompDestroy,f=this.platformIsServer;switch(i.encapsulation){case Jn.Emulated:o=new fA(l,u,i,this.appId,d,a,c,f);break;case Jn.ShadowDom:return new _H(l,u,r,i,a,c,this.nonce,f);default:o=new Zv(l,u,i,d,a,c,f)}s.set(i.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}static#e=this.\u0275fac=function(i){return new(i||e)(G(oA),G(cA),G(Nd),G(mH),G(Wt),G(ks),G(Ne),G(HD))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();class Wv{constructor(t,r,i,s){this.eventManager=t,this.doc=r,this.ngZone=i,this.platformIsServer=s,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(t,r){return r?this.doc.createElementNS(zv[r]||r,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,r){(dA(t)?t.content:t).appendChild(r)}insertBefore(t,r,i){t&&(dA(t)?t.content:t).insertBefore(r,i)}removeChild(t,r){t&&t.removeChild(r)}selectRootElement(t,r){let i="string"==typeof t?this.doc.querySelector(t):t;if(!i)throw new M(-5104,!1);return r||(i.textContent=""),i}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,r,i,s){if(s){r=s+":"+r;const o=zv[s];o?t.setAttributeNS(o,r,i):t.setAttribute(r,i)}else t.setAttribute(r,i)}removeAttribute(t,r,i){if(i){const s=zv[i];s?t.removeAttributeNS(s,r):t.removeAttribute(`${i}:${r}`)}else t.removeAttribute(r)}addClass(t,r){t.classList.add(r)}removeClass(t,r){t.classList.remove(r)}setStyle(t,r,i,s){s&(Hi.DashCase|Hi.Important)?t.style.setProperty(r,i,s&Hi.Important?"important":""):t.style[r]=i}removeStyle(t,r,i){i&Hi.DashCase?t.style.removeProperty(r):t.style[r]=""}setProperty(t,r,i){null!=t&&(t[r]=i)}setValue(t,r){t.nodeValue=r}listen(t,r,i){if("string"==typeof t&&!(t=_a().getGlobalEventTarget(this.doc,t)))throw new Error(`Unsupported event target ${t} for event ${r}`);return this.eventManager.addEventListener(t,r,this.decoratePreventDefault(i))}decoratePreventDefault(t){return r=>{if("__ngUnwrap__"===r)return t;!1===(this.platformIsServer?this.ngZone.runGuarded(()=>t(r)):t(r))&&r.preventDefault()}}}function dA(e){return"TEMPLATE"===e.tagName&&void 0!==e.content}class _H extends Wv{constructor(t,r,i,s,o,a,c,l){super(t,o,a,l),this.sharedStylesHost=r,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);const u=uA(s.id,s.styles);for(const d of u){const f=document.createElement("style");c&&f.setAttribute("nonce",c),f.textContent=d,this.shadowRoot.appendChild(f)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,r){return super.appendChild(this.nodeOrShadowRoot(t),r)}insertBefore(t,r,i){return super.insertBefore(this.nodeOrShadowRoot(t),r,i)}removeChild(t,r){return super.removeChild(this.nodeOrShadowRoot(t),r)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}}class Zv extends Wv{constructor(t,r,i,s,o,a,c,l){super(t,o,a,c),this.sharedStylesHost=r,this.removeStylesOnCompDestroy=s,this.styles=l?uA(l,i.styles):i.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}}class fA extends Zv{constructor(t,r,i,s,o,a,c,l){const u=s+"-"+i.id;super(t,r,i,o,a,c,l,u),this.contentAttr=function yH(e){return"_ngcontent-%COMP%".replace(qv,e)}(u),this.hostAttr=function vH(e){return"_nghost-%COMP%".replace(qv,e)}(u)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,r){const i=super.createElement(t,r);return super.setAttribute(i,this.contentAttr,""),i}}let bH=(()=>{class e extends aA{constructor(r){super(r)}supports(r){return!0}addEventListener(r,i,s){return r.addEventListener(i,s,!1),()=>this.removeEventListener(r,i,s)}removeEventListener(r,i,s){return r.removeEventListener(i,s)}static#e=this.\u0275fac=function(i){return new(i||e)(G(Wt))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();const hA=["alt","control","meta","shift"],EH={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},DH={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey};let CH=(()=>{class e extends aA{constructor(r){super(r)}supports(r){return null!=e.parseEventName(r)}addEventListener(r,i,s){const o=e.parseEventName(i),a=e.eventCallback(o.fullKey,s,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>_a().onAndCancel(r,o.domEventName,a))}static parseEventName(r){const i=r.toLowerCase().split("."),s=i.shift();if(0===i.length||"keydown"!==s&&"keyup"!==s)return null;const o=e._normalizeKey(i.pop());let a="",c=i.indexOf("code");if(c>-1&&(i.splice(c,1),a="code."),hA.forEach(u=>{const d=i.indexOf(u);d>-1&&(i.splice(d,1),a+=u+".")}),a+=o,0!=i.length||0===o.length)return null;const l={};return l.domEventName=s,l.fullKey=a,l}static matchEventFullKeyCode(r,i){let s=EH[r.key]||r.key,o="";return i.indexOf("code.")>-1&&(s=r.code,o="code."),!(null==s||!s)&&(s=s.toLowerCase()," "===s?s="space":"."===s&&(s="dot"),hA.forEach(a=>{a!==s&&(0,DH[a])(r)&&(o+=a+".")}),o+=s,o===i)}static eventCallback(r,i,s){return o=>{e.matchEventFullKeyCode(o,r)&&s.runGuarded(()=>i(o))}}static _normalizeKey(r){return"esc"===r?"escape":r}static#e=this.\u0275fac=function(i){return new(i||e)(G(Wt))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();const gA=[{provide:ks,useValue:Qx},{provide:$D,useValue:function SH(){$v.makeCurrent()},multi:!0},{provide:Wt,useFactory:function TH(){return function sF(e){dm=e}(document),document},deps:[]}],xH=K1(E$,"browser",gA),AH=new K(""),mA=[{provide:Pf,useClass:class dH{addToWindow(t){Pe.getAngularTestability=(i,s=!0)=>{const o=t.findTestabilityInTree(i,s);if(null==o)throw new M(5103,!1);return o},Pe.getAllAngularTestabilities=()=>t.getAllTestabilities(),Pe.getAllAngularRootElements=()=>t.getAllRootElements(),Pe.frameworkStabilizers||(Pe.frameworkStabilizers=[]),Pe.frameworkStabilizers.push(i=>{const s=Pe.getAllAngularTestabilities();let o=s.length;const a=function(){o--,0==o&&i()};s.forEach(c=>{c.whenStable(a)})})}findTestabilityInTree(t,r,i){return null==r?null:t.getTestability(r)??(i?_a().isShadowRoot(r)?this.findTestabilityInTree(t,r.host,!0):this.findTestabilityInTree(t,r.parentElement,!0):null)}},deps:[]},{provide:B1,useClass:av,deps:[Ne,cv,Pf]},{provide:av,useClass:av,deps:[Ne,cv,Pf]}],yA=[{provide:Ig,useValue:"root"},{provide:$n,useFactory:function IH(){return new $n},deps:[]},{provide:Vv,useClass:bH,multi:!0,deps:[Wt,Ne,ks]},{provide:Vv,useClass:CH,multi:!0,deps:[Wt]},Gv,cA,oA,{provide:sy,useExisting:Gv},{provide:class k5{},useClass:fH,deps:[]},[]];let vA=(()=>{class e{constructor(r){}static withServerTransition(r){return{ngModule:e,providers:[{provide:Nd,useValue:r.appId}]}}static#e=this.\u0275fac=function(i){return new(i||e)(G(AH,12))};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({providers:[...yA,...mA],imports:[Ea,D$]})}return e})(),MH=(()=>{class e{constructor(r){this._doc=r}getTitle(){return this._doc.title}setTitle(r){this._doc.title=r||""}static#e=this.\u0275fac=function(i){return new(i||e)(G(Wt))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),bA=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:function(i){let s=null;return s=i?new(i||e):G(kH),s},providedIn:"root"})}return e})(),kH=(()=>{class e extends bA{constructor(r){super(),this._doc=r}sanitize(r,i){if(null==i)return null;switch(r){case Nn.NONE:return i;case Nn.HTML:return Mr(i,"HTML")?Mn(i):cC(this._doc,String(i)).toString();case Nn.STYLE:return Mr(i,"Style")?Mn(i):i;case Nn.SCRIPT:if(Mr(i,"Script"))return Mn(i);throw new M(5200,!1);case Nn.URL:return Mr(i,"URL")?Mn(i):jd(String(i));case Nn.RESOURCE_URL:if(Mr(i,"ResourceURL"))return Mn(i);throw new M(5201,!1);default:throw new M(5202,!1)}}bypassSecurityTrustHtml(r){return function IF(e){return new _F(e)}(r)}bypassSecurityTrustStyle(r){return function TF(e){return new bF(e)}(r)}bypassSecurityTrustScript(r){return function xF(e){return new EF(e)}(r)}bypassSecurityTrustUrl(r){return function AF(e){return new DF(e)}(r)}bypassSecurityTrustResourceUrl(r){return function MF(e){return new CF(e)}(r)}static#e=this.\u0275fac=function(i){return new(i||e)(G(Wt))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Kv=(()=>{class e{constructor(){this.wannachatStatusDefaultTimeoutInSeconds=20}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})(),PH=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({providers:[Kv],imports:[Ea]})}return e})();function Qv(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Yv(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Ll(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const Jv="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Xv=e=>e instanceof Uint8Array,e0=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Ur=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function Fl(e){if("string"==typeof e&&(e=function UH(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!Xv(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class SA{clone(){return this._cloneInto()}}function VH(e){const t=i=>e().update(Fl(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function IA(e=32){if(Jv&&"function"==typeof Jv.getRandomValues)return Jv.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}class zH extends SA{constructor(t,r,i,s){super(),this.blockLen=t,this.outputLen=r,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=e0(this.buffer)}update(t){Ll(this);const{view:r,buffer:i,blockLen:s}=this,o=(t=Fl(t)).length;for(let a=0;as-a&&(this.process(i,0),a=0);for(let f=a;f>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)})(i,s-8,BigInt(8*this.length),o),this.process(i,0);const c=e0(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&r,GH=(e,t,r)=>e&t^e&r^t&r,WH=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ki=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Qi=new Uint32Array(64);class TA extends zH{constructor(){super(64,32,8,!1),this.A=0|Ki[0],this.B=0|Ki[1],this.C=0|Ki[2],this.D=0|Ki[3],this.E=0|Ki[4],this.F=0|Ki[5],this.G=0|Ki[6],this.H=0|Ki[7]}get(){const{A:t,B:r,C:i,D:s,E:o,F:a,G:c,H:l}=this;return[t,r,i,s,o,a,c,l]}set(t,r,i,s,o,a,c,l){this.A=0|t,this.B=0|r,this.C=0|i,this.D=0|s,this.E=0|o,this.F=0|a,this.G=0|c,this.H=0|l}process(t,r){for(let f=0;f<16;f++,r+=4)Qi[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=Qi[f-15],p=Qi[f-2],g=Ur(h,7)^Ur(h,18)^h>>>3,m=Ur(p,17)^Ur(p,19)^p>>>10;Qi[f]=m+Qi[f-7]+g+Qi[f-16]|0}let{A:i,B:s,C:o,D:a,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const p=d+(Ur(c,6)^Ur(c,11)^Ur(c,25))+qH(c,l,u)+WH[f]+Qi[f]|0,m=(Ur(i,2)^Ur(i,13)^Ur(i,22))+GH(i,s,o)|0;d=u,u=l,l=c,c=a+p|0,a=o,o=s,s=i,i=p+m|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(i,s,o,a,c,l,u,d)}roundClean(){Qi.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const n0=VH(()=>new TA),lh=(BigInt(0),BigInt(1)),ZH=BigInt(2),uh=e=>e instanceof Uint8Array,KH=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Da(e){if(!uh(e))throw new Error("Uint8Array expected");let t="";for(let r=0;ri+s.length,0));let r=0;return e.forEach(i=>{if(!uh(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}const o0=e=>(ZH<new Uint8Array(e),MA=e=>Uint8Array.from(e);function NA(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let i=a0(e),s=a0(e),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},c=(...f)=>r(s,i,...f),l=(f=a0())=>{s=c(MA([0]),f),i=c(),0!==f.length&&(s=c(MA([1]),f),i=c())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{let p;for(a(),l(f);!(p=h(u()));)l();return a(),p}}const YH={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function Bl(e,t,r={}){const i=(s,o,a)=>{const c=YH[o];if("function"!=typeof c)throw new Error(`Invalid validator "${o}", expected function`);const l=e[s];if(!(a&&void 0===l||c(l,e)))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${o}`)};for(const[s,o]of Object.entries(t))i(s,o,!1);for(const[s,o]of Object.entries(r))i(s,o,!0);return e}const xt=BigInt(0),ze=BigInt(1),Ji=BigInt(2),JH=BigInt(3),c0=BigInt(4),RA=BigInt(5),OA=BigInt(8);function At(e,t){const r=e%t;return r>=xt?r:t+r}function t9(e,t,r){if(r<=xt||t 0");if(r===ze)return xt;let i=ze;for(;t>xt;)t&ze&&(i=i*e%r),e=e*e%r,t>>=ze;return i}function Gn(e,t,r){let i=e;for(;t-- >xt;)i*=i,i%=r;return i}function dh(e,t){if(e===xt||t<=xt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=At(e,t),i=t,s=xt,o=ze,a=ze,c=xt;for(;r!==xt;){const u=i/r,d=i%r,f=s-a*u,h=o-c*u;i=r,r=d,s=a,o=c,a=f,c=h}if(i!==ze)throw new Error("invert: does not exist");return At(s,t)}BigInt(9),BigInt(16);const i9=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function l0(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function kA(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function PA(e){const t=kA(e);return t+Math.ceil(t/2)}class LA extends SA{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,function DA(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Qv(e.outputLen),Qv(e.blockLen)}(t);const i=Fl(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?t.create().update(i).digest():i);for(let a=0;anew LA(e,t).update(r).digest();FA.create=(e,t)=>new LA(e,t);const u9=BigInt(0),u0=BigInt(1);function BA(e){return function s9(e){Bl(e,i9.reduce((i,s)=>(i[s]="function",i),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(e.Fp),Bl(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...l0(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:h9,aT:p9}=gc,Ws={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Ws;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const r=e[1],i=e.subarray(2,r+2);if(!r||i.length!==r)throw new t("Invalid signature integer: wrong length");if(128&i[0])throw new t("Invalid signature integer: negative");if(0===i[0]&&!(128&i[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:h9(i),l:e.subarray(r+2)}},toSig(e){const{Err:t}=Ws,r="string"==typeof e?p9(e):e;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let i=r.length;if(i<2||48!=r[0])throw new t("Invalid signature tag");if(r[1]!==i-2)throw new t("Invalid signature: incorrect length");const{d:s,l:o}=Ws._parseInt(r.subarray(2)),{d:a,l:c}=Ws._parseInt(o);if(c.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(e){const t=u=>8&Number.parseInt(u[0],16)?"00"+u:u,r=u=>{const d=u.toString(16);return 1&d.length?`0${d}`:d},i=t(r(e.s)),s=t(r(e.r)),o=i.length/2,a=s.length/2,c=r(o),l=r(a);return`30${r(a+o+4)}02${l}${s}02${c}${i}`}},dr=BigInt(0),ct=BigInt(1),fh=(BigInt(2),BigInt(3));function y9(e){const t=function m9(e){const t=BA(e);return Bl(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:i}=t,s=r.BYTES+1,o=2*r.BYTES+1;function c(I){return At(I,i)}function l(I){return dh(I,i)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:h}=function g9(e){const t=function f9(e){const t=BA(e);Bl(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:i,a:s}=t;if(r){if(!i.eql(s,i.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,i=t.toBytes||((g,m,y)=>{const v=m.toAffine();return Gs(Uint8Array.from([4]),r.toBytes(v.x),r.toBytes(v.y))}),s=t.fromBytes||(g=>{const m=g.subarray(1);return{x:r.fromBytes(m.subarray(0,r.BYTES)),y:r.fromBytes(m.subarray(r.BYTES,2*r.BYTES))}});function o(g){const{a:m,b:y}=t,v=r.sqr(g),w=r.mul(v,g);return r.add(r.add(w,r.mul(g,m)),y)}if(!r.eql(r.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function a(g){return"bigint"==typeof g&&drr.eql(_,r.ZERO);return w(y)&&w(v)?f.ZERO:new f(y,v,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){const y=r.invertBatch(m.map(v=>v.pz));return m.map((v,w)=>v.toAffine(y[w])).map(f.fromAffine)}static fromHex(m){const y=f.fromAffine(s(Zt("pointHex",m)));return y.assertValidity(),y}static fromPrivateKey(m){return f.BASE.multiply(l(m))}_setWindowSize(m){this._WINDOW_SIZE=m,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:m,y}=this.toAffine();if(!r.isValid(m)||!r.isValid(y))throw new Error("bad point: x or y not FE");const v=r.sqr(y),w=o(m);if(!r.eql(v,w))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:m}=this.toAffine();if(r.isOdd)return!r.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){d(m);const{px:y,py:v,pz:w}=this,{px:_,py:b,pz:C}=m,D=r.eql(r.mul(y,C),r.mul(_,w)),S=r.eql(r.mul(v,C),r.mul(b,w));return D&&S}negate(){return new f(this.px,r.neg(this.py),this.pz)}double(){const{a:m,b:y}=t,v=r.mul(y,fh),{px:w,py:_,pz:b}=this;let C=r.ZERO,D=r.ZERO,S=r.ZERO,T=r.mul(w,w),O=r.mul(_,_),U=r.mul(b,b),B=r.mul(w,_);return B=r.add(B,B),S=r.mul(w,b),S=r.add(S,S),C=r.mul(m,S),D=r.mul(v,U),D=r.add(C,D),C=r.sub(O,D),D=r.add(O,D),D=r.mul(C,D),C=r.mul(B,C),S=r.mul(v,S),U=r.mul(m,U),B=r.sub(T,U),B=r.mul(m,B),B=r.add(B,S),S=r.add(T,T),T=r.add(S,T),T=r.add(T,U),T=r.mul(T,B),D=r.add(D,T),U=r.mul(_,b),U=r.add(U,U),T=r.mul(U,B),C=r.sub(C,T),S=r.mul(U,O),S=r.add(S,S),S=r.add(S,S),new f(C,D,S)}add(m){d(m);const{px:y,py:v,pz:w}=this,{px:_,py:b,pz:C}=m;let D=r.ZERO,S=r.ZERO,T=r.ZERO;const O=t.a,U=r.mul(t.b,fh);let B=r.mul(y,_),j=r.mul(v,b),Y=r.mul(w,C),k=r.add(y,v),I=r.add(_,b);k=r.mul(k,I),I=r.add(B,j),k=r.sub(k,I),I=r.add(y,w);let E=r.add(_,C);return I=r.mul(I,E),E=r.add(B,Y),I=r.sub(I,E),E=r.add(v,w),D=r.add(b,C),E=r.mul(E,D),D=r.add(j,Y),E=r.sub(E,D),T=r.mul(O,I),D=r.mul(U,Y),T=r.add(D,T),D=r.sub(j,T),T=r.add(j,T),S=r.mul(D,T),j=r.add(B,B),j=r.add(j,B),Y=r.mul(O,Y),I=r.mul(U,I),j=r.add(j,Y),Y=r.sub(B,Y),Y=r.mul(O,Y),I=r.add(I,Y),B=r.mul(j,I),S=r.add(S,B),B=r.mul(E,I),D=r.mul(k,D),D=r.sub(D,B),B=r.mul(k,j),T=r.mul(E,T),T=r.add(T,B),new f(D,S,T)}subtract(m){return this.add(m.negate())}is0(){return this.equals(f.ZERO)}wNAF(m){return p.wNAFCached(this,u,m,y=>{const v=r.invertBatch(y.map(w=>w.pz));return y.map((w,_)=>w.toAffine(v[_])).map(f.fromAffine)})}multiplyUnsafe(m){const y=f.ZERO;if(m===dr)return y;if(c(m),m===ct)return this;const{endo:v}=t;if(!v)return p.unsafeLadder(this,m);let{k1neg:w,k1:_,k2neg:b,k2:C}=v.splitScalar(m),D=y,S=y,T=this;for(;_>dr||C>dr;)_&ct&&(D=D.add(T)),C&ct&&(S=S.add(T)),T=T.double(),_>>=ct,C>>=ct;return w&&(D=D.negate()),b&&(S=S.negate()),S=new f(r.mul(S.px,v.beta),S.py,S.pz),D.add(S)}multiply(m){c(m);let v,w,y=m;const{endo:_}=t;if(_){const{k1neg:b,k1:C,k2neg:D,k2:S}=_.splitScalar(y);let{p:T,f:O}=this.wNAF(C),{p:U,f:B}=this.wNAF(S);T=p.constTimeNegate(b,T),U=p.constTimeNegate(D,U),U=new f(r.mul(U.px,_.beta),U.py,U.pz),v=T.add(U),w=O.add(B)}else{const{p:b,f:C}=this.wNAF(y);v=b,w=C}return f.normalizeZ([v,w])[0]}multiplyAndAddUnsafe(m,y,v){const w=f.BASE,_=(C,D)=>D!==dr&&D!==ct&&C.equals(w)?C.multiply(D):C.multiplyUnsafe(D),b=_(this,y).add(_(m,v));return b.is0()?void 0:b}toAffine(m){const{px:y,py:v,pz:w}=this,_=this.is0();null==m&&(m=_?r.ONE:r.inv(w));const b=r.mul(y,m),C=r.mul(v,m),D=r.mul(w,m);if(_)return{x:r.ZERO,y:r.ZERO};if(!r.eql(D,r.ONE))throw new Error("invZ was invalid");return{x:b,y:C}}isTorsionFree(){const{h:m,isTorsionFree:y}=t;if(m===ct)return!0;if(y)return y(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:m,clearCofactor:y}=t;return m===ct?this:y?y(f,this):this.multiplyUnsafe(t.h)}toRawBytes(m=!0){return this.assertValidity(),i(f,this,m)}toHex(m=!0){return Da(this.toRawBytes(m))}}f.BASE=new f(t.Gx,t.Gy,r.ONE),f.ZERO=new f(r.ZERO,r.ONE,r.ZERO);const h=t.nBitLength,p=function d9(e,t){const r=(s,o)=>{const a=o.negate();return s?a:o},i=s=>({windows:Math.ceil(t/s)+1,windowSize:2**(s-1)});return{constTimeNegate:r,unsafeLadder(s,o){let a=e.ZERO,c=s;for(;o>u9;)o&u0&&(a=a.add(c)),c=c.double(),o>>=u0;return a},precomputeWindow(s,o){const{windows:a,windowSize:c}=i(o),l=[];let u=s,d=u;for(let f=0;f>=p,y>l&&(y-=h,a+=u0);const v=m,w=m+Math.abs(y)-1,b=y<0;0===y?d=d.add(r(g%2!=0,o[v])):u=u.add(r(b,o[w]))}return{p:u,f:d}},wNAFCached(s,o,a,c){const l=s._WINDOW_SIZE||1;let u=o.get(s);return u||(u=this.precomputeWindow(s,l),1!==l&&o.set(s,c(u))),this.wNAF(l,u,a)}}}(f,t.endo?Math.ceil(h/2):h);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:a}}({...t,toBytes(I,E,x){const R=E.toAffine(),A=r.toBytes(R.x),H=Gs;return x?H(Uint8Array.from([E.hasEvenY()?2:3]),A):H(Uint8Array.from([4]),A,r.toBytes(R.y))},fromBytes(I){const E=I.length,x=I[0],R=I.subarray(1);if(E!==s||2!==x&&3!==x){if(E===o&&4===x)return{x:r.fromBytes(R.subarray(0,r.BYTES)),y:r.fromBytes(R.subarray(r.BYTES,2*r.BYTES))};throw new Error(`Point of length ${E} was invalid. Expected ${s} compressed bytes or ${o} uncompressed bytes`)}{const A=wn(R);if(!function a(I){return drDa(Yi(I,t.nByteLength));function g(I){return I>i>>ct}const y=(I,E,x)=>wn(I.slice(E,x));class v{constructor(E,x,R){this.r=E,this.s=x,this.recovery=R,this.assertValidity()}static fromCompact(E){const x=t.nByteLength;return E=Zt("compactSignature",E,2*x),new v(y(E,0,x),y(E,x,2*x))}static fromDER(E){const{r:x,s:R}=Ws.toSig(Zt("DER",E));return new v(x,R)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(E){return new v(this.r,this.s,E)}recoverPublicKey(E){const{r:x,s:R,recovery:A}=this,H=S(Zt("msgHash",E));if(null==A||![0,1,2,3].includes(A))throw new Error("recovery id invalid");const Q=2===A||3===A?x+t.n:x;if(Q>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const _e=u.fromHex((1&A?"03":"02")+p(Q)),le=l(Q),lt=c(-H*le),st=c(R*le),Se=u.BASE.multiplyAndAddUnsafe(_e,lt,st);if(!Se)throw new Error("point at infinify");return Se.assertValidity(),Se}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new v(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return Ca(this.toDERHex())}toDERHex(){return Ws.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Ca(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}const w={isValidPrivateKey(I){try{return d(I),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const I=PA(t.n);return function l9(e,t,r=!1){const i=e.length,s=kA(t),o=PA(t);if(i<16||i1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const c=At(r?wn(e):r0(e),t-ze)+ze;return r?s0(c,s):Yi(c,s)}(t.randomBytes(I),t.n)},precompute:(I=8,E=u.BASE)=>(E._setWindowSize(I),E.multiply(BigInt(3)),E)};function b(I){const E=I instanceof Uint8Array,x="string"==typeof I,R=(E||x)&&I.length;return E?R===s||R===o:x?R===2*s||R===2*o:I instanceof u}const D=t.bits2int||function(I){const E=wn(I),x=8*I.length-t.nBitLength;return x>0?E>>BigInt(x):E},S=t.bits2int_modN||function(I){return c(D(I))},T=o0(t.nBitLength);function O(I){if("bigint"!=typeof I)throw new Error("bigint expected");if(!(dr<=I&&IAe in x))throw new Error("sign() legacy options not supported");const{hash:R,randomBytes:A}=t;let{lowS:H,prehash:Q,extraEntropy:J}=x;null==H&&(H=!0),I=Zt("msgHash",I),Q&&(I=Zt("prehashed msgHash",R(I)));const _e=S(I),le=d(E),lt=[O(le),O(_e)];if(null!=J){const Ae=!0===J?A(r.BYTES):J;lt.push(Zt("extraEntropy",Ae))}const st=Gs(...lt),Se=_e;return{seed:st,k2sig:function tt(Ae){const Cn=D(Ae);if(!h(Cn))return;const Bt=l(Cn),Ut=u.BASE.multiply(Cn).toAffine(),br=c(Ut.x);if(br===dr)return;const go=c(Bt*c(Se+br*le));if(go===dr)return;let Vu=(Ut.x===br?0:2)|Number(Ut.y&ct),sk=go;return H&&g(go)&&(sk=function m(I){return g(I)?c(-I):I}(go),Vu^=1),new v(br,sk,Vu)}}}(I,E,x);return NA(t.hash.outputLen,t.nByteLength,t.hmac)(R,A)},verify:function k(I,E,x,R=j){const A=I;if(E=Zt("msgHash",E),x=Zt("publicKey",x),"strict"in R)throw new Error("options.strict was renamed to lowS");const{lowS:H,prehash:Q}=R;let J,_e;try{if("string"==typeof A||A instanceof Uint8Array)try{J=v.fromDER(A)}catch(Ut){if(!(Ut instanceof Ws.Err))throw Ut;J=v.fromCompact(A)}else{if("object"!=typeof A||"bigint"!=typeof A.r||"bigint"!=typeof A.s)throw new Error("PARSE");{const{r:Ut,s:br}=A;J=new v(Ut,br)}}_e=u.fromHex(x)}catch(Ut){if("PARSE"===Ut.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&J.hasHighS())return!1;Q&&(E=t.hash(E));const{r:le,s:lt}=J,st=S(E),Se=l(lt),tt=c(st*Se),Ae=c(le*Se),Cn=u.BASE.multiplyAndAddUnsafe(_e,tt,Ae)?.toAffine();return!!Cn&&c(Cn.x)===le},ProjectivePoint:u,Signature:v,utils:w}}function w9(e){return{hash:e,hmac:(t,...r)=>FA(e,t,function jH(...e){const t=new Uint8Array(e.reduce((i,s)=>i+s.length,0));let r=0;return e.forEach(i=>{if(!Xv(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}(...r)),randomBytes:IA}}BigInt(4);const hh=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),ph=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),jA=BigInt(1),gh=BigInt(2),$A=(e,t)=>(e+t/gh)/t;function VA(e){const t=hh,r=BigInt(3),i=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),c=BigInt(44),l=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=Gn(d,r,t)*d%t,h=Gn(f,r,t)*d%t,p=Gn(h,gh,t)*u%t,g=Gn(p,s,t)*p%t,m=Gn(g,o,t)*g%t,y=Gn(m,c,t)*m%t,v=Gn(y,l,t)*y%t,w=Gn(v,c,t)*m%t,_=Gn(w,r,t)*d%t,b=Gn(_,a,t)*g%t,C=Gn(b,i,t)*u%t,D=Gn(C,gh,t);if(!d0.eql(d0.sqr(D),e))throw new Error("Cannot find square root");return D}const d0=function c9(e,t,r=!1,i={}){if(e<=xt)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:o}=l0(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=function r9(e){if(e%c0===JH){const t=(e+ze)/c0;return function(i,s){const o=i.pow(s,t);if(!i.eql(i.sqr(o),s))throw new Error("Cannot find square root");return o}}if(e%OA===RA){const t=(e-RA)/OA;return function(i,s){const o=i.mul(s,Ji),a=i.pow(o,t),c=i.mul(s,a),l=i.mul(i.mul(c,Ji),a),u=i.mul(c,i.sub(l,i.ONE));if(!i.eql(i.sqr(u),s))throw new Error("Cannot find square root");return u}}return function n9(e){const t=(e-ze)/Ji;let r,i,s;for(r=e-ze,i=0;r%Ji===xt;r/=Ji,i++);for(s=Ji;sAt(l,e),isValid:l=>{if("bigint"!=typeof l)throw new Error("Invalid field element: expected bigint, got "+typeof l);return xt<=l&&ll===xt,isOdd:l=>(l&ze)===ze,neg:l=>At(-l,e),eql:(l,u)=>l===u,sqr:l=>At(l*l,e),add:(l,u)=>At(l+u,e),sub:(l,u)=>At(l-u,e),mul:(l,u)=>At(l*u,e),pow:(l,u)=>function o9(e,t,r){if(r 0");if(r===xt)return e.ONE;if(r===ze)return t;let i=e.ONE,s=t;for(;r>xt;)r&ze&&(i=e.mul(i,s)),s=e.sqr(s),r>>=ze;return i}(c,l,u),div:(l,u)=>At(l*dh(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>dh(l,e),sqrt:i.sqrt||(l=>a(c,l)),invertBatch:l=>function a9(e,t){const r=new Array(t.length),i=t.reduce((o,a,c)=>e.is0(a)?o:(r[c]=o,e.mul(o,a)),e.ONE),s=e.inv(i);return t.reduceRight((o,a,c)=>e.is0(a)?o:(r[c]=e.mul(o,r[c]),e.mul(o,a)),s),r}(c,l),cmov:(l,u,d)=>d?u:l,toBytes:l=>r?s0(l,o):Yi(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?r0(l):wn(l)}});return Object.freeze(c)}(hh,void 0,void 0,{sqrt:VA}),Sa=function _9(e,t){const r=i=>y9({...e,...w9(i)});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:d0,n:ph,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=ph,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-jA*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=$A(o*e,t),l=$A(-i*e,t);let u=At(e-c*r-l*s,t),d=At(-c*i-l*o,t);const f=u>a,h=d>a;if(f&&(u=t-u),h&&(d=t-d),u>a||d>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:h,k2:d}}}},n0),mh=BigInt(0),HA=e=>"bigint"==typeof e&&mhs.charCodeAt(0)));r=Gs(i,i),zA[e]=r}return n0(Gs(r,...t))}const f0=e=>e.toRawBytes(!0).slice(1),h0=e=>Yi(e,32),p0=e=>At(e,hh),Ul=e=>At(e,ph),g0=Sa.ProjectivePoint;function m0(e){let t=Sa.utils.normPrivateKeyToScalar(e),r=g0.fromPrivateKey(t);return{scalar:r.hasEvenY()?t:Ul(-t),bytes:f0(r)}}function qA(e){if(!HA(e))throw new Error("bad x: need 0 < x < p");const t=p0(e*e);let i=VA(p0(t*e+BigInt(7)));i%gh!==mh&&(i=p0(-i));const s=new g0(e,i,jA);return s.assertValidity(),s}function GA(...e){return Ul(wn(yh("BIP0340/challenge",...e)))}function WA(e,t,r){const i=Zt("signature",e,64),s=Zt("message",t),o=Zt("publicKey",r,32);try{const a=qA(wn(o)),c=wn(i.subarray(0,32));if(!HA(c))return!1;const l=wn(i.subarray(32,64));if(!(e=>"bigint"==typeof e&&mhg0.BASE.multiplyAndAddUnsafe(e,t,r))(a,l,Ul(-u));return!(!d||!d.hasEvenY()||d.toAffine().x!==c)}catch{return!1}}const jl={getPublicKey:function D9(e){return m0(e).bytes},sign:function C9(e,t,r=IA(32)){const i=Zt("message",e),{bytes:s,scalar:o}=m0(t),a=Zt("auxRand",r,32),c=h0(o^wn(yh("BIP0340/aux",a))),l=yh("BIP0340/nonce",c,s,i),u=Ul(wn(l));if(u===mh)throw new Error("sign failed: k is zero");const{bytes:d,scalar:f}=m0(u),h=GA(d,s,i),p=new Uint8Array(64);if(p.set(d,0),p.set(h0(Ul(f+h*o)),32),!WA(p,i,s))throw new Error("sign: Invalid signature produced");return p},verify:WA,utils:{randomPrivateKey:Sa.utils.randomPrivateKey,lift_x:qA,pointToBytes:f0,numberToBytesBE:Yi,bytesToNumberBE:wn,taggedHash:yh,mod:At}},y0="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,v0=e=>e instanceof Uint8Array,w0=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),jr=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");const S9=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function _n(e){if(!v0(e))throw new Error("Uint8Array expected");let t="";for(let r=0;ri+s.length,0));let r=0;return e.forEach(i=>{if(!v0(i))throw new Error("Uint8Array expected");t.set(i,r),r+=i.length}),t}class ZA{clone(){return this._cloneInto()}}function KA(e){const t=i=>e().update(Zs(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function QA(e=32){if(y0&&"function"==typeof y0.getRandomValues)return y0.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function b0(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function YA(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}const $r={number:b0,bool:function A9(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)},bytes:YA,hash:function M9(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");b0(e.outputLen),b0(e.blockLen)},exists:function N9(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")},output:function R9(e,t){YA(e);const r=t.outputLen;if(e.lengths-a&&(this.process(i,0),a=0);for(let f=a;f>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)})(i,s-8,BigInt(8*this.length),o),this.process(i,0);const c=w0(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&r,L9=(e,t,r)=>e&t^e&r^t&r,F9=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),es=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ts=new Uint32Array(64);class JA extends k9{constructor(){super(64,32,8,!1),this.A=0|es[0],this.B=0|es[1],this.C=0|es[2],this.D=0|es[3],this.E=0|es[4],this.F=0|es[5],this.G=0|es[6],this.H=0|es[7]}get(){const{A:t,B:r,C:i,D:s,E:o,F:a,G:c,H:l}=this;return[t,r,i,s,o,a,c,l]}set(t,r,i,s,o,a,c,l){this.A=0|t,this.B=0|r,this.C=0|i,this.D=0|s,this.E=0|o,this.F=0|a,this.G=0|c,this.H=0|l}process(t,r){for(let f=0;f<16;f++,r+=4)ts[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=ts[f-15],p=ts[f-2],g=jr(h,7)^jr(h,18)^h>>>3,m=jr(p,17)^jr(p,19)^p>>>10;ts[f]=m+ts[f-7]+g+ts[f-16]|0}let{A:i,B:s,C:o,D:a,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const p=d+(jr(c,6)^jr(c,11)^jr(c,25))+P9(c,l,u)+F9[f]+ts[f]|0,m=(jr(i,2)^jr(i,13)^jr(i,22))+L9(i,s,o)|0;d=u,u=l,l=c,c=a+p|0,a=o,o=s,s=i,i=p+m|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(i,s,o,a,c,l,u,d)}roundClean(){ts.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class B9 extends JA{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}const $l=KA(()=>new JA);function Ks(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function fr(...e){const t=(s,o)=>a=>s(o(a));return{encode:Array.from(e).reverse().reduce((s,o)=>s?t(s,o.encode):o.encode,void 0),decode:e.reduce((s,o)=>s?t(s,o.decode):o.decode,void 0)}}function Vr(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map(r=>{if(Ks(r),r<0||r>=e.length)throw new Error(`Digit index outside alphabet: ${r} (alphabet: ${e.length})`);return e[r]})},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map(r=>{if("string"!=typeof r)throw new Error(`alphabet.decode: not string element=${r}`);const i=e.indexOf(r);if(-1===i)throw new Error(`Unknown letter: "${r}". Allowed: ${e}`);return i})}}}function Hr(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let r of t)if("string"!=typeof r)throw new Error(`join.encode: non-string input=${r}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function Vl(e,t="="){if(Ks(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let i of r)if("string"!=typeof i)throw new Error(`padding.encode: non-string input=${i}`);for(;r.length*e%8;)r.push(t);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let s of r)if("string"!=typeof s)throw new Error(`padding.decode: non-string input=${s}`);let i=r.length;if(i*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;i>0&&r[i-1]===t;i--)if(!((i-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,i)}}}function XA(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>e(t)}}function eM(e,t,r){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let i=0;const s=[],o=Array.from(e);for(o.forEach(a=>{if(Ks(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,c=!0;for(let l=i;lnew B9);const tM=(e,t)=>t?tM(t,e%t):e,wh=(e,t)=>e+(t-tM(e,t));function E0(e,t,r,i){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(wh(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${wh(t,r)}`);let s=0,o=0;const a=2**r-1,c=[];for(const l of e){if(Ks(l),l>=2**t)throw new Error(`convertRadix2: invalid data word=${l} from=${t}`);if(s=s<32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=r;o-=r)c.push((s>>o-r&a)>>>0);s&=2**o-1}if(s=s<=t)throw new Error("Excess padding");if(!i&&s)throw new Error(`Non-zero padding: ${s}`);return i&&o>0&&c.push(s>>>0),c}function bi(e,t=!1){if(Ks(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(wh(8,e)>32||wh(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!(r instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return E0(Array.from(r),8,e,!t)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(E0(r,e,8,t))}}}function rM(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch{}}}fr(bi(4),Vr("0123456789ABCDEF"),Hr("")),fr(bi(5),Vr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Vl(5),Hr("")),fr(bi(5),Vr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Vl(5),Hr("")),fr(bi(5),Vr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Hr(""),XA(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));const Ei=fr(bi(6),Vr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Vl(6),Hr("")),D0=(fr(bi(6),Vr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Vl(6),Hr("")),e=>fr(function nM(e){return Ks(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return eM(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of strings");return Uint8Array.from(eM(t,e,256))}}}(58),Vr(e),Hr(""))),C0=(D0("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),D0("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),D0("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),fr(Vr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Hr(""))),oM=[996825010,642813549,513874426,1027748829,705979059];function Hl(e){const t=e>>25;let r=(33554431&e)<<5;for(let i=0;i>i&1)&&(r^=oM[i]);return r}function aM(e,t,r=1){const i=e.length;let s=1;for(let o=0;o126)throw new Error(`Invalid prefix (${e})`);s=Hl(s)^a>>5}s=Hl(s);for(let o=0;of)throw new TypeError(`Wrong string length: ${d.length} (${d}). Expected (8..${f})`);const h=d.toLowerCase();if(d!==h&&d!==d.toUpperCase())throw new Error("String must be lowercase or uppercase");const p=(d=h).lastIndexOf("1");if(0===p||-1===p)throw new Error('Letter "1" must be present between prefix and data only');const g=d.slice(0,p),m=d.slice(p+1);if(m.length<6)throw new Error("Data must be at least 6 characters long");const y=C0.decode(m).slice(0,-6),v=aM(g,y,t);if(!m.endsWith(v))throw new Error(`Invalid checksum in ${d}: expected "${v}"`);return{prefix:g,words:y}}return{encode:function a(d,f,h=90){if("string"!=typeof d)throw new Error("bech32.encode prefix should be string, not "+typeof d);if(!Array.isArray(f)||f.length&&"number"!=typeof f[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof f);const p=d.length+7+f.length;if(!1!==h&&p>h)throw new TypeError(`Length ${p} exceeds limit ${h}`);return`${d=d.toLowerCase()}1${C0.encode(f)}${aM(d,f,t)}`},decode:c,decodeToBytes:function u(d){const{prefix:f,words:h}=c(d,!1);return{prefix:f,words:h,bytes:i(h)}},decodeUnsafe:rM(c),fromWords:i,fromWordsUnsafe:o,toWords:s}}const Ta=cM("bech32");function xa(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function S0(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function uM(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function Ce(e,...t){if(!uM(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Qs(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Eh(e,t){Ce(e);const r=t.outputLen;if(e.length{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));const be=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Aa=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw new Error("Non little-endian hardware is not supported");function ns(e){if("string"==typeof e)e=function Y9(e){if("string"!=typeof e)throw new Error("string expected, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e);else{if(!uM(e))throw new Error("Uint8Array expected, got "+typeof e);e=e.slice()}return e}function Dh(e,t){if(e.length!==t.length)return!1;let r=0;for(let i=0;i(Object.assign(t,e),t);function Ys(e,t,r,i){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,i);const s=BigInt(32),o=BigInt(4294967295),a=Number(r>>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)}const x0=new Uint8Array(16),zr=be(x0),e7=(e,t,r,i)=>({s3:r<<31|i>>>1,s2:t<<31|r>>>1,s1:e<<31|t>>>1,s0:e>>>1^225<<24&-(1&i)}),Wn=e=>(e>>>0&255)<<24|(e>>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255;class fM{constructor(t,r){this.blockLen=16,this.outputLen=16,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,Ce(t=ns(t),16);const i=Aa(t);let s=i.getUint32(0,!1),o=i.getUint32(4,!1),a=i.getUint32(8,!1),c=i.getUint32(12,!1);const l=[];for(let g=0;g<128;g++)l.push({s0:Wn(s),s1:Wn(o),s2:Wn(a),s3:Wn(c)}),({s0:s,s1:o,s2:a,s3:c}=e7(s,o,a,c));const u=(e=r||1024)>65536?8:e>1024?4:2;var e;if(![1,2,4,8].includes(u))throw new Error(`ghash: wrong window size=${u}, should be 2, 4 or 8`);this.W=u;const f=128/u,h=this.windowSize=2**u,p=[];for(let g=0;g>>u-b-1&1))continue;const{s0:D,s1:S,s2:T,s3:O}=l[u*g+b];y^=D,v^=S,w^=T,_^=O}p.push({s0:y,s1:v,s2:w,s3:_})}this.t=p}_updateBlock(t,r,i,s){t^=this.s0,r^=this.s1,i^=this.s2,s^=this.s3;const{W:o,t:a,windowSize:c}=this;let l=0,u=0,d=0,f=0;const h=(1<>>8*m&255;for(let v=8/o-1;v>=0;v--){const w=y>>>o*v&h,{s0:_,s1:b,s2:C,s3:D}=a[p*c+w];l^=_,u^=b,d^=C,f^=D,p+=1}}this.s0=l,this.s1=u,this.s2=d,this.s3=f}update(t){t=ns(t),Qs(this);const r=be(t),i=Math.floor(t.length/16),s=t.length%16;for(let o=0;o>>1|r,r=(1&s)<<7}return e[0]^=225&-t,e}((t=ns(t)).slice());super(i,r),i.fill(0)}update(t){t=ns(t),Qs(this);const r=be(t),i=t.length%16,s=Math.floor(t.length/16);for(let o=0;oe(s,i.length).update(ns(i)).digest(),r=e(new Uint8Array(16),0);return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=(i,s)=>e(i,s),t}hM((e,t)=>new fM(e,t)),hM((e,t)=>new r7(e,t)),new Uint8Array(16);const s7=283;function M0(e){return e<<1^s7&-(e>>7)}function Ma(e,t){let r=0;for(;t>0;t>>=1)r^=e&-(1&t),e=M0(e);return r}const N0=(()=>{let e=new Uint8Array(256);for(let r=0,i=1;r<256;r++,i^=M0(i))e[r]=i;const t=new Uint8Array(256);t[0]=99;for(let r=0;r<255;r++){let i=e[255-r];i|=i<<8,t[e[r]]=255&(i^i>>4^i>>5^i>>6^i>>7^99)}return t})(),o7=N0.map((e,t)=>N0.indexOf(t)),a7=e=>e<<24|e>>>8,R0=e=>e<<8|e>>>24;function gM(e,t){if(256!==e.length)throw new Error("Wrong sbox length");const r=new Uint32Array(256).map((u,d)=>t(e[d])),i=r.map(R0),s=i.map(R0),o=s.map(R0),a=new Uint32Array(65536),c=new Uint32Array(65536),l=new Uint16Array(65536);for(let u=0;u<256;u++)for(let d=0;d<256;d++){const f=256*u+d;a[f]=r[u]^i[d],c[f]=s[u]^o[d],l[f]=e[u]<<8|e[d]}return{sbox:e,sbox2:l,T0:r,T1:i,T2:s,T3:o,T01:a,T23:c}}const O0=gM(N0,e=>Ma(e,3)<<24|e<<16|e<<8|Ma(e,2)),mM=gM(o7,e=>Ma(e,11)<<24|Ma(e,13)<<16|Ma(e,9)<<8|Ma(e,14)),c7=(()=>{const e=new Uint8Array(16);for(let t=0,r=1;t<16;t++,r=M0(r))e[t]=r;return e})();function Si(e){Ce(e);const t=e.length;if(![16,24,32].includes(t))throw new Error(`aes: wrong key size: should be 16, 24 or 32, got: ${t}`);const{sbox2:r}=O0,i=be(e),s=i.length,o=c=>qr(r,c,c,c,c),a=new Uint32Array(t+28);a.set(i);for(let c=s;c6&&c%s==4&&(l=o(l)),a[c]=a[c-s]^l}return a}function is(e,t,r,i,s,o){return e[r<<8&65280|i>>>8&255]^t[s>>>8&65280|o>>>24&255]}function qr(e,t,r,i,s){return e[255&t|65280&r]|e[i>>>16&255|s>>>16&65280]<<16}function bn(e,t,r,i,s){const{sbox2:o,T01:a,T23:c}=O0;let l=0;t^=e[l++],r^=e[l++],i^=e[l++],s^=e[l++];const u=e.length/4-2;for(let g=0;g{const c=Si(t),{b:l,o:u,out:d}=function wM(e,t,r){let i=e.length;const s=i%16;if(!t&&0!==s)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");const o=be(e);if(t){let l=16-s;l||(l=16),i+=l}const a=Na(i,r);return{b:o,o:be(a),out:a}}(o,s,a),f=be(r);let h=f[0],p=f[1],g=f[2],m=f[3],y=0;for(;y+4<=l.length;)h^=l[y+0],p^=l[y+1],g^=l[y+2],m^=l[y+3],({s0:h,s1:p,s2:g,s3:m}=bn(c,h,p,g,m)),u[y++]=h,u[y++]=p,u[y++]=g,u[y++]=m;if(s){const v=function bM(e){const t=new Uint8Array(16),r=be(t);t.set(e);const i=16-e.length;for(let s=16-i;s<16;s++)t[s]=i;return r}(o.subarray(4*y));h^=v[0],p^=v[1],g^=v[2],m^=v[3],({s0:h,s1:p,s2:g,s3:m}=bn(c,h,p,g,m)),u[y++]=h,u[y++]=p,u[y++]=g,u[y++]=m}return c.fill(0),d},decrypt:(o,a)=>{!function vM(e){if(Ce(e),e.length%16!=0)throw new Error("aes/(cbc-ecb).decrypt ciphertext should consist of blocks with size 16")}(o);const c=function k0(e){const t=Si(e),r=t.slice(),i=t.length,{sbox2:s}=O0,{T0:o,T1:a,T2:c,T3:l}=mM;for(let u=0;u>>8&255]^c[f>>>16&255]^l[f>>>24]}return r}(t),l=be(r),u=Na(o.length,a),d=be(o),f=be(u);let h=l[0],p=l[1],g=l[2],m=l[3];for(let y=0;y+4<=d.length;){const v=h,w=p,_=g,b=m;h=d[y+0],p=d[y+1],g=d[y+2],m=d[y+3];const{s0:C,s1:D,s2:S,s3:T}=Sh(c,h,p,g,m);f[y++]=C^v,f[y++]=D^w,f[y++]=S^_,f[y++]=T^b}return c.fill(0),function _M(e,t){if(!t)return e;const r=e.length;if(!r)throw new Error("aes/pcks5: empty ciphertext not allowed");const i=e[r-1];if(i<=0||i>16)throw new Error(`aes/pcks5: wrong padding byte: ${i}`);const s=e.subarray(0,-i);for(let o=0;o255&e[t++]|(255&e[t++])<<8;class d7{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,Ce(t=ns(t),32);const r=Pt(t,0),i=Pt(t,2),s=Pt(t,4),o=Pt(t,6),a=Pt(t,8),c=Pt(t,10),l=Pt(t,12),u=Pt(t,14);this.r[0]=8191&r,this.r[1]=8191&(r>>>13|i<<3),this.r[2]=7939&(i>>>10|s<<6),this.r[3]=8191&(s>>>7|o<<9),this.r[4]=255&(o>>>4|a<<12),this.r[5]=a>>>1&8190,this.r[6]=8191&(a>>>14|c<<2),this.r[7]=8065&(c>>>11|l<<5),this.r[8]=8191&(l>>>8|u<<8),this.r[9]=u>>>5&127;for(let d=0;d<8;d++)this.pad[d]=Pt(t,16+2*d)}process(t,r,i=!1){const s=i?0:2048,{h:o,r:a}=this,c=a[0],l=a[1],u=a[2],d=a[3],f=a[4],h=a[5],p=a[6],g=a[7],m=a[8],y=a[9],v=Pt(t,r+0),w=Pt(t,r+2),_=Pt(t,r+4),b=Pt(t,r+6),C=Pt(t,r+8),D=Pt(t,r+10),S=Pt(t,r+12),T=Pt(t,r+14);let O=o[0]+(8191&v),U=o[1]+(8191&(v>>>13|w<<3)),B=o[2]+(8191&(w>>>10|_<<6)),j=o[3]+(8191&(_>>>7|b<<9)),Y=o[4]+(8191&(b>>>4|C<<12)),k=o[5]+(C>>>1&8191),I=o[6]+(8191&(C>>>14|D<<2)),E=o[7]+(8191&(D>>>11|S<<5)),x=o[8]+(8191&(S>>>8|T<<8)),R=o[9]+(T>>>5|s),A=0,H=A+O*c+U*(5*y)+B*(5*m)+j*(5*g)+Y*(5*p);A=H>>>13,H&=8191,H+=k*(5*h)+I*(5*f)+E*(5*d)+x*(5*u)+R*(5*l),A+=H>>>13,H&=8191;let Q=A+O*l+U*c+B*(5*y)+j*(5*m)+Y*(5*g);A=Q>>>13,Q&=8191,Q+=k*(5*p)+I*(5*h)+E*(5*f)+x*(5*d)+R*(5*u),A+=Q>>>13,Q&=8191;let J=A+O*u+U*l+B*c+j*(5*y)+Y*(5*m);A=J>>>13,J&=8191,J+=k*(5*g)+I*(5*p)+E*(5*h)+x*(5*f)+R*(5*d),A+=J>>>13,J&=8191;let _e=A+O*d+U*u+B*l+j*c+Y*(5*y);A=_e>>>13,_e&=8191,_e+=k*(5*m)+I*(5*g)+E*(5*p)+x*(5*h)+R*(5*f),A+=_e>>>13,_e&=8191;let le=A+O*f+U*d+B*u+j*l+Y*c;A=le>>>13,le&=8191,le+=k*(5*y)+I*(5*m)+E*(5*g)+x*(5*p)+R*(5*h),A+=le>>>13,le&=8191;let lt=A+O*h+U*f+B*d+j*u+Y*l;A=lt>>>13,lt&=8191,lt+=k*c+I*(5*y)+E*(5*m)+x*(5*g)+R*(5*p),A+=lt>>>13,lt&=8191;let st=A+O*p+U*h+B*f+j*d+Y*u;A=st>>>13,st&=8191,st+=k*l+I*c+E*(5*y)+x*(5*m)+R*(5*g),A+=st>>>13,st&=8191;let Se=A+O*g+U*p+B*h+j*f+Y*d;A=Se>>>13,Se&=8191,Se+=k*u+I*l+E*c+x*(5*y)+R*(5*m),A+=Se>>>13,Se&=8191;let tt=A+O*m+U*g+B*p+j*h+Y*f;A=tt>>>13,tt&=8191,tt+=k*d+I*u+E*l+x*c+R*(5*y),A+=tt>>>13,tt&=8191;let Ae=A+O*y+U*m+B*g+j*p+Y*h;A=Ae>>>13,Ae&=8191,Ae+=k*f+I*d+E*u+x*l+R*c,A+=Ae>>>13,Ae&=8191,A=(A<<2)+A|0,A=A+H|0,H=8191&A,A>>>=13,Q+=A,o[0]=H,o[1]=Q,o[2]=J,o[3]=_e,o[4]=le,o[5]=lt,o[6]=st,o[7]=Se,o[8]=tt,o[9]=Ae}finalize(){const{h:t,pad:r}=this,i=new Uint16Array(10);let s=t[1]>>>13;t[1]&=8191;for(let c=2;c<10;c++)t[c]+=s,s=t[c]>>>13,t[c]&=8191;t[0]+=5*s,s=t[0]>>>13,t[0]&=8191,t[1]+=s,s=t[1]>>>13,t[1]&=8191,t[2]+=s,i[0]=t[0]+5,s=i[0]>>>13,i[0]&=8191;for(let c=1;c<10;c++)i[c]=t[c]+s,s=i[c]>>>13,i[c]&=8191;i[9]-=8192;let o=(1^s)-1;for(let c=0;c<10;c++)i[c]&=o;o=~o;for(let c=0;c<10;c++)t[c]=t[c]&o|i[c];t[0]=65535&(t[0]|t[1]<<13),t[1]=65535&(t[1]>>>3|t[2]<<10),t[2]=65535&(t[2]>>>6|t[3]<<7),t[3]=65535&(t[3]>>>9|t[4]<<4),t[4]=65535&(t[4]>>>12|t[5]<<1|t[6]<<14),t[5]=65535&(t[6]>>>2|t[7]<<11),t[6]=65535&(t[7]>>>5|t[8]<<8),t[7]=65535&(t[8]>>>8|t[9]<<5);let a=t[0]+r[0];t[0]=65535&a;for(let c=1;c<8;c++)a=(t[c]+r[c]|0)+(a>>>16)|0,t[c]=65535&a}update(t){Qs(this);const{buffer:r,blockLen:i}=this,s=(t=ns(t)).length;for(let o=0;o>>0,t[o++]=i[a]>>>8;return t}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const i=t.slice(0,r);return this.destroy(),i}}const h7=function f7(e){const t=(i,s)=>e(s).update(ns(i)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=i=>e(i),t}(e=>new d7(e)),SM=e=>Uint8Array.from(e.split("").map(t=>t.charCodeAt(0))),p7=SM("expand 16-byte k"),g7=SM("expand 32-byte k"),m7=be(p7),IM=be(g7);function Z(e,t){return e<>>32-t}function P0(e){return e.byteOffset%4==0}IM.slice();const TM=2**32-1,xM=new Uint32Array;function zl(e,t){const{allowShortKeys:r,extendNonceFn:i,counterLength:s,counterRight:o,rounds:a}=function J9(e,t){if(null==t||"object"!=typeof t)throw new Error("options must be defined");return Object.assign(e,t)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw new Error("core must be a function");return xa(s),xa(a),S0(o),S0(r),(c,l,u,d,f=0)=>{Ce(c),Ce(l),Ce(u);const h=u.length;if(d||(d=new Uint8Array(h)),Ce(d),xa(f),f<0||f>=TM)throw new Error("arx: counter overflow");if(d.length=TM)throw new Error("arx: counter overflow");const m=Math.min(64,l-g);if(f&&64===m){const y=g/4;if(g%4!=0)throw new Error("arx: invalid block position");for(let w,v=0;v<16;v++)w=y+v,p[w]=h[w]^d[v];g+=64}else{for(let v,y=0;y0;)p.pop().fill(0);return d}}function ql(e,t,r,i,s,o=20){let a=e[0],c=e[1],l=e[2],u=e[3],d=t[0],f=t[1],h=t[2],p=t[3],g=t[4],m=t[5],y=t[6],v=t[7],w=s,_=r[0],b=r[1],C=r[2],D=a,S=c,T=l,O=u,U=d,B=f,j=h,Y=p,k=g,I=m,E=y,x=v,R=w,A=_,H=b,Q=C;for(let _e=0;_e{e.update(t);const r=t.length%16;r&&e.update(b7.subarray(r))},E7=new Uint8Array(32);function MM(e,t,r,i,s){const o=e(t,r,E7),a=h7.create(o);s&&AM(a,s),AM(a,i);const c=new Uint8Array(16),l=Aa(c);Ys(l,0,BigInt(s?s.length:0),!0),Ys(l,8,BigInt(i.length),!0),a.update(c);const u=a.digest();return o.fill(0),u}const NM=e=>(t,r,i)=>(Ce(t,32),Ce(r),{encrypt:(o,a)=>{const c=o.length,l=c+16;a?Ce(a,l):a=new Uint8Array(l),e(t,r,o,a,1);const u=MM(e,t,r,a.subarray(0,-16),i);return a.set(u,c),a},decrypt:(o,a)=>{const c=o.length,l=c-16;if(c<16)throw new Error("encrypted data must be at least 16 bytes");a?Ce(a,l):a=new Uint8Array(l);const u=o.subarray(0,-16);if(!Dh(o.subarray(-16),MM(e,t,r,u,i)))throw new Error("invalid tag");return e(t,r,u,a,1),a}});NM(L0),NM(_7);class RM extends ZA{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,$r.hash(t);const i=Zs(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?t.create().update(i).digest():i);for(let a=0;anew RM(e,t).update(r).digest();xh.create=(e,t)=>new RM(e,t);const F0=new Uint8Array([0]),kM=new Uint8Array;var D7=Object.defineProperty,gt=(e,t)=>{for(var r in t)D7(e,r,{get:t[r],enumerable:!0})},Js=Symbol("verified"),C7=e=>e instanceof Object;function LM(e){if(!C7(e)||"number"!=typeof e.kind||"string"!=typeof e.content||"number"!=typeof e.created_at||"string"!=typeof e.pubkey||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let t=0;tBM,QueueNode:()=>FM,binarySearch:()=>B0,insertEventIntoAscendingList:()=>T7,insertEventIntoDescendingList:()=>I7,normalizeURL:()=>Oa,utf8Decoder:()=>Gr,utf8Encoder:()=>hr});var Gr=new TextDecoder("utf-8"),hr=new TextEncoder;function Oa(e){-1===e.indexOf("://")&&(e="wss://"+e);let t=new URL(e);return t.pathname=t.pathname.replace(/\/+/g,"/"),t.pathname.endsWith("/")&&(t.pathname=t.pathname.slice(0,-1)),("80"===t.port&&"ws:"===t.protocol||"443"===t.port&&"wss:"===t.protocol)&&(t.port=""),t.searchParams.sort(),t.hash="",t.toString()}function I7(e,t){const[r,i]=B0(e,s=>t.id===s.id?0:t.created_at===s.created_at?-1:s.created_at-t.created_at);return i||e.splice(r,0,t),e}function T7(e,t){const[r,i]=B0(e,s=>t.id===s.id?0:t.created_at===s.created_at?-1:t.created_at-s.created_at);return i||e.splice(r,0,t),e}function B0(e,t){let r=0,i=e.length-1;for(;r<=i;){const s=Math.floor((r+i)/2),o=t(e[s]);if(0===o)return[s,!0];o<0?i=s-1:r=s+1}return[r,!1]}var FM=class{value;next=null;prev=null;constructor(e){this.value=e}},BM=class{first;last;constructor(){this.first=null,this.last=null}enqueue(e){const t=new FM(e);return this.last?this.last===this.first?(this.last=t,this.last.prev=this.first,this.first.next=t):(t.prev=this.last,this.last.next=t,this.last=t):(this.first=t,this.last=t),!0}dequeue(){if(!this.first)return null;if(this.first===this.last){const t=this.first;return this.first=null,this.last=null,t.value}const e=this.first;return this.first=e.next,e.value}};function Ah(e){let t=$l(hr.encode(function A7(e){if(!LM(e))throw new Error("can't serialize event with wrong or missing properties");return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}(e)));return _n(t)}var Mh=new class{generateSecretKey(){return jl.utils.randomPrivateKey()}getPublicKey(e){return _n(jl.getPublicKey(e))}finalizeEvent(e,t){const r=e;return r.pubkey=_n(jl.getPublicKey(t)),r.id=Ah(r),r.sig=_n(jl.sign(Ah(r),t)),r[Js]=!0,r}verifyEvent(e){if("boolean"==typeof e[Js])return e[Js];const t=Ah(e);if(t!==e.id)return e[Js]=!1,!1;try{const r=jl.verify(e.sig,t,e.pubkey);return e[Js]=r,r}catch{return e[Js]=!1,!1}}},M7=Mh.generateSecretKey,UM=Mh.getPublicKey,Zn=Mh.finalizeEvent,ka=Mh.verifyEvent,Kt={};function jM(e){return 1e3<=e&&e<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(e)}function U0(e){return[0,3].includes(e)||1e4<=e&&e<2e4}function $M(e){return 2e4<=e&&e<3e4}function j0(e){return 3e4<=e&&e<4e4}function N7(e){return jM(e)?"regular":U0(e)?"replaceable":$M(e)?"ephemeral":j0(e)?"parameterized":"unknown"}gt(Kt,{Application:()=>Mz,BadgeAward:()=>U7,BadgeDefinition:()=>Dz,BlockedRelaysList:()=>cz,BookmarkList:()=>sz,Bookmarksets:()=>_z,Calendar:()=>Fz,CalendarEventRSVP:()=>Bz,ChannelCreation:()=>VM,ChannelHideMessage:()=>qM,ChannelMessage:()=>zM,ChannelMetadata:()=>HM,ChannelMuteUser:()=>GM,ClassifiedListing:()=>Oz,ClientAuth:()=>WM,CommunitiesList:()=>oz,CommunityDefinition:()=>$z,CommunityPostApproval:()=>Z7,Contacts:()=>P7,CreateOrUpdateProduct:()=>Iz,CreateOrUpdateStall:()=>Sz,Curationsets:()=>bz,Date:()=>Pz,DraftClassifiedListing:()=>kz,DraftLong:()=>xz,Emojisets:()=>Az,EncryptedDirectMessage:()=>L7,EncryptedDirectMessages:()=>F7,EventDeletion:()=>B7,FileMetadata:()=>V7,FileServerPreference:()=>fz,Followsets:()=>yz,GenericRepost:()=>j7,Genericlists:()=>vz,HTTPAuth:()=>H0,Handlerinformation:()=>jz,Handlerrecommendation:()=>Uz,Highlights:()=>tz,InterestsList:()=>uz,Interestsets:()=>Cz,JobFeedback:()=>Y7,JobRequest:()=>K7,JobResult:()=>Q7,Label:()=>W7,LightningPubRPC:()=>pz,LiveChatMessage:()=>H7,LiveEvent:()=>Nz,LongFormArticle:()=>Tz,Metadata:()=>R7,Mutelist:()=>nz,NWCWalletInfo:()=>hz,NWCWalletRequest:()=>ZM,NWCWalletResponse:()=>gz,NostrConnect:()=>mz,OpenTimestamps:()=>$7,Pinlist:()=>rz,ProblemTracker:()=>z7,ProfileBadges:()=>Ez,PublicChatsList:()=>az,Reaction:()=>V0,RecommendRelay:()=>k7,RelayList:()=>iz,Relaysets:()=>wz,Report:()=>q7,Reporting:()=>G7,Repost:()=>$0,SearchRelaysList:()=>lz,ShortTextNote:()=>O7,Time:()=>Lz,UserEmojiList:()=>dz,UserStatuses:()=>Rz,Zap:()=>ez,ZapGoal:()=>J7,ZapRequest:()=>X7,classifyKind:()=>N7,isEphemeralKind:()=>$M,isParameterizedReplaceableKind:()=>j0,isRegularKind:()=>jM,isReplaceableKind:()=>U0});var R7=0,O7=1,k7=2,P7=3,L7=4,F7=4,B7=5,$0=6,V0=7,U7=8,j7=16,VM=40,HM=41,zM=42,qM=43,GM=44,$7=1040,V7=1063,H7=1311,z7=1971,q7=1984,G7=1984,W7=1985,Z7=4550,K7=5999,Q7=6999,Y7=7e3,J7=9041,X7=9734,ez=9735,tz=9802,nz=1e4,rz=10001,iz=10002,sz=10003,oz=10004,az=10005,cz=10006,lz=10007,uz=10015,dz=10030,fz=10096,hz=13194,pz=21e3,WM=22242,ZM=23194,gz=23195,mz=24133,H0=27235,yz=3e4,vz=30001,wz=30002,_z=30003,bz=30004,Ez=30008,Dz=30009,Cz=30015,Sz=30017,Iz=30018,Tz=30023,xz=30024,Az=30030,Mz=30078,Nz=30311,Rz=30315,Oz=30402,kz=30403,Pz=31922,Lz=31923,Fz=31924,Bz=31925,Uz=31989,jz=31990,$z=34550;function Vz(e,t){if(e.ids&&-1===e.ids.indexOf(t.id)||e.kinds&&-1===e.kinds.indexOf(t.kind)||e.authors&&-1===e.authors.indexOf(t.pubkey))return!1;for(let r in e)if("#"===r[0]){let s=e[`#${r.slice(1)}`];if(s&&!t.tags.find(([o,a])=>o===r.slice(1)&&-1!==s.indexOf(a)))return!1}return!(e.since&&t.created_ate.until)}function Nh(e,t){for(let r=0;rU0(t))?e.authors.length*e.kinds.length:1/0,e.authors?.length&&e.kinds?.every(t=>j0(t))&&e["#d"]?.length?e.authors.length*e.kinds.length*e["#d"].length:1/0)}function Rh(e,t){let r=t.length+3,i=e.indexOf(`"${t}":`)+r,s=e.slice(i).indexOf('"')+i+1;return e.slice(s,s+64)}function QM(e,t){let r=t.length,i=e.indexOf(`"${t}":`)+r+3,s=e.slice(i),o=Math.min(s.indexOf(","),s.indexOf("}"));return parseInt(s.slice(0,o),10)}function YM(e){let t=e.slice(0,22).indexOf('"EVENT"');if(-1===t)return null;let r=e.slice(t+7+1).indexOf('"');if(-1===r)return null;let i=t+7+1+r,s=e.slice(i+1,80).indexOf('"');return-1===s?null:e.slice(i+1,i+1+s)}function zz(e,t){return t===Rh(e,"id")}function qz(e,t){return t===Rh(e,"pubkey")}function Gz(e,t){return t===QM(e,"kind")}function JM(e,t){return{kind:WM,created_at:Math.floor(Date.now()/1e3),tags:[["relay",e],["challenge",t]],content:""}}gt({},{getHex64:()=>Rh,getInt:()=>QM,getSubscriptionId:()=>YM,matchEventId:()=>zz,matchEventKind:()=>Gz,matchEventPubkey:()=>qz}),gt({},{makeAuthEvent:()=>JM});try{WebSocket}catch{}try{WebSocket}catch{}var Gl={};gt(Gl,{BECH32_REGEX:()=>tN,Bech32MaxSize:()=>G0,decode:()=>Wl,encodeBytes:()=>kh,naddrEncode:()=>sq,neventEncode:()=>iq,noteEncode:()=>nq,nprofileEncode:()=>rq,npubEncode:()=>tq,nrelayEncode:()=>oq,nsecEncode:()=>eq});var G0=5e3,tN=/[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}/;function Wl(e){let{prefix:t,words:r}=Ta.decode(e,G0),i=new Uint8Array(Ta.fromWords(r));switch(t){case"nprofile":{let s=Oh(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for nprofile");if(32!==s[0][0].length)throw new Error("TLV 0 should be 32 bytes");return{type:"nprofile",data:{pubkey:_n(s[0][0]),relays:s[1]?s[1].map(o=>Gr.decode(o)):[]}}}case"nevent":{let s=Oh(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for nevent");if(32!==s[0][0].length)throw new Error("TLV 0 should be 32 bytes");if(s[2]&&32!==s[2][0].length)throw new Error("TLV 2 should be 32 bytes");if(s[3]&&4!==s[3][0].length)throw new Error("TLV 3 should be 4 bytes");return{type:"nevent",data:{id:_n(s[0][0]),relays:s[1]?s[1].map(o=>Gr.decode(o)):[],author:s[2]?.[0]?_n(s[2][0]):void 0,kind:s[3]?.[0]?parseInt(_n(s[3][0]),16):void 0}}}case"naddr":{let s=Oh(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for naddr");if(!s[2]?.[0])throw new Error("missing TLV 2 for naddr");if(32!==s[2][0].length)throw new Error("TLV 2 should be 32 bytes");if(!s[3]?.[0])throw new Error("missing TLV 3 for naddr");if(4!==s[3][0].length)throw new Error("TLV 3 should be 4 bytes");return{type:"naddr",data:{identifier:Gr.decode(s[0][0]),pubkey:_n(s[2][0]),kind:parseInt(_n(s[3][0]),16),relays:s[1]?s[1].map(o=>Gr.decode(o)):[]}}}case"nrelay":{let s=Oh(i);if(!s[0]?.[0])throw new Error("missing TLV 0 for nrelay");return{type:"nrelay",data:Gr.decode(s[0][0])}}case"nsec":return{type:t,data:i};case"npub":case"note":return{type:t,data:_n(i)};default:throw new Error(`unknown prefix ${t}`)}}function Oh(e){let t={},r=e;for(;r.length>0;){let i=r[0],s=r[1],o=r.slice(2,2+s);if(r=r.slice(2+s),o.lengthhr.encode(r))}))}function iq(e){let t;return void 0!==e.kind&&(t=function Xz(e){const t=new Uint8Array(4);return t[0]=e>>24&255,t[1]=e>>16&255,t[2]=e>>8&255,t[3]=255&e,t}(e.kind)),Zl("nevent",Ph({0:[Ia(e.id)],1:(e.relays||[]).map(i=>hr.encode(i)),2:e.author?[Ia(e.author)]:[],3:t?[new Uint8Array(t)]:[]}))}function sq(e){let t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e.kind,!1),Zl("naddr",Ph({0:[hr.encode(e.identifier)],1:(e.relays||[]).map(i=>hr.encode(i)),2:[Ia(e.pubkey)],3:[new Uint8Array(t)]}))}function oq(e){return Zl("nrelay",Ph({0:[hr.encode(e)]}))}function Ph(e){let t=[];return Object.entries(e).reverse().forEach(([r,i])=>{i.forEach(s=>{let o=new Uint8Array(s.length+2);o.set([parseInt(r)],0),o.set([s.length],1),o.set(s,2),t.push(o)})}),vh(...t)}var Kl={};function nN(e,t,r){return W0.apply(this,arguments)}function W0(){return(W0=$(function*(e,t,r){const i=e instanceof Uint8Array?_n(e):e,o=rN(Sa.getSharedSecret(i,"02"+t));let a=Uint8Array.from(QA(16)),c=hr.encode(r),l=EM(o,a).encrypt(c);return`${Ei.encode(new Uint8Array(l))}?iv=${Ei.encode(new Uint8Array(a.buffer))}`})).apply(this,arguments)}function cq(e,t,r){return Z0.apply(this,arguments)}function Z0(){return(Z0=$(function*(e,t,r){const i=e instanceof Uint8Array?_n(e):e;let[s,o]=r.split("?iv="),c=rN(Sa.getSharedSecret(i,"02"+t)),l=Ei.decode(o),u=Ei.decode(s),d=EM(c,l).decrypt(u);return Gr.decode(d)})).apply(this,arguments)}function rN(e){return e.slice(1,33)}gt(Kl,{decrypt:()=>cq,encrypt:()=>nN}),gt({},{NIP05_REGEX:()=>iN,isValid:()=>fq,queryProfile:()=>sN,searchDomain:()=>dq,useFetchImplementation:()=>uq});var Lh,iN=/^(?:([\w.+-]+)@)?([\w_-]+(\.[\w_-]+)+)$/;try{Lh=fetch}catch{}function uq(e){Lh=e}function dq(e){return K0.apply(this,arguments)}function K0(){return(K0=$(function*(e,t=""){try{const r=`https://${e}/.well-known/nostr.json?name=${t}`;return(yield(yield Lh(r,{redirect:"error"})).json()).names}catch{return{}}})).apply(this,arguments)}function sN(e){return Q0.apply(this,arguments)}function Q0(){return(Q0=$(function*(e){const t=e.match(iN);if(!t)return null;const[r,i="_",s]=t;try{const o=`https://${s}/.well-known/nostr.json?name=${i}`,a=yield(yield Lh(o,{redirect:"error"})).json();let c=a.names[i];return c?{pubkey:c,relays:a.relays?.[c]}:null}catch{return null}})).apply(this,arguments)}function fq(e,t){return Y0.apply(this,arguments)}function Y0(){return(Y0=$(function*(e,t){let r=yield sN(t);return!!r&&r.pubkey===e})).apply(this,arguments)}function pq(e){const t={reply:void 0,root:void 0,mentions:[],profiles:[]},r=[];for(const i of e.tags)"e"===i[0]&&i[1]&&r.push(i),"p"===i[0]&&i[1]&&t.profiles.push({pubkey:i[1],relays:i[2]?[i[2]]:[]});for(let i=0;ipq}),gt({},{fetchRelayInformation:()=>yq,useFetchImplementation:()=>mq});try{fetch}catch{}function mq(e){}function yq(e){return J0.apply(this,arguments)}function J0(){return(J0=$(function*(e){return yield(yield fetch(e.replace("ws://","http://").replace("wss://","https://"),{headers:{Accept:"application/nostr+json"}})).json()})).apply(this,arguments)}function aN(e){let t=0;for(let r=0;r=t)break}return i}function bq(e,t,r,i){return Zn({kind:$0,tags:[...e.tags??[],["e",t.id,r],["p",t.pubkey]],content:""===e.content?"":JSON.stringify(t),created_at:e.created_at},i)}function cN(e){if(e.kind!==$0)return;let t,r;for(let i=e.tags.length-1;i>=0&&(void 0===t||void 0===r);i--){const s=e.tags[i];s.length>=2&&("e"===s[0]&&void 0===t?t=s:"p"===s[0]&&void 0===r&&(r=s))}return void 0!==t?{id:t[1],relays:[t[2],r?.[2]].filter(i=>"string"==typeof i),author:r?.[1]}:void 0}function Eq(e,{skipVerification:t}={}){const r=cN(e);if(void 0===r||""===e.content)return;let i;try{i=JSON.parse(e.content)}catch{return}return i.id===r.id&&(t||ka(i))?i:void 0}gt({},{getPow:()=>aN,minePow:()=>wq}),gt({},{finishRepostEvent:()=>bq,getRepostedEvent:()=>Eq,getRepostedEventPointer:()=>cN}),gt({},{NOSTR_URI_REGEX:()=>Fh,parse:()=>Sq,test:()=>Cq});var Fh=new RegExp(`nostr:(${tN.source})`);function Cq(e){return"string"==typeof e&&new RegExp(`^${Fh.source}$`).test(e)}function Sq(e){const t=e.match(new RegExp(`^${Fh.source}$`));if(!t)throw new Error(`Invalid Nostr URI: ${e}`);return{uri:t[0],value:t[1],decoded:Wl(t[1])}}function Tq(e,t,r){const i=t.tags.filter(s=>s.length>=2&&("e"===s[0]||"p"===s[0]));return Zn({...e,kind:V0,tags:[...e.tags??[],...i,["e",t.id],["p",t.pubkey]],content:e.content??"+"},r)}function xq(e){if(e.kind!==V0)return;let t,r;for(let i=e.tags.length-1;i>=0&&(void 0===t||void 0===r);i--){const s=e.tags[i];s.length>=2&&("e"===s[0]&&void 0===t?t=s:"p"===s[0]&&void 0===r&&(r=s))}return void 0!==t&&void 0!==r?{id:t[1],relays:[t[2],r[2]].filter(i=>void 0!==i),author:r[1]}:void 0}gt({},{finishReactionEvent:()=>Tq,getReactedEventPointer:()=>xq}),gt({},{matchAll:()=>Mq,regex:()=>X0,replaceAll:()=>Nq});var X0=()=>new RegExp(`\\b${Fh.source}\\b`,"g");function*Mq(e){const t=e.matchAll(X0());for(const r of t)try{const[i,s]=r;yield{uri:i,value:s,decoded:Wl(s),start:r.index,end:r.index+i.length}}catch{}}function Nq(e,t){return e.replaceAll(X0(),(r,i)=>t({uri:r,value:i,decoded:Wl(i)}))}gt({},{channelCreateEvent:()=>Oq,channelHideMessageEvent:()=>Lq,channelMessageEvent:()=>Pq,channelMetadataEvent:()=>kq,channelMuteUserEvent:()=>Fq});var Oq=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Zn({kind:VM,tags:[...e.tags??[]],content:r,created_at:e.created_at},t)},kq=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Zn({kind:HM,tags:[["e",e.channel_create_event_id],...e.tags??[]],content:r,created_at:e.created_at},t)},Pq=(e,t)=>{const r=[["e",e.channel_create_event_id,e.relay_url,"root"]];return e.reply_to_channel_message_event_id&&r.push(["e",e.reply_to_channel_message_event_id,e.relay_url,"reply"]),Zn({kind:zM,tags:[...r,...e.tags??[]],content:e.content,created_at:e.created_at},t)},Lq=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Zn({kind:qM,tags:[["e",e.channel_message_event_id],...e.tags??[]],content:r,created_at:e.created_at},t)},Fq=(e,t)=>{let r;if("object"==typeof e.content)r=JSON.stringify(e.content);else{if("string"!=typeof e.content)return;r=e.content}return Zn({kind:GM,tags:[["p",e.pubkey_to_mute],...e.tags??[]],content:r,created_at:e.created_at},t)};gt({},{EMOJI_SHORTCODE_REGEX:()=>lN,matchAll:()=>Uq,regex:()=>ew,replaceAll:()=>jq});var tw,lN=/:(\w+):/,ew=()=>new RegExp(`\\B${lN.source}\\B`,"g");function*Uq(e){const t=e.matchAll(ew());for(const r of t)try{const[i,s]=r;yield{shortcode:i,name:s,start:r.index,end:r.index+i.length}}catch{}}function jq(e,t){return e.replaceAll(ew(),(r,i)=>t({shortcode:r,name:i}))}gt({},{useFetchImplementation:()=>Vq,validateGithub:()=>Hq});try{tw=fetch}catch{}function Vq(e){tw=e}function Hq(e,t,r){return nw.apply(this,arguments)}function nw(){return(nw=$(function*(e,t,r){try{return(yield(yield tw(`https://gist.github.com/${t}/${r}/raw`)).text())===`Verifying that I control the following Nostr public key: ${e}`}catch{return!1}})).apply(this,arguments)}gt({},{decrypt:()=>mN,encrypt:()=>gN,getConversationKey:()=>fN,v2:()=>Zq});var uN=1,dN=65535;function fN(e,t){const r=Sa.getSharedSecret(e,"02"+t).subarray(1,33);return function OM(e,t,r){return $r.hash(e),void 0===r&&(r=new Uint8Array(e.outputLen)),xh(e,Zs(r),Zs(t))}($l,r,"nip44-v2")}function hN(e,t){const r=function PM(e,t,r,i=32){if($r.hash(e),$r.number(i),i>255*e.outputLen)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(i/e.outputLen);void 0===r&&(r=kM);const o=new Uint8Array(s*e.outputLen),a=xh.create(e,t),c=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let u=0;udN)throw new Error("invalid plaintext size: must be between 1 and 65535 bytes");const t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!1),t}(r);return vh(i,t,new Uint8Array(rw(r)-r))}(e),c=L0(i,s,a),l=pN(o,c,r);return Ei.encode(vh(new Uint8Array([2]),r,c,l))}function mN(e,t){const{nonce:r,ciphertext:i,mac:s}=function Wq(e){if("string"!=typeof e)throw new Error("payload must be a valid string");const t=e.length;if(t<132||t>87472)throw new Error("invalid payload length: "+t);if("#"===e[0])throw new Error("unknown encryption version");let r;try{r=Ei.decode(e)}catch(o){throw new Error("invalid base64: "+o.message)}const i=r.length;if(i<99||i>65603)throw new Error("invalid data length: "+i);const s=r[0];if(2!==s)throw new Error("unknown encryption version "+s);return{nonce:r.subarray(1,33),ciphertext:r.subarray(33,-32),mac:r.subarray(-32)}}(e),{chacha_key:o,chacha_nonce:a,hmac_key:c}=hN(t,r);if(!Dh(pN(c,i,r),s))throw new Error("invalid MAC");return function Gq(e){const t=new DataView(e.buffer).getUint16(0),r=e.subarray(2,2+t);if(tdN||r.length!==t||e.length!==2+rw(t))throw new Error("invalid padding");return Gr.decode(r)}(L0(o,a,i))}var sw,Zq={utils:{getConversationKey:fN,calcPaddedLen:rw},encrypt:gN,decrypt:mN};function Qq(e){const{pathname:t,searchParams:r}=new URL(e),i=t,s=r.get("relay"),o=r.get("secret");if(!i||!s||!o)throw new Error("invalid connection string");return{pubkey:i,relay:s,secret:o}}function Yq(e,t,r){return iw.apply(this,arguments)}function iw(){return(iw=$(function*(e,t,r){const s=yield nN(t,e,JSON.stringify({method:"pay_invoice",params:{invoice:r}})),o={kind:ZM,created_at:Math.round(Date.now()/1e3),content:s,tags:[["p",e]]};return Zn(o,t)})).apply(this,arguments)}gt({},{makeNwcRequestEvent:()=>Yq,parseConnectionString:()=>Qq}),gt({},{getZapEndpoint:()=>eG,makeZapReceipt:()=>rG,makeZapRequest:()=>tG,useFetchImplementation:()=>Xq,validateZapRequest:()=>nG});try{sw=fetch}catch{}function Xq(e){sw=e}function eG(e){return ow.apply(this,arguments)}function ow(){return(ow=$(function*(e){try{let t="",{lud06:r,lud16:i}=JSON.parse(e.content);if(r){let{words:a}=Ta.decode(r,1e3),c=Ta.fromWords(a);t=Gr.decode(c)}else{if(!i)return null;{let[a,c]=i.split("@");t=new URL(`/.well-known/lnurlp/${a}`,`https://${c}`).toString()}}let o=yield(yield sw(t)).json();if(o.allowsNostr&&o.nostrPubkey)return o.callback}catch{}return null})).apply(this,arguments)}function tG({profile:e,event:t,amount:r,relays:i,comment:s=""}){if(!r)throw new Error("amount not given");if(!e)throw new Error("profile not given");let o={kind:9734,created_at:Math.round(Date.now()/1e3),content:s,tags:[["p",e],["amount",r.toString()],["relays",...i]]};return t&&o.tags.push(["e",t]),o}function nG(e){let t;try{t=JSON.parse(e)}catch{return"Invalid zap request JSON."}if(!LM(t))return"Zap request is not a valid Nostr event.";if(!ka(t))return"Invalid signature on zap request.";let r=t.tags.find(([o,a])=>"p"===o&&a);if(!r)return"Zap request doesn't have a 'p' tag.";if(!r[1].match(/^[a-f0-9]{64}$/))return"Zap request 'p' tag is not valid hex.";let i=t.tags.find(([o,a])=>"e"===o&&a);return i&&!i[1].match(/^[a-f0-9]{64}$/)?"Zap request 'e' tag is not valid hex.":t.tags.find(([o,a])=>"relays"===o&&a)?null:"Zap request doesn't have a 'relays' tag."}function rG({zapRequest:e,preimage:t,bolt11:r,paidAt:i}){let s=JSON.parse(e),o=s.tags.filter(([c])=>"e"===c||"p"===c||"a"===c),a={kind:9735,created_at:Math.round(i.getTime()/1e3),content:"",tags:[...o,["P",s.pubkey],["bolt11",r],["description",e]]};return t&&a.tags.push(["preimage",t]),a}gt({},{getToken:()=>sG,hashPayload:()=>uw,unpackEventFromToken:()=>vN,validateEvent:()=>CN,validateEventKind:()=>_N,validateEventMethodTag:()=>EN,validateEventPayloadTag:()=>DN,validateEventTimestamp:()=>wN,validateEventUrlTag:()=>bN,validateToken:()=>oG});var yN="Nostr ";function sG(e,t,r){return aw.apply(this,arguments)}function aw(){return(aw=$(function*(e,t,r,i=!1,s){const o={kind:H0,tags:[["u",e],["method",t]],created_at:Math.round((new Date).getTime()/1e3),content:""};s&&o.tags.push(["payload",uw(s)]);const a=yield r(o);return(i?yN:"")+Ei.encode(hr.encode(JSON.stringify(a)))})).apply(this,arguments)}function oG(e,t,r){return cw.apply(this,arguments)}function cw(){return(cw=$(function*(e,t,r){const i=yield vN(e).catch(o=>{throw o});return yield CN(i,t,r).catch(o=>{throw o})})).apply(this,arguments)}function vN(e){return lw.apply(this,arguments)}function lw(){return(lw=$(function*(e){if(!e)throw new Error("Missing token");e=e.replace(yN,"");const t=Gr.decode(Ei.decode(e));if(!t||0===t.length||!t.startsWith("{"))throw new Error("Invalid token");return JSON.parse(t)})).apply(this,arguments)}function wN(e){return!!e.created_at&&Math.round((new Date).getTime()/1e3)-e.created_at<60}function _N(e){return e.kind===H0}function bN(e,t){const r=e.tags.find(i=>"u"===i[0]);return!!r&&r.length>0&&r[1]===t}function EN(e,t){const r=e.tags.find(i=>"method"===i[0]);return!!r&&r.length>0&&r[1].toLowerCase()===t.toLowerCase()}function uw(e){return _n($l(hr.encode(JSON.stringify(e))))}function DN(e,t){const r=e.tags.find(s=>"payload"===s[0]);if(!r)return!1;const i=uw(t);return r.length>0&&r[1]===i}function CN(e,t,r,i){return dw.apply(this,arguments)}function dw(){return(dw=$(function*(e,t,r,i){if(!ka(e))throw new Error("Invalid nostr event, signature invalid");if(!_N(e))throw new Error("Invalid nostr event, kind invalid");if(!wN(e))throw new Error("Invalid nostr event, created_at timestamp invalid");if(!bN(e,t))throw new Error("Invalid nostr event, url tag invalid");if(!EN(e,r))throw new Error("Invalid nostr event, method tag invalid");if(i&&"object"==typeof i&&Object.keys(i).length>0&&!DN(e,i))throw new Error("Invalid nostr event, payload tag does not match request body hash");return!0})).apply(this,arguments)}function ss(e){var t,r,i,s=2;for(typeof Symbol<"u"&&(r=Symbol.asyncIterator,i=Symbol.iterator);s--;){if(r&&null!=(t=e[r]))return t.call(e);if(i&&null!=(t=e[i]))return new Uh(t.call(e));r="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")}function Uh(e){function t(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var i=r.done;return Promise.resolve(r.value).then(function(s){return{value:s,done:i}})}return(Uh=function(i){this.s=i,this.n=i.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(i){var s=this.s.return;return void 0===s?Promise.resolve({value:i,done:!0}):t(s.apply(this.s,arguments))},throw:function(i){var s=this.s.return;return void 0===s?Promise.reject(i):t(s.apply(this.s,arguments))}},new Uh(e)}"object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date;const fw="object"==typeof process&&process?process:{};let jh=globalThis.AbortController,TN=globalThis.AbortSignal;if(typeof jh>"u"){TN=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},jh=class{constructor(){t()}signal=new TN;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let e="1"!==fw.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,((e,t,r,i)=>{"function"==typeof fw.emitWarning?fw.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)})("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var AN,MN;Symbol("type"),Symbol,Symbol,AN=Symbol.iterator,MN=Symbol.toStringTag;class Kn{cache;constructor(t){this.cache=t??new Map}get size(){return this.cache.size}add(t){this.#e(t);for(const r of this){if(Kn.deletes(r,t)||Kn.replaces(r,t))return this;Kn.replaces(t,r)&&this.delete(r)}return this.cache.set(t.id,t),this}#e(t){if(5===t.kind)for(const r of t.tags)if("e"===r[0]){const i=this.cache.get(r[1]);i&&i.pubkey===t.pubkey&&this.delete(i)}}clear(){this.cache.clear()}delete(t){return this.cache.delete(t.id)}forEach(t,r){return this.cache.forEach((i,s)=>t(i,i,this),r)}has(t){return this.cache.has(t.id)}*entries(){for(const t of this.values())yield[t,t]}keys(){return this.values()}*values(){for(const t of Kn.sortEvents([...this.cache.values()]))yield t}[AN](){return this.values()}[MN]="NSet";static isReplaceable(t){return[0,3].includes(t)||1e4<=t&&t<2e4}static isParameterizedReplaceable(t){return 3e4<=t&&t<4e4}static replaces(t,r){const{kind:i,pubkey:s}=t;if(Kn.isReplaceable(i))return i===r.kind&&s===r.pubkey&&Kn.sortEvents([t,r])[0]===t;if(Kn.isParameterizedReplaceable(i)){const o=t.tags.find(([c])=>"d"===c)?.[1]||"",a=r.tags.find(([c])=>"d"===c)?.[1]||"";return i===r.kind&&s===r.pubkey&&Kn.sortEvents([t,r])[0]===t&&o===a}return!1}static deletes(t,r){const{kind:i,pubkey:s,tags:o}=t;if(5===i&&s===r.pubkey)for(const[a,c]of o)if("e"===a&&c===r.id)return!0;return!1}static sortEvents(t){return t.sort((r,i)=>r.created_at!==i.created_at?i.created_at-r.created_at:r.id.localeCompare(i.id))}union(t){throw new Error("Method not implemented.")}intersection(t){throw new Error("Method not implemented.")}difference(t){throw new Error("Method not implemented.")}symmetricDifference(t){throw new Error("Method not implemented.")}isSubsetOf(t){throw new Error("Method not implemented.")}isSupersetOf(t){throw new Error("Method not implemented.")}isDisjointFrom(t){throw new Error("Method not implemented.")}}function Fa(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function pr(e,...t){if(!function lG(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function Ql(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}Symbol;const Ba="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Xs=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Wr=(e,t)=>e<<32-t|e>>>t;function kN(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function eo(e){return"string"==typeof e&&(e=kN(e)),pr(e),e}new Uint8Array(new Uint32Array([287454020]).buffer);class PN{clone(){return this._cloneInto()}}function mw(e){const t=i=>e().update(eo(i)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function yG(e=32){if(Ba&&"function"==typeof Ba.getRandomValues)return Ba.getRandomValues(new Uint8Array(e));if(Ba&&"function"==typeof Ba.randomBytes)return Ba.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}class LN extends PN{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,function pw(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Fa(e.outputLen),Fa(e.blockLen)}(t);const i=eo(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(i.length>s?t.create().update(i).digest():i);for(let a=0;anew LN(e,t).update(r).digest();Jl.create=(e,t)=>new LN(e,t);const wG=(e,t,r)=>e&t^~e&r,_G=(e,t,r)=>e&t^e&r^t&r;class yw extends PN{constructor(t,r,i,s){super(),this.blockLen=t,this.outputLen=r,this.padOffset=i,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Xs(this.buffer)}update(t){Ql(this);const{view:r,buffer:i,blockLen:s}=this,o=(t=eo(t)).length;for(let a=0;as-a&&(this.process(i,0),a=0);for(let f=a;f>s&o),c=Number(r&o),u=i?0:4;e.setUint32(t+(i?4:0),a,i),e.setUint32(t+u,c,i)})(i,s-8,BigInt(8*this.length),o),this.process(i,0);const c=Xs(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft)),EG=FN.map(e=>(9*e+5)%16);let vw=[FN],ww=[EG];for(let e=0;e<4;e++)for(let t of[vw,ww])t.push(t[e].map(r=>bG[r]));const AG=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),as=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),cs=new Uint32Array(64);class jN extends yw{constructor(){super(64,32,8,!1),this.A=0|as[0],this.B=0|as[1],this.C=0|as[2],this.D=0|as[3],this.E=0|as[4],this.F=0|as[5],this.G=0|as[6],this.H=0|as[7]}get(){const{A:t,B:r,C:i,D:s,E:o,F:a,G:c,H:l}=this;return[t,r,i,s,o,a,c,l]}set(t,r,i,s,o,a,c,l){this.A=0|t,this.B=0|r,this.C=0|i,this.D=0|s,this.E=0|o,this.F=0|a,this.G=0|c,this.H=0|l}process(t,r){for(let f=0;f<16;f++,r+=4)cs[f]=t.getUint32(r,!1);for(let f=16;f<64;f++){const h=cs[f-15],p=cs[f-2],g=Wr(h,7)^Wr(h,18)^h>>>3,m=Wr(p,17)^Wr(p,19)^p>>>10;cs[f]=m+cs[f-7]+g+cs[f-16]|0}let{A:i,B:s,C:o,D:a,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const p=d+(Wr(c,6)^Wr(c,11)^Wr(c,25))+wG(c,l,u)+AG[f]+cs[f]|0,m=(Wr(i,2)^Wr(i,13)^Wr(i,22))+_G(i,s,o)|0;d=u,u=l,l=c,c=a+p|0,a=o,o=s,s=i,i=p+m|0}i=i+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(i,s,o,a,c,l,u,d)}roundClean(){cs.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const _w=mw(()=>new jN),zh=BigInt(2**32-1),bw=BigInt(32);function $N(e,t=!1){return t?{h:Number(e&zh),l:Number(e>>bw&zh)}:{h:0|Number(e>>bw&zh),l:0|Number(e&zh)}}const ye_split=function MG(e,t=!1){let r=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let s=0;sBigInt(e))),Dw=BigInt(0),Gh=BigInt(1),WG=BigInt(2);function to(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function Xl(e){if(!to(e))throw new Error("Uint8Array expected")}function Ua(e,t){if("boolean"!=typeof t)throw new Error(`${e} must be valid boolean, got "${t}".`)}const ZG=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ja(e){Xl(e);let t="";for(let r=0;r=Ti._0&&e<=Ti._9?e-Ti._0:e>=Ti._A&&e<=Ti._F?e-(Ti._A-10):e>=Ti._a&&e<=Ti._f?e-(Ti._a-10):void 0}function Va(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(r);for(let s=0,o=0;s"bigint"==typeof e&&Dw<=e;function Wh(e,t,r){return Iw(e)&&Iw(t)&&Iw(r)&&t<=e&&eDw;e>>=Gh,t+=1);return t}const Tw=e=>(WG<new Uint8Array(e),qN=e=>Uint8Array.from(e);function GN(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let i=xw(e),s=xw(e),o=0;const a=()=>{i.fill(1),s.fill(0),o=0},c=(...f)=>r(s,i,...f),l=(f=xw())=>{s=c(qN([0]),f),i=c(),0!==f.length&&(s=c(qN([1]),f),i=c())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{let p;for(a(),l(f);!(p=h(u()));)l();return a(),p}}const KG={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||to(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function tu(e,t,r={}){const i=(s,o,a)=>{const c=KG[o];if("function"!=typeof c)throw new Error(`Invalid validator "${o}", expected function`);const l=e[s];if(!(a&&void 0===l||c(l,e)))throw new Error(`Invalid param ${String(s)}=${l} (${typeof l}), expected ${o}`)};for(const[s,o]of Object.entries(t))i(s,o,!1);for(const[s,o]of Object.entries(r))i(s,o,!0);return e}function Aw(e){const t=new WeakMap;return(r,...i)=>{const s=t.get(r);if(void 0!==s)return s;const o=e(r,...i);return t.set(r,o),o}}const Mt=BigInt(0),qe=BigInt(1),ds=BigInt(2),QG=BigInt(3),Mw=BigInt(4),WN=BigInt(5),ZN=BigInt(8);function Lt(e,t){const r=e%t;return r>=Mt?r:t+r}function XG(e,t,r){if(r<=Mt||t 0");if(r===qe)return Mt;let i=qe;for(;t>Mt;)t&qe&&(i=i*e%r),e=e*e%r,t>>=qe;return i}function Qn(e,t,r){let i=e;for(;t-- >Mt;)i*=i,i%=r;return i}function Zh(e,t){if(e===Mt||t<=Mt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Lt(e,t),i=t,s=Mt,o=qe,a=qe,c=Mt;for(;r!==Mt;){const u=i/r,d=i%r,f=s-a*u,h=o-c*u;i=r,r=d,s=a,o=c,a=f,c=h}if(i!==qe)throw new Error("invert: does not exist");return Lt(s,t)}BigInt(9),BigInt(16);const nW=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Nw(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function KN(e,t,r=!1,i={}){if(e<=Mt)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:s,nByteLength:o}=Nw(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=function tW(e){if(e%Mw===QG){const t=(e+qe)/Mw;return function(i,s){const o=i.pow(s,t);if(!i.eql(i.sqr(o),s))throw new Error("Cannot find square root");return o}}if(e%ZN===WN){const t=(e-WN)/ZN;return function(i,s){const o=i.mul(s,ds),a=i.pow(o,t),c=i.mul(s,a),l=i.mul(i.mul(c,ds),a),u=i.mul(c,i.sub(l,i.ONE));if(!i.eql(i.sqr(u),s))throw new Error("Cannot find square root");return u}}return function eW(e){const t=(e-qe)/ds;let r,i,s;for(r=e-qe,i=0;r%ds===Mt;r/=ds,i++);for(s=ds;sLt(l,e),isValid:l=>{if("bigint"!=typeof l)throw new Error("Invalid field element: expected bigint, got "+typeof l);return Mt<=l&&ll===Mt,isOdd:l=>(l&qe)===qe,neg:l=>Lt(-l,e),eql:(l,u)=>l===u,sqr:l=>Lt(l*l,e),add:(l,u)=>Lt(l+u,e),sub:(l,u)=>Lt(l-u,e),mul:(l,u)=>Lt(l*u,e),pow:(l,u)=>function iW(e,t,r){if(r 0");if(r===Mt)return e.ONE;if(r===qe)return t;let i=e.ONE,s=t;for(;r>Mt;)r&qe&&(i=e.mul(i,s)),s=e.sqr(s),r>>=qe;return i}(c,l,u),div:(l,u)=>Lt(l*Zh(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>Zh(l,e),sqrt:i.sqrt||(l=>a(c,l)),invertBatch:l=>function sW(e,t){const r=new Array(t.length),i=t.reduce((o,a,c)=>e.is0(a)?o:(r[c]=o,e.mul(o,a)),e.ONE),s=e.inv(i);return t.reduceRight((o,a,c)=>e.is0(a)?o:(r[c]=e.mul(o,r[c]),e.mul(o,a)),s),r}(c,l),cmov:(l,u,d)=>d?u:l,toBytes:l=>r?Sw(l,o):Ha(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?Cw(l):no(l)}});return Object.freeze(c)}function QN(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function YN(e){const t=QN(e);return t+Math.ceil(t/2)}const cW=BigInt(0),Rw=BigInt(1),Ow=new WeakMap,JN=new WeakMap;function XN(e){return function rW(e){tu(e,nW.reduce((i,s)=>(i[s]="function",i),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}(e.Fp),tu(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Nw(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function eR(e){void 0!==e.lowS&&Ua("lowS",e.lowS),void 0!==e.prehash&&Ua("prehash",e.prehash)}const{Ph:fW,aT:hW}=qp,xi={Err:class extends Error{constructor(t=""){super(t)}},_tlv:{encode:(e,t)=>{const{Err:r}=xi;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");const i=t.length/2,s=$a(i);if(s.length/2&128)throw new r("tlv.encode: long form length too big");const o=i>127?$a(s.length/2|128):"";return`${$a(e)}${o}${s}${t}`},decode(e,t){const{Err:r}=xi;let i=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new r("tlv.decode: wrong tlv");const s=t[i++];let a=0;if(128&s){const l=127&s;if(!l)throw new r("tlv.decode(long): indefinite length not supported");if(l>4)throw new r("tlv.decode(long): byte length is too big");const u=t.subarray(i,i+l);if(u.length!==l)throw new r("tlv.decode: length bytes not complete");if(0===u[0])throw new r("tlv.decode(long): zero leftmost byte");for(const d of u)a=a<<8|d;if(i+=l,a<128)throw new r("tlv.decode(long): not minimal encoding")}else a=s;const c=t.subarray(i,i+a);if(c.length!==a)throw new r("tlv.decode: wrong value length");return{v:c,l:t.subarray(i+a)}}},_int:{encode(e){const{Err:t}=xi;if(e{const w=y.toAffine();return eu(Uint8Array.from([4]),r.toBytes(w.x),r.toBytes(w.y))}),o=t.fromBytes||(m=>{const y=m.subarray(1);return{x:r.fromBytes(y.subarray(0,r.BYTES)),y:r.fromBytes(y.subarray(r.BYTES,2*r.BYTES))}});function a(m){const{a:y,b:v}=t,w=r.sqr(m),_=r.mul(w,m);return r.add(r.add(_,r.mul(m,y)),v)}if(!r.eql(r.sqr(t.Gy),a(t.Gx)))throw new Error("bad generator point: equation left != right");function l(m){const{allowedPrivateKeyLengths:y,nByteLength:v,wrapPrivateKey:w,n:_}=t;if(y&&"bigint"!=typeof m){if(to(m)&&(m=ja(m)),"string"!=typeof m||!y.includes(m.length))throw new Error("Invalid key");m=m.padStart(2*v,"0")}let b;try{b="bigint"==typeof m?m:no(gr("private key",m,v))}catch{throw new Error(`private key must be ${v} bytes, hex or bigint, not ${typeof m}`)}return w&&(b=Lt(b,_)),ro("private key",b,$e,_),b}function u(m){if(!(m instanceof h))throw new Error("ProjectivePoint expected")}const d=Aw((m,y)=>{const{px:v,py:w,pz:_}=m;if(r.eql(_,r.ONE))return{x:v,y:w};const b=m.is0();null==y&&(y=b?r.ONE:r.inv(_));const C=r.mul(v,y),D=r.mul(w,y),S=r.mul(_,y);if(b)return{x:r.ZERO,y:r.ZERO};if(!r.eql(S,r.ONE))throw new Error("invZ was invalid");return{x:C,y:D}}),f=Aw(m=>{if(m.is0()){if(t.allowInfinityPoint&&!r.is0(m.py))return;throw new Error("bad point: ZERO")}const{x:y,y:v}=m.toAffine();if(!r.isValid(y)||!r.isValid(v))throw new Error("bad point: x or y not FE");const w=r.sqr(v),_=a(y);if(!r.eql(w,_))throw new Error("bad point: equation left != right");if(!m.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class h{constructor(y,v,w){if(this.px=y,this.py=v,this.pz=w,null==y||!r.isValid(y))throw new Error("x required");if(null==v||!r.isValid(v))throw new Error("y required");if(null==w||!r.isValid(w))throw new Error("z required");Object.freeze(this)}static fromAffine(y){const{x:v,y:w}=y||{};if(!y||!r.isValid(v)||!r.isValid(w))throw new Error("invalid affine point");if(y instanceof h)throw new Error("projective point not allowed");const _=b=>r.eql(b,r.ZERO);return _(v)&&_(w)?h.ZERO:new h(v,w,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(y){const v=r.invertBatch(y.map(w=>w.pz));return y.map((w,_)=>w.toAffine(v[_])).map(h.fromAffine)}static fromHex(y){const v=h.fromAffine(o(gr("pointHex",y)));return v.assertValidity(),v}static fromPrivateKey(y){return h.BASE.multiply(l(y))}static msm(y,v){return function uW(e,t,r,i){if(!Array.isArray(r)||!Array.isArray(i)||i.length!==r.length)throw new Error("arrays of points and scalars must have equal length");i.forEach((d,f)=>{if(!t.isValid(d))throw new Error(`wrong scalar at index ${f}`)}),r.forEach((d,f)=>{if(!(d instanceof e))throw new Error(`wrong point at index ${f}`)});const s=zN(BigInt(r.length)),o=s>12?s-3:s>4?s-2:s?2:1,a=(1<=0;d-=o){c.fill(e.ZERO);for(let h=0;h>BigInt(d)&BigInt(a));c[g]=c[g].add(r[h])}let f=e.ZERO;for(let h=c.length-1,p=e.ZERO;h>0;h--)p=p.add(c[h]),f=f.add(p);if(u=u.add(f),0!==d)for(let h=0;hmr||D>mr;)b&$e&&(S=S.add(O)),D&$e&&(T=T.add(O)),O=O.double(),b>>=$e,D>>=$e;return _&&(S=S.negate()),C&&(T=T.negate()),T=new h(r.mul(T.px,w.beta),T.py,T.pz),S.add(T)}multiply(y){const{endo:v,n:w}=t;let _,b;if(ro("scalar",y,$e,w),v){const{k1neg:C,k1:D,k2neg:S,k2:T}=v.splitScalar(y);let{p:O,f:U}=this.wNAF(D),{p:B,f:j}=this.wNAF(T);O=g.constTimeNegate(C,O),B=g.constTimeNegate(S,B),B=new h(r.mul(B.px,v.beta),B.py,B.pz),_=O.add(B),b=U.add(j)}else{const{p:C,f:D}=this.wNAF(y);_=C,b=D}return h.normalizeZ([_,b])[0]}multiplyAndAddUnsafe(y,v,w){const _=h.BASE,b=(D,S)=>S!==mr&&S!==$e&&D.equals(_)?D.multiply(S):D.multiplyUnsafe(S),C=b(this,v).add(b(y,w));return C.is0()?void 0:C}toAffine(y){return d(this,y)}isTorsionFree(){const{h:y,isTorsionFree:v}=t;if(y===$e)return!0;if(v)return v(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:y,clearCofactor:v}=t;return y===$e?this:v?v(h,this):this.multiplyUnsafe(t.h)}toRawBytes(y=!0){return Ua("isCompressed",y),this.assertValidity(),s(h,this,y)}toHex(y=!0){return Ua("isCompressed",y),ja(this.toRawBytes(y))}}h.BASE=new h(t.Gx,t.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);const p=t.nBitLength,g=function lW(e,t){const r=(o,a)=>{const c=a.negate();return o?c:a},i=o=>{if(!Number.isSafeInteger(o)||o<=0||o>t)throw new Error(`Wrong window size=${o}, should be [1..${t}]`)},s=o=>(i(o),{windows:Math.ceil(t/o)+1,windowSize:2**(o-1)});return{constTimeNegate:r,unsafeLadder(o,a){let c=e.ZERO,l=o;for(;a>cW;)a&Rw&&(c=c.add(l)),l=l.double(),a>>=Rw;return c},precomputeWindow(o,a){const{windows:c,windowSize:l}=s(a),u=[];let d=o,f=d;for(let h=0;h>=g,v>u&&(v-=p,c+=Rw);const w=y,_=y+Math.abs(v)-1,C=v<0;0===v?f=f.add(r(m%2!=0,a[w])):d=d.add(r(C,a[_]))}return{p:d,f}},wNAFCached(o,a,c){const l=JN.get(o)||1;let u=Ow.get(o);return u||(u=this.precomputeWindow(o,l),1!==l&&Ow.set(o,c(u))),this.wNAF(l,u,a)},setWindowSize(o,a){i(a),JN.set(o,a),Ow.delete(o)}}}(h,t.endo?Math.ceil(p/2):p);return{CURVE:t,ProjectivePoint:h,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:function c(m){return Wh(m,$e,t.n)}}}({...t,toBytes(k,I,E){const x=I.toAffine(),R=r.toBytes(x.x),A=eu;return Ua("isCompressed",E),E?A(Uint8Array.from([I.hasEvenY()?2:3]),R):A(Uint8Array.from([4]),R,r.toBytes(x.y))},fromBytes(k){const I=k.length,E=k[0],x=k.subarray(1);if(I!==s||2!==E&&3!==E){if(I===o&&4===E)return{x:r.fromBytes(x.subarray(0,r.BYTES)),y:r.fromBytes(x.subarray(r.BYTES,2*r.BYTES))};throw new Error(`Point of length ${I} was invalid. Expected ${s} compressed bytes or ${o} uncompressed bytes`)}{const R=no(x);if(!Wh(R,$e,r.ORDER))throw new Error("Point is not on curve");const A=d(R);let H;try{H=r.sqrt(A)}catch(_e){const le=_e instanceof Error?": "+_e.message:"";throw new Error("Point is not on curve"+le)}return!(1&~E)!=((H&$e)===$e)&&(H=r.neg(H)),{x:R,y:H}}}}),h=k=>ja(Ha(k,t.nByteLength));function p(k){return k>i>>$e}const m=(k,I,E)=>no(k.slice(I,E));class y{constructor(I,E,x){this.r=I,this.s=E,this.recovery=x,this.assertValidity()}static fromCompact(I){const E=t.nByteLength;return I=gr("compactSignature",I,2*E),new y(m(I,0,E),m(I,E,2*E))}static fromDER(I){const{r:E,s:x}=xi.toSig(gr("DER",I));return new y(E,x)}assertValidity(){ro("r",this.r,$e,i),ro("s",this.s,$e,i)}addRecoveryBit(I){return new y(this.r,this.s,I)}recoverPublicKey(I){const{r:E,s:x,recovery:R}=this,A=D(gr("msgHash",I));if(null==R||![0,1,2,3].includes(R))throw new Error("recovery id invalid");const H=2===R||3===R?E+t.n:E;if(H>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const J=l.fromHex((1&R?"03":"02")+h(H)),_e=c(H),le=a(-A*_e),lt=a(x*_e),st=l.BASE.multiplyAndAddUnsafe(J,le,lt);if(!st)throw new Error("point at infinify");return st.assertValidity(),st}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Va(this.toDERHex())}toDERHex(){return xi.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Va(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(k){try{return u(k),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const k=YN(t.n);return function aW(e,t,r=!1){const i=e.length,s=QN(t),o=YN(t);if(i<16||i1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const c=Lt(r?no(e):Cw(e),t-qe)+qe;return r?Sw(c,s):Ha(c,s)}(t.randomBytes(k),t.n)},precompute:(k=8,I=l.BASE)=>(I._setWindowSize(k),I.multiply(BigInt(3)),I)};function _(k){const I=to(k),E="string"==typeof k,x=(I||E)&&k.length;return I?x===s||x===o:E?x===2*s||x===2*o:k instanceof l}const C=t.bits2int||function(k){const I=no(k),E=8*k.length-t.nBitLength;return E>0?I>>BigInt(E):I},D=t.bits2int_modN||function(k){return a(C(k))},S=Tw(t.nBitLength);function T(k){return ro(`num < 2^${t.nBitLength}`,k,mr,S),Ha(k,t.nByteLength)}const U={lowS:t.lowS,prehash:!1},B={lowS:t.lowS,prehash:!1};return l.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function w(k,I=!0){return l.fromPrivateKey(k).toRawBytes(I)},getSharedSecret:function b(k,I,E=!0){if(_(k))throw new Error("first arg must be private key");if(!_(I))throw new Error("second arg must be public key");return l.fromHex(I).multiply(u(k)).toRawBytes(E)},sign:function j(k,I,E=U){const{seed:x,k2sig:R}=function O(k,I,E=U){if(["recovered","canonical"].some(tt=>tt in E))throw new Error("sign() legacy options not supported");const{hash:x,randomBytes:R}=t;let{lowS:A,prehash:H,extraEntropy:Q}=E;null==A&&(A=!0),k=gr("msgHash",k),eR(E),H&&(k=gr("prehashed msgHash",x(k)));const J=D(k),_e=u(I),le=[T(_e),T(J)];if(null!=Q&&!1!==Q){const tt=!0===Q?R(r.BYTES):Q;le.push(gr("extraEntropy",tt))}const lt=eu(...le),st=J;return{seed:lt,k2sig:function Se(tt){const Ae=C(tt);if(!f(Ae))return;const Cn=c(Ae),Bt=l.BASE.multiply(Ae).toAffine(),Ut=a(Bt.x);if(Ut===mr)return;const br=a(Cn*a(st+Ut*_e));if(br===mr)return;let go=(Bt.x===Ut?0:2)|Number(Bt.y&$e),Vu=br;return A&&p(br)&&(Vu=function g(k){return p(k)?a(-k):k}(br),go^=1),new y(Ut,Vu,go)}}}(k,I,E);return GN(t.hash.outputLen,t.nByteLength,t.hmac)(x,R)},verify:function Y(k,I,E,x=B){const R=k;if(I=gr("msgHash",I),E=gr("publicKey",E),"strict"in x)throw new Error("options.strict was renamed to lowS");eR(x);const{lowS:A,prehash:H}=x;let Q,J;try{if("string"==typeof R||to(R))try{Q=y.fromDER(R)}catch(Bt){if(!(Bt instanceof xi.Err))throw Bt;Q=y.fromCompact(R)}else{if("object"!=typeof R||"bigint"!=typeof R.r||"bigint"!=typeof R.s)throw new Error("PARSE");{const{r:Bt,s:Ut}=R;Q=new y(Bt,Ut)}}J=l.fromHex(E)}catch(Bt){if("PARSE"===Bt.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(A&&Q.hasHighS())return!1;H&&(I=t.hash(I));const{r:_e,s:le}=Q,lt=D(I),st=c(le),Se=a(lt*st),tt=a(_e*st),Ae=l.BASE.multiplyAndAddUnsafe(J,Se,tt)?.toAffine();return!!Ae&&a(Ae.x)===_e},ProjectivePoint:l,Signature:y,utils:v}}function vW(e){return{hash:e,hmac:(t,...r)=>Jl(e,t,function Yl(...e){let t=0;for(let i=0;i(e+t/Yh)/t;const kw=KN(nu,void 0,void 0,{sqrt:function rR(e){const t=nu,r=BigInt(3),i=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),c=BigInt(44),l=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=Qn(d,r,t)*d%t,h=Qn(f,r,t)*d%t,p=Qn(h,Yh,t)*u%t,g=Qn(p,s,t)*p%t,m=Qn(g,o,t)*g%t,y=Qn(m,c,t)*m%t,v=Qn(y,l,t)*y%t,w=Qn(v,c,t)*m%t,_=Qn(w,r,t)*d%t,b=Qn(_,a,t)*g%t,C=Qn(b,i,t)*u%t,D=Qn(C,Yh,t);if(!kw.eql(kw.sqr(D),e))throw new Error("Cannot find square root");return D}});(function wW(e,t){const r=i=>mW({...e,...vW(i)});Object.freeze({...r(t),create:r})})({a:BigInt(0),b:BigInt(7),Fp:kw,n:Qh,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Qh,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-ru*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),c=nR(o*e,t),l=nR(-i*e,t);let u=Lt(e-c*r-l*s,t),d=Lt(-c*i-l*o,t);const f=u>a,h=d>a;if(f&&(u=t-u),h&&(d=t-d),u>a||d>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:h,k2:d}}}},_w),BigInt(0);var IR;function SR(e,t){this.v=e,this.k=t}function hs(e){return new SR(e,0)}function cu(e){var t,r;function i(o,a){try{var c=e[o](a),l=c.value,u=l instanceof SR;Promise.resolve(u?l.v:l).then(function(d){if(u){var f="return"===o?"return":"next";if(!l.k||d.done)return i(f,d);d=e[f](d).value}s(c.done?"return":"normal",d)},function(d){i("throw",d)})}catch(d){s("throw",d)}}function s(o,a){switch(o){case"return":t.resolve({value:a,done:!0});break;case"throw":t.reject(a);break;default:t.resolve({value:a,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(o,a){return new Promise(function(c,l){var u={key:o,arg:a,resolve:c,reject:l,next:null};r?r=r.next=u:(t=r=u,i(o,a))})},"function"!=typeof e.return&&(this.return=void 0)}function ip(e){return function(){return new cu(e.apply(this,arguments))}}kN("Bitcoin seed"),new TextEncoder,(new TextEncoder).encode("0123456789abcdef"),new TextEncoder,new TextDecoder,cu.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},cu.prototype.next=function(e){return this._invoke("next",e)},cu.prototype.throw=function(e){return this._invoke("throw",e)},cu.prototype.return=function(e){return this._invoke("return",e)},IR=Symbol.asyncIterator;class TR{#e=[];#t;#r=!1;constructor(t){t?.aborted?this.abort():t?.addEventListener("abort",()=>this.abort(),{once:!0})}[IR](){var t=this;return ip(function*(){for(;!t.#r;)t.#e.length?yield t.#e.shift():yield hs(new Promise(r=>{t.#t=r}));throw new DOMException("The signal has been aborted","AbortError")})()}push(t){this.#e.push(t),this.#t?.()}abort(){this.#r=!0,this.#t?.()}}class xR{static regular(t){return 1e3<=t&&t<1e4||[1,2,4,5,6,7,8,16,40,41,42,43,44].includes(t)}static replaceable(t){return 1e4<=t&&t<2e4||[0,3].includes(t)}static ephemeral(t){return 2e4<=t&&t<3e4}static parameterizedReplaceable(t){return 3e4<=t&&t<4e4}}class WW{opts;relays;constructor(t){this.opts=t,this.relays=new Map}relay(t){const r=this.relays.get(t);if(r)return r;{const i=this.opts.open(t);return this.relays.set(t,i),i}}req(t,r){var i=this;return ip(function*(){const s=new AbortController,o=r?.signal?AbortSignal.any([r.signal,s.signal]):s.signal,a=yield hs(i.opts.reqRouter(t));if(a.size<1)return;const c=new TR(o),l=new Set,u=new Set;for(const m of a.keys()){const y=i.relay(m);$(function*(){var _,v=!1,w=!1;try{for(var C,b=ss(y.req(t,{signal:o}));v=!(C=yield b.next()).done;v=!1){const D=C.value;"EOSE"===D[0]&&(l.add(m),l.size===a.size&&c.push(D)),"CLOSED"===D[0]&&(u.add(m),u.size===a.size&&c.push(D)),"EVENT"===D[0]&&c.push(D)}}catch(D){w=!0,_=D}finally{try{v&&null!=b.return&&(yield b.return())}finally{if(w)throw _}}})().catch(()=>{})}try{var h,d=!1,f=!1;try{for(var g,p=ss(c);d=!(g=yield hs(p.next())).done;d=!1)yield g.value}catch(m){f=!0,h=m}finally{try{d&&null!=p.return&&(yield hs(p.return()))}finally{if(f)throw h}}}finally{s.abort()}})()}event(t,r){var i=this;return $(function*(){const s=yield i.opts.eventRouter(t);s.length<1||(yield Promise.any(s.map(o=>i.relay(o).event(t,r))))})()}query(t,r){var i=this;return $(function*(){const s=new Kn,o=t.reduce((h,p)=>h+KM(p),0);if(0===o)return[];const a=t.reduce((h,p)=>h||!!p.kinds?.some(g=>xR.replaceable(g)||xR.parameterizedReplaceable(g)),!1);try{var u,c=!1,l=!1;try{for(var f,d=ss(i.req(t,r));c=!(f=yield d.next()).done;c=!1){const h=f.value;if("EOSE"===h[0])break;if("EVENT"===h[0]&&s.add(h[2]),"CLOSED"===h[0])throw new Error("Subscription closed");if(!a&&s.size>=o)break}}catch(h){l=!0,u=h}finally{try{c&&null!=d.return&&(yield d.return())}finally{if(l)throw u}}}catch{}return[...s]})()}}class ZW{constructor(t,r){if(this._retries=0,!Number.isInteger(t)||t<0)throw new Error("Base must be a positive integer or zero");if(void 0!==r&&(!Number.isInteger(r)||r<0))throw new Error("ExpMax must be a undefined, a positive integer or zero");this.base=t,this.expMax=r,this.i=0}get retries(){return this._retries}get current(){return this.base*Math.pow(2,this.i)}next(){return this._retries++,this.i=void 0===this.expMax?this.i+1:Math.min(this.i+1,this.expMax),this.current}reset(){this._retries=0,this.i=0}}var xe,Ge=function(e){return e.open="open",e.close="close",e.error="error",e.message="message",e.retry="retry",e.reconnect="reconnect",e}(Ge||{});class KW{constructor(t,r,i){var s,o,a,c,l,u,d,f,h,p,g,m,y,v,w;this._closedByUser=!1,this.handleOpenEvent=_=>this.handleEvent(Ge.open,_),this.handleErrorEvent=_=>this.handleEvent(Ge.error,_),this.handleCloseEvent=_=>this.handleEvent(Ge.close,_),this.handleMessageEvent=_=>this.handleEvent(Ge.message,_),this._url=t,this._protocols=r,this._options={buffer:i?.buffer,retry:{maxRetries:null===(s=i?.retry)||void 0===s?void 0:s.maxRetries,instantReconnect:null===(o=i?.retry)||void 0===o?void 0:o.instantReconnect,backoff:null===(a=i?.retry)||void 0===a?void 0:a.backoff},listeners:{open:[...null!==(l=null===(c=i?.listeners)||void 0===c?void 0:c.open)&&void 0!==l?l:[]],close:[...null!==(d=null===(u=i?.listeners)||void 0===u?void 0:u.close)&&void 0!==d?d:[]],error:[...null!==(h=null===(f=i?.listeners)||void 0===f?void 0:f.error)&&void 0!==h?h:[]],message:[...null!==(g=null===(p=i?.listeners)||void 0===p?void 0:p.message)&&void 0!==g?g:[]],retry:[...null!==(y=null===(m=i?.listeners)||void 0===m?void 0:m.retry)&&void 0!==y?y:[]],reconnect:[...null!==(w=null===(v=i?.listeners)||void 0===v?void 0:v.reconnect)&&void 0!==w?w:[]]}},this._underlyingWebsocket=this.tryConnect()}get url(){return this._url}get protocols(){return this._protocols}get buffer(){return this._options.buffer}get maxRetries(){return this._options.retry.maxRetries}get instantReconnect(){return this._options.retry.instantReconnect}get backoff(){return this._options.retry.backoff}get closedByUser(){return this._closedByUser}get lastConnection(){return this._lastConnection}get underlyingWebsocket(){return this._underlyingWebsocket}get readyState(){return this._underlyingWebsocket.readyState}get bufferedAmount(){return this._underlyingWebsocket.bufferedAmount}get extensions(){return this._underlyingWebsocket.extensions}get binaryType(){return this._underlyingWebsocket.binaryType}set binaryType(t){this._underlyingWebsocket.binaryType=t}send(t){this.closedByUser||(this._underlyingWebsocket.readyState===this._underlyingWebsocket.OPEN?this._underlyingWebsocket.send(t):void 0!==this.buffer&&this.buffer.add(t))}close(t,r){this.cancelScheduledConnectionRetry(),this._closedByUser=!0,this._underlyingWebsocket.close(t,r)}addEventListener(t,r,i){this._options.listeners[t].push({listener:r,options:i})}removeEventListener(t,r,i){this._options.listeners[t]=this._options.listeners[t].filter(o=>o.listener!==r||o.options!==i)}tryConnect(){return this._underlyingWebsocket=new WebSocket(this.url,this.protocols),this._underlyingWebsocket.addEventListener(Ge.open,this.handleOpenEvent),this._underlyingWebsocket.addEventListener(Ge.close,this.handleCloseEvent),this._underlyingWebsocket.addEventListener(Ge.error,this.handleErrorEvent),this._underlyingWebsocket.addEventListener(Ge.message,this.handleMessageEvent),this._underlyingWebsocket}clearWebsocket(){this._underlyingWebsocket.removeEventListener(Ge.open,this.handleOpenEvent),this._underlyingWebsocket.removeEventListener(Ge.close,this.handleCloseEvent),this._underlyingWebsocket.removeEventListener(Ge.error,this.handleErrorEvent),this._underlyingWebsocket.removeEventListener(Ge.message,this.handleMessageEvent),this._underlyingWebsocket.close()}dispatchEvent(t,r){const s=[];this._options.listeners[t].forEach(({listener:o,options:a})=>{o(this,r),(void 0===a||void 0===a.once||!a.once)&&s.push({listener:o,options:a})}),this._options.listeners[t]=s}handleEvent(t,r){switch(t){case Ge.close:this.dispatchEvent(t,r),this.scheduleConnectionRetryIfNeeded();break;case Ge.open:if(void 0!==this.backoff&&void 0!==this._lastConnection){const i={retries:this.backoff.retries,lastConnection:new Date(this._lastConnection)},s=new CustomEvent(Ge.reconnect,{detail:i});this.dispatchEvent(Ge.reconnect,s),this.backoff.reset()}this._lastConnection=new Date,this.dispatchEvent(t,r),this.sendBufferedData();break;case Ge.retry:this.dispatchEvent(t,r),this.clearWebsocket(),this.tryConnect();break;default:this.dispatchEvent(t,r)}}sendBufferedData(){if(void 0!==this.buffer)for(let t=this.buffer.read();void 0!==t;t=this.buffer.read())this.send(t)}scheduleConnectionRetryIfNeeded(){if(this.closedByUser||void 0===this.backoff)return;const t=i=>{const s=new CustomEvent(Ge.retry,{detail:i});this.handleEvent(Ge.retry,s)},r={backoff:!0===this._options.retry.instantReconnect?0:this.backoff.next(),retries:!0===this._options.retry.instantReconnect?0:this.backoff.retries,lastConnection:this._lastConnection};(void 0===this._options.retry.maxRetries||r.retries<=this._options.retry.maxRetries)&&(this.retryTimeout=globalThis.setTimeout(()=>t(r),r.backoff))}cancelScheduledConnectionRetry(){globalThis.clearTimeout(this.retryTimeout)}}class QW{constructor(t){this._url=t}get url(){return this._url}withProtocols(t){return this._protocols=t,this}get protocols(){return this._protocols}withMaxRetries(t){var r;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},null===(r=this._options)||void 0===r?void 0:r.retry),{maxRetries:t})}),this}get maxRetries(){var t,r;return null===(r=null===(t=this._options)||void 0===t?void 0:t.retry)||void 0===r?void 0:r.maxRetries}withInstantReconnect(t){var r;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},null===(r=this._options)||void 0===r?void 0:r.retry),{instantReconnect:t})}),this}get instantReconnect(){var t,r;return null===(r=null===(t=this._options)||void 0===t?void 0:t.retry)||void 0===r?void 0:r.instantReconnect}withBackoff(t){var r;return this._options=Object.assign(Object.assign({},this._options),{retry:Object.assign(Object.assign({},null===(r=this._options)||void 0===r?void 0:r.retry),{backoff:t})}),this}get backoff(){var t,r;return null===(r=null===(t=this._options)||void 0===t?void 0:t.retry)||void 0===r?void 0:r.backoff}withBuffer(t){return this._options=Object.assign(Object.assign({},this._options),{buffer:t}),this}get buffer(){var t;return null===(t=this._options)||void 0===t?void 0:t.buffer}onOpen(t,r){return this.addListener(Ge.open,t,r),this}onClose(t,r){return this.addListener(Ge.close,t,r),this}onError(t,r){return this.addListener(Ge.error,t,r),this}onMessage(t,r){return this.addListener(Ge.message,t,r),this}onRetry(t,r){return this.addListener(Ge.retry,t,r),this}onReconnect(t,r){return this.addListener(Ge.reconnect,t,r),this}build(){return new KW(this._url,this._protocols,this._options)}addListener(t,r,i){var s,o,a,c,l,u,d,f,h,p,g,m,y,v,w,_,b,C,D,S,T;return this._options=Object.assign(Object.assign({},this._options),{listeners:{open:null!==(a=null===(o=null===(s=this._options)||void 0===s?void 0:s.listeners)||void 0===o?void 0:o.open)&&void 0!==a?a:[],close:null!==(u=null===(l=null===(c=this._options)||void 0===c?void 0:c.listeners)||void 0===l?void 0:l.close)&&void 0!==u?u:[],error:null!==(h=null===(f=null===(d=this._options)||void 0===d?void 0:d.listeners)||void 0===f?void 0:f.error)&&void 0!==h?h:[],message:null!==(m=null===(g=null===(p=this._options)||void 0===p?void 0:p.listeners)||void 0===g?void 0:g.message)&&void 0!==m?m:[],retry:null!==(w=null===(v=null===(y=this._options)||void 0===y?void 0:y.listeners)||void 0===v?void 0:v.retry)&&void 0!==w?w:[],reconnect:null!==(C=null===(b=null===(_=this._options)||void 0===_?void 0:_.listeners)||void 0===b?void 0:b.reconnect)&&void 0!==C?C:[],[t]:[...null!==(T=null===(S=null===(D=this._options)||void 0===D?void 0:D.listeners)||void 0===S?void 0:S[t])&&void 0!==T?T:[],{listener:r,options:i}]}}),this}}class YW{constructor(){this.elements=[]}add(t){this.elements.push(t)}clear(){this.elements.length=0}forEach(t){this.elements.forEach(t)}length(){return this.elements.length}isEmpty(){return 0===this.elements.length}peek(){return this.elements[0]}read(){return this.elements.shift()}}!function(e){e.assertEqual=s=>s,e.assertIs=function t(s){},e.assertNever=function r(s){throw new Error},e.arrayToEnum=s=>{const o={};for(const a of s)o[a]=a;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(c=>"number"!=typeof s[s[c]]),a={};for(const c of o)a[c]=s[c];return e.objectValues(a)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys="function"==typeof Object.keys?s=>Object.keys(s):s=>{const o=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},e.find=(s,o)=>{for(const a of s)if(o(a))return a},e.isInteger="function"==typeof Number.isInteger?s=>Number.isInteger(s):s=>"number"==typeof s&&isFinite(s)&&Math.floor(s)===s,e.joinValues=function i(s,o=" | "){return s.map(a=>"string"==typeof a?`'${a}'`:a).join(o)},e.jsonStringifyReplacer=(s,o)=>"bigint"==typeof o?o.toString():o}(xe||(xe={}));var AR=function(e){return e.mergeShapes=(t,r)=>({...t,...r}),e}(AR||{});const W=xe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ps=e=>{switch(typeof e){case"undefined":return W.undefined;case"string":return W.string;case"number":return isNaN(e)?W.nan:W.number;case"boolean":return W.boolean;case"function":return W.function;case"bigint":return W.bigint;case"symbol":return W.symbol;case"object":return Array.isArray(e)?W.array:null===e?W.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?W.promise:typeof Map<"u"&&e instanceof Map?W.map:typeof Set<"u"&&e instanceof Set?W.set:typeof Date<"u"&&e instanceof Date?W.date:W.object;default:return W.unknown}},L=xe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);let Mi=(()=>{class e extends Error{constructor(r){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=r}get errors(){return this.issues}format(r){const i=r||function(a){return a.message},s={_errors:[]},o=a=>{for(const c of a.issues)if("invalid_union"===c.code)c.unionErrors.map(o);else if("invalid_return_type"===c.code)o(c.returnTypeError);else if("invalid_arguments"===c.code)o(c.argumentsError);else if(0===c.path.length)s._errors.push(i(c));else{let l=s,u=0;for(;ui.message)){const i={},s=[];for(const o of this.issues)o.path.length>0?(i[o.path[0]]=i[o.path[0]]||[],i[o.path[0]].push(r(o))):s.push(r(o));return{formErrors:s,fieldErrors:i}}get formErrors(){return this.flatten()}}return e.create=t=>new e(t),e})();const qa=(e,t)=>{let r;switch(e.code){case L.invalid_type:r=e.received===W.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case L.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,xe.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:r=`Unrecognized key(s) in object: ${xe.joinValues(e.keys,", ")}`;break;case L.invalid_union:r="Invalid input";break;case L.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${xe.joinValues(e.options)}`;break;case L.invalid_enum_value:r=`Invalid enum value. Expected ${xe.joinValues(e.options)}, received '${e.received}'`;break;case L.invalid_arguments:r="Invalid function arguments";break;case L.invalid_return_type:r="Invalid function return type";break;case L.invalid_date:r="Invalid date";break;case L.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:xe.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case L.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case L.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case L.custom:r="Invalid input";break;case L.invalid_intersection_types:r="Intersection results could not be merged";break;case L.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case L.not_finite:r="Number must be finite";break;default:r=t.defaultError,xe.assertNever(e)}return{message:r}};let MR=qa;function sp(){return MR}const op=e=>{const{data:t,path:r,errorMaps:i,issueData:s}=e,o=[...r,...s.path||[]],a={...s,path:o};if(void 0!==s.message)return{...s,path:o,message:s.message};let c="";const l=i.filter(u=>!!u).slice().reverse();for(const u of l)c=u(a,{data:t,defaultError:c}).message;return{...s,path:o,message:c}};function q(e,t){const r=sp(),i=op({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===qa?void 0:qa].filter(s=>!!s)});e.common.issues.push(i)}class Qt{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,r){const i=[];for(const s of r){if("aborted"===s.status)return oe;"dirty"===s.status&&t.dirty(),i.push(s.value)}return{status:t.value,value:i}}static mergeObjectAsync(t,r){return $(function*(){const i=[];for(const s of r){const o=yield s.key,a=yield s.value;i.push({key:o,value:a})}return Qt.mergeObjectSync(t,i)})()}static mergeObjectSync(t,r){const i={};for(const s of r){const{key:o,value:a}=s;if("aborted"===o.status||"aborted"===a.status)return oe;"dirty"===o.status&&t.dirty(),"dirty"===a.status&&t.dirty(),"__proto__"!==o.value&&(typeof a.value<"u"||s.alwaysSet)&&(i[o.value]=a.value)}return{status:t.value,value:i}}}const oe=Object.freeze({status:"aborted"}),Ga=e=>({status:"dirty",value:e}),un=e=>({status:"valid",value:e}),Zw=e=>"aborted"===e.status,Kw=e=>"dirty"===e.status,lu=e=>"valid"===e.status,uu=e=>typeof Promise<"u"&&e instanceof Promise;function ap(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}function NR(e,t,r,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,r):s?s.value=r:t.set(e,r),r}"function"==typeof SuppressedError&&SuppressedError;var du,fu,te=function(e){return e.errToObj=t=>"string"==typeof t?{message:t}:t||{},e.toString=t=>"string"==typeof t?t:t?.message,e}(te||{});class Zr{constructor(t,r,i,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=i,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const RR=(e,t)=>{if(lu(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Mi(e.common.issues);return this._error=r,this._error}}};function pe(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:i,description:s}=e;if(t&&(r||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(a,c)=>{var l,u;const{message:d}=e;return"invalid_enum_value"===a.code?{message:d??c.defaultError}:typeof c.data>"u"?{message:null!==(l=d??i)&&void 0!==l?l:c.defaultError}:"invalid_type"!==a.code?{message:c.defaultError}:{message:null!==(u=d??r)&&void 0!==u?u:c.defaultError}},description:s}}class ve{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return ps(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ps(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Qt,ctx:{common:t.parent.common,data:t.data,parsedType:ps(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(uu(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const i=this.safeParse(t,r);if(i.success)return i.data;throw i.error}safeParse(t,r){var i;const s={common:{issues:[],async:null!==(i=r?.async)&&void 0!==i&&i,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ps(t)},o=this._parseSync({data:t,path:s.path,parent:s});return RR(s,o)}parseAsync(t,r){var i=this;return $(function*(){const s=yield i.safeParseAsync(t,r);if(s.success)return s.data;throw s.error})()}safeParseAsync(t,r){var i=this;return $(function*(){const s={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:i._def.errorMap,parent:null,data:t,parsedType:ps(t)},o=i._parse({data:t,path:s.path,parent:s}),a=yield uu(o)?o:Promise.resolve(o);return RR(s,a)})()}refine(t,r){const i=s=>"string"==typeof r||typeof r>"u"?{message:r}:"function"==typeof r?r(s):r;return this._refinement((s,o)=>{const a=t(s),c=()=>o.addIssue({code:L.custom,...i(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>!!l||(c(),!1)):!!a||(c(),!1)})}refinement(t,r){return this._refinement((i,s)=>!!t(i)||(s.addIssue("function"==typeof r?r(i,s):r),!1))}_refinement(t){return new ao({schema:this,typeName:ae.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return ms.create(this,this._def)}nullable(){return Ya.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return pu.create(this,this._def)}promise(){return dp.create(this,this._def)}or(t){return r_.create([this,t],this._def)}and(t){return s_.create(this,t,this._def)}transform(t){return new ao({...pe(this._def),schema:this,typeName:ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r="function"==typeof t?t:()=>t;return new c_({...pe(this._def),innerType:this,defaultValue:r,typeName:ae.ZodDefault})}brand(){return new u_({typeName:ae.ZodBranded,type:this,...pe(this._def)})}catch(t){const r="function"==typeof t?t:()=>t;return new l_({...pe(this._def),innerType:this,catchValue:r,typeName:ae.ZodCatch})}describe(t){return new(0,this.constructor)({...this._def,description:t})}pipe(t){return yu.create(this,t)}readonly(){return d_.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const tZ=/^c[^\s-]{8,}$/i,nZ=/^[0-9a-z]+$/,rZ=/^[0-9A-HJKMNP-TV-Z]{26}$/,iZ=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,sZ=/^[a-z0-9_-]{21}$/i,oZ=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,aZ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Qw;const lZ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,uZ=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,dZ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,OR="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",fZ=new RegExp(`^${OR}$`);function kR(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function hZ(e){return new RegExp(`^${kR(e)}$`)}function PR(e){let t=`${OR}T${kR(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function pZ(e,t){return!(("v4"!==t&&t||!lZ.test(e))&&("v6"!==t&&t||!uZ.test(e)))}let cp=(()=>{class e extends ve{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==W.string){const a=this._getOrReturnCtx(r);return q(a,{code:L.invalid_type,expected:W.string,received:a.parsedType}),oe}const s=new Qt;let o;for(const a of this._def.checks)if("min"===a.kind)r.data.lengtha.value&&(o=this._getOrReturnCtx(r,o),q(o,{code:L.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if("length"===a.kind){const c=r.data.length>a.value,l=r.data.lengthr.test(o),{validation:i,code:L.invalid_string,...te.errToObj(s)})}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...te.errToObj(r)})}url(r){return this._addCheck({kind:"url",...te.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...te.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...te.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...te.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...te.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...te.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...te.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...te.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...te.errToObj(r)})}datetime(r){var i,s;return this._addCheck("string"==typeof r?{kind:"datetime",precision:null,offset:!1,local:!1,message:r}:{kind:"datetime",precision:typeof r?.precision>"u"?null:r?.precision,offset:null!==(i=r?.offset)&&void 0!==i&&i,local:null!==(s=r?.local)&&void 0!==s&&s,...te.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return this._addCheck("string"==typeof r?{kind:"time",precision:null,message:r}:{kind:"time",precision:typeof r?.precision>"u"?null:r?.precision,...te.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...te.errToObj(r)})}regex(r,i){return this._addCheck({kind:"regex",regex:r,...te.errToObj(i)})}includes(r,i){return this._addCheck({kind:"includes",value:r,position:i?.position,...te.errToObj(i?.message)})}startsWith(r,i){return this._addCheck({kind:"startsWith",value:r,...te.errToObj(i)})}endsWith(r,i){return this._addCheck({kind:"endsWith",value:r,...te.errToObj(i)})}min(r,i){return this._addCheck({kind:"min",value:r,...te.errToObj(i)})}max(r,i){return this._addCheck({kind:"max",value:r,...te.errToObj(i)})}length(r,i){return this._addCheck({kind:"length",value:r,...te.errToObj(i)})}nonempty(r){return this.min(1,te.errToObj(r))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>"datetime"===r.kind)}get isDate(){return!!this._def.checks.find(r=>"date"===r.kind)}get isTime(){return!!this._def.checks.find(r=>"time"===r.kind)}get isDuration(){return!!this._def.checks.find(r=>"duration"===r.kind)}get isEmail(){return!!this._def.checks.find(r=>"email"===r.kind)}get isURL(){return!!this._def.checks.find(r=>"url"===r.kind)}get isEmoji(){return!!this._def.checks.find(r=>"emoji"===r.kind)}get isUUID(){return!!this._def.checks.find(r=>"uuid"===r.kind)}get isNANOID(){return!!this._def.checks.find(r=>"nanoid"===r.kind)}get isCUID(){return!!this._def.checks.find(r=>"cuid"===r.kind)}get isCUID2(){return!!this._def.checks.find(r=>"cuid2"===r.kind)}get isULID(){return!!this._def.checks.find(r=>"ulid"===r.kind)}get isIP(){return!!this._def.checks.find(r=>"ip"===r.kind)}get isBase64(){return!!this._def.checks.find(r=>"base64"===r.kind)}get minLength(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return r}get maxLength(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.value{var r;return new e({checks:[],typeName:ae.ZodString,coerce:null!==(r=t?.coerce)&&void 0!==r&&r,...pe(t)})},e})();function gZ(e,t){const r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,s=r>i?r:i;return parseInt(e.toFixed(s).replace(".",""))%parseInt(t.toFixed(s).replace(".",""))/Math.pow(10,s)}let Yw=(()=>{class e extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==W.number){const a=this._getOrReturnCtx(r);return q(a,{code:L.invalid_type,expected:W.number,received:a.parsedType}),oe}let s;const o=new Qt;for(const a of this._def.checks)"int"===a.kind?xe.isInteger(r.data)||(s=this._getOrReturnCtx(r,s),q(s,{code:L.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):"min"===a.kind?(a.inclusive?r.dataa.value:r.data>=a.value)&&(s=this._getOrReturnCtx(r,s),q(s,{code:L.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):"multipleOf"===a.kind?0!==gZ(r.data,a.value)&&(s=this._getOrReturnCtx(r,s),q(s,{code:L.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):"finite"===a.kind?Number.isFinite(r.data)||(s=this._getOrReturnCtx(r,s),q(s,{code:L.not_finite,message:a.message}),o.dirty()):xe.assertNever(a);return{status:o.value,value:r.data}}gte(r,i){return this.setLimit("min",r,!0,te.toString(i))}gt(r,i){return this.setLimit("min",r,!1,te.toString(i))}lte(r,i){return this.setLimit("max",r,!0,te.toString(i))}lt(r,i){return this.setLimit("max",r,!1,te.toString(i))}setLimit(r,i,s,o){return new e({...this._def,checks:[...this._def.checks,{kind:r,value:i,inclusive:s,message:te.toString(o)}]})}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:te.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:te.toString(r)})}multipleOf(r,i){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(i)})}finite(r){return this._addCheck({kind:"finite",message:te.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:te.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:te.toString(r)})}get minValue(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return r}get maxValue(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.value"int"===r.kind||"multipleOf"===r.kind&&xe.isInteger(r.value))}get isFinite(){let r=null,i=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===i||s.value>i)&&(i=s.value):"max"===s.kind&&(null===r||s.valuenew e({checks:[],typeName:ae.ZodNumber,coerce:t?.coerce||!1,...pe(t)}),e})(),Jw=(()=>{class e extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce&&(r.data=BigInt(r.data)),this._getType(r)!==W.bigint){const a=this._getOrReturnCtx(r);return q(a,{code:L.invalid_type,expected:W.bigint,received:a.parsedType}),oe}let s;const o=new Qt;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?r.dataa.value:r.data>=a.value)&&(s=this._getOrReturnCtx(r,s),q(s,{code:L.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):"multipleOf"===a.kind?r.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(r,s),q(s,{code:L.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):xe.assertNever(a);return{status:o.value,value:r.data}}gte(r,i){return this.setLimit("min",r,!0,te.toString(i))}gt(r,i){return this.setLimit("min",r,!1,te.toString(i))}lte(r,i){return this.setLimit("max",r,!0,te.toString(i))}lt(r,i){return this.setLimit("max",r,!1,te.toString(i))}setLimit(r,i,s,o){return new e({...this._def,checks:[...this._def.checks,{kind:r,value:i,inclusive:s,message:te.toString(o)}]})}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:te.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:te.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:te.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:te.toString(r)})}multipleOf(r,i){return this._addCheck({kind:"multipleOf",value:r,message:te.toString(i)})}get minValue(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return r}get maxValue(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.value{var r;return new e({checks:[],typeName:ae.ZodBigInt,coerce:null!==(r=t?.coerce)&&void 0!==r&&r,...pe(t)})},e})(),Xw=(()=>{class e extends ve{_parse(r){if(this._def.coerce&&(r.data=!!r.data),this._getType(r)!==W.boolean){const s=this._getOrReturnCtx(r);return q(s,{code:L.invalid_type,expected:W.boolean,received:s.parsedType}),oe}return un(r.data)}}return e.create=t=>new e({typeName:ae.ZodBoolean,coerce:t?.coerce||!1,...pe(t)}),e})(),e_=(()=>{class e extends ve{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==W.date){const a=this._getOrReturnCtx(r);return q(a,{code:L.invalid_type,expected:W.date,received:a.parsedType}),oe}if(isNaN(r.data.getTime()))return q(this._getOrReturnCtx(r),{code:L.invalid_date}),oe;const s=new Qt;let o;for(const a of this._def.checks)"min"===a.kind?r.data.getTime()a.value&&(o=this._getOrReturnCtx(r,o),q(o,{code:L.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):xe.assertNever(a);return{status:s.value,value:new Date(r.data.getTime())}}_addCheck(r){return new e({...this._def,checks:[...this._def.checks,r]})}min(r,i){return this._addCheck({kind:"min",value:r.getTime(),message:te.toString(i)})}max(r,i){return this._addCheck({kind:"max",value:r.getTime(),message:te.toString(i)})}get minDate(){let r=null;for(const i of this._def.checks)"min"===i.kind&&(null===r||i.value>r)&&(r=i.value);return null!=r?new Date(r):null}get maxDate(){let r=null;for(const i of this._def.checks)"max"===i.kind&&(null===r||i.valuenew e({checks:[],coerce:t?.coerce||!1,typeName:ae.ZodDate,...pe(t)}),e})(),LR=(()=>{class e extends ve{_parse(r){if(this._getType(r)!==W.symbol){const s=this._getOrReturnCtx(r);return q(s,{code:L.invalid_type,expected:W.symbol,received:s.parsedType}),oe}return un(r.data)}}return e.create=t=>new e({typeName:ae.ZodSymbol,...pe(t)}),e})(),t_=(()=>{class e extends ve{_parse(r){if(this._getType(r)!==W.undefined){const s=this._getOrReturnCtx(r);return q(s,{code:L.invalid_type,expected:W.undefined,received:s.parsedType}),oe}return un(r.data)}}return e.create=t=>new e({typeName:ae.ZodUndefined,...pe(t)}),e})(),n_=(()=>{class e extends ve{_parse(r){if(this._getType(r)!==W.null){const s=this._getOrReturnCtx(r);return q(s,{code:L.invalid_type,expected:W.null,received:s.parsedType}),oe}return un(r.data)}}return e.create=t=>new e({typeName:ae.ZodNull,...pe(t)}),e})(),lp=(()=>{class e extends ve{constructor(){super(...arguments),this._any=!0}_parse(r){return un(r.data)}}return e.create=t=>new e({typeName:ae.ZodAny,...pe(t)}),e})(),hu=(()=>{class e extends ve{constructor(){super(...arguments),this._unknown=!0}_parse(r){return un(r.data)}}return e.create=t=>new e({typeName:ae.ZodUnknown,...pe(t)}),e})(),oo=(()=>{class e extends ve{_parse(r){const i=this._getOrReturnCtx(r);return q(i,{code:L.invalid_type,expected:W.never,received:i.parsedType}),oe}}return e.create=t=>new e({typeName:ae.ZodNever,...pe(t)}),e})(),FR=(()=>{class e extends ve{_parse(r){if(this._getType(r)!==W.undefined){const s=this._getOrReturnCtx(r);return q(s,{code:L.invalid_type,expected:W.void,received:s.parsedType}),oe}return un(r.data)}}return e.create=t=>new e({typeName:ae.ZodVoid,...pe(t)}),e})(),pu=(()=>{class e extends ve{_parse(r){const{ctx:i,status:s}=this._processInputParams(r),o=this._def;if(i.parsedType!==W.array)return q(i,{code:L.invalid_type,expected:W.array,received:i.parsedType}),oe;if(null!==o.exactLength){const c=i.data.length>o.exactLength.value,l=i.data.lengtho.maxLength.value&&(q(i,{code:L.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),s.dirty()),i.common.async)return Promise.all([...i.data].map((c,l)=>o.type._parseAsync(new Zr(i,c,i.path,l)))).then(c=>Qt.mergeArray(s,c));const a=[...i.data].map((c,l)=>o.type._parseSync(new Zr(i,c,i.path,l)));return Qt.mergeArray(s,a)}get element(){return this._def.type}min(r,i){return new e({...this._def,minLength:{value:r,message:te.toString(i)}})}max(r,i){return new e({...this._def,maxLength:{value:r,message:te.toString(i)}})}length(r,i){return new e({...this._def,exactLength:{value:r,message:te.toString(i)}})}nonempty(r){return this.min(1,r)}}return e.create=(t,r)=>new e({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ae.ZodArray,...pe(r)}),e})();function Wa(e){if(e instanceof Za){const t={};for(const r in e.shape)t[r]=ms.create(Wa(e.shape[r]));return new Za({...e._def,shape:()=>t})}return e instanceof pu?new pu({...e._def,type:Wa(e.element)}):e instanceof ms?ms.create(Wa(e.unwrap())):e instanceof Ya?Ya.create(Wa(e.unwrap())):e instanceof Ka?Ka.create(e.items.map(t=>Wa(t))):e}let Za=(()=>{class e extends ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const r=this._def.shape(),i=xe.objectKeys(r);return this._cached={shape:r,keys:i}}_parse(r){if(this._getType(r)!==W.object){const d=this._getOrReturnCtx(r);return q(d,{code:L.invalid_type,expected:W.object,received:d.parsedType}),oe}const{status:s,ctx:o}=this._processInputParams(r),{shape:a,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof oo&&"strip"===this._def.unknownKeys))for(const d in o.data)c.includes(d)||l.push(d);const u=[];for(const d of c)u.push({key:{status:"valid",value:d},value:a[d]._parse(new Zr(o,o.data[d],o.path,d)),alwaysSet:d in o.data});if(this._def.catchall instanceof oo){const d=this._def.unknownKeys;if("passthrough"===d)for(const f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if("strict"===d)l.length>0&&(q(o,{code:L.unrecognized_keys,keys:l}),s.dirty());else if("strip"!==d)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const f of l)u.push({key:{status:"valid",value:f},value:d._parse(new Zr(o,o.data[f],o.path,f)),alwaysSet:f in o.data})}return o.common.async?Promise.resolve().then($(function*(){const d=[];for(const f of u){const h=yield f.key,p=yield f.value;d.push({key:h,value:p,alwaysSet:f.alwaysSet})}return d})).then(d=>Qt.mergeObjectSync(s,d)):Qt.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(r){return new e({...this._def,unknownKeys:"strict",...void 0!==r?{errorMap:(i,s)=>{var o,a,c,l;const u=null!==(c=null===(a=(o=this._def).errorMap)||void 0===a?void 0:a.call(o,i,s).message)&&void 0!==c?c:s.defaultError;return"unrecognized_keys"===i.code?{message:null!==(l=te.errToObj(r).message)&&void 0!==l?l:u}:{message:u}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(r){return new e({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new e({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:ae.ZodObject})}setKey(r,i){return this.augment({[r]:i})}catchall(r){return new e({...this._def,catchall:r})}pick(r){const i={};return xe.objectKeys(r).forEach(s=>{r[s]&&this.shape[s]&&(i[s]=this.shape[s])}),new e({...this._def,shape:()=>i})}omit(r){const i={};return xe.objectKeys(this.shape).forEach(s=>{r[s]||(i[s]=this.shape[s])}),new e({...this._def,shape:()=>i})}deepPartial(){return Wa(this)}partial(r){const i={};return xe.objectKeys(this.shape).forEach(s=>{const o=this.shape[s];i[s]=r&&!r[s]?o:o.optional()}),new e({...this._def,shape:()=>i})}required(r){const i={};return xe.objectKeys(this.shape).forEach(s=>{if(r&&!r[s])i[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof ms;)a=a._def.innerType;i[s]=a}}),new e({...this._def,shape:()=>i})}keyof(){return jR(xe.objectKeys(this.shape))}}return e.create=(t,r)=>new e({shape:()=>t,unknownKeys:"strip",catchall:oo.create(),typeName:ae.ZodObject,...pe(r)}),e.strictCreate=(t,r)=>new e({shape:()=>t,unknownKeys:"strict",catchall:oo.create(),typeName:ae.ZodObject,...pe(r)}),e.lazycreate=(t,r)=>new e({shape:t,unknownKeys:"strip",catchall:oo.create(),typeName:ae.ZodObject,...pe(r)}),e})(),r_=(()=>{class e extends ve{_parse(r){const{ctx:i}=this._processInputParams(r),s=this._def.options;if(i.common.async)return Promise.all(s.map(function(){var a=$(function*(c){const l={...i,common:{...i.common,issues:[]},parent:null};return{result:yield c._parseAsync({data:i.data,path:i.path,parent:l}),ctx:l}});return function(c){return a.apply(this,arguments)}}())).then(function o(a){for(const l of a)if("valid"===l.result.status)return l.result;for(const l of a)if("dirty"===l.result.status)return i.common.issues.push(...l.ctx.common.issues),l.result;const c=a.map(l=>new Mi(l.ctx.common.issues));return q(i,{code:L.invalid_union,unionErrors:c}),oe});{let a;const c=[];for(const u of s){const d={...i,common:{...i.common,issues:[]},parent:null},f=u._parseSync({data:i.data,path:i.path,parent:d});if("valid"===f.status)return f;"dirty"===f.status&&!a&&(a={result:f,ctx:d}),d.common.issues.length&&c.push(d.common.issues)}if(a)return i.common.issues.push(...a.ctx.common.issues),a.result;const l=c.map(u=>new Mi(u));return q(i,{code:L.invalid_union,unionErrors:l}),oe}}get options(){return this._def.options}}return e.create=(t,r)=>new e({options:t,typeName:ae.ZodUnion,...pe(r)}),e})();const Ni=e=>e instanceof o_?Ni(e.schema):e instanceof ao?Ni(e.innerType()):e instanceof a_?[e.value]:e instanceof gs?e.options:e instanceof mu?xe.objectValues(e.enum):e instanceof c_?Ni(e._def.innerType):e instanceof t_?[void 0]:e instanceof n_?[null]:e instanceof ms?[void 0,...Ni(e.unwrap())]:e instanceof Ya?[null,...Ni(e.unwrap())]:e instanceof u_||e instanceof d_?Ni(e.unwrap()):e instanceof l_?Ni(e._def.innerType):[];class up extends ve{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==W.object)return q(r,{code:L.invalid_type,expected:W.object,received:r.parsedType}),oe;const i=this.discriminator,o=this.optionsMap.get(r.data[i]);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(q(r,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,i){const s=new Map;for(const o of r){const a=Ni(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const c of a){if(s.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);s.set(c,o)}}return new up({typeName:ae.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...pe(i)})}}function i_(e,t){const r=ps(e),i=ps(t);if(e===t)return{valid:!0,data:e};if(r===W.object&&i===W.object){const s=xe.objectKeys(t),o=xe.objectKeys(e).filter(c=>-1!==s.indexOf(c)),a={...e,...t};for(const c of o){const l=i_(e[c],t[c]);if(!l.valid)return{valid:!1};a[c]=l.data}return{valid:!0,data:a}}if(r===W.array&&i===W.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o{class e extends ve{_parse(r){const{status:i,ctx:s}=this._processInputParams(r),o=(a,c)=>{if(Zw(a)||Zw(c))return oe;const l=i_(a.value,c.value);return l.valid?((Kw(a)||Kw(c))&&i.dirty(),{status:i.value,value:l.data}):(q(s,{code:L.invalid_intersection_types}),oe)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,c])=>o(a,c)):o(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}return e.create=(t,r,i)=>new e({left:t,right:r,typeName:ae.ZodIntersection,...pe(i)}),e})(),Ka=(()=>{class e extends ve{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==W.array)return q(s,{code:L.invalid_type,expected:W.array,received:s.parsedType}),oe;if(s.data.lengththis._def.items.length&&(q(s,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const a=[...s.data].map((c,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new Zr(s,c,s.path,l)):null}).filter(c=>!!c);return s.common.async?Promise.all(a).then(c=>Qt.mergeArray(i,c)):Qt.mergeArray(i,a)}get items(){return this._def.items}rest(r){return new e({...this._def,rest:r})}}return e.create=(t,r)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new e({items:t,typeName:ae.ZodTuple,rest:null,...pe(r)})},e})();class gu extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:i}=this._processInputParams(t);if(i.parsedType!==W.object)return q(i,{code:L.invalid_type,expected:W.object,received:i.parsedType}),oe;const s=[],o=this._def.keyType,a=this._def.valueType;for(const c in i.data)s.push({key:o._parse(new Zr(i,c,i.path,c)),value:a._parse(new Zr(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?Qt.mergeObjectAsync(r,s):Qt.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,i){return new gu(r instanceof ve?{keyType:t,valueType:r,typeName:ae.ZodRecord,...pe(i)}:{keyType:cp.create(),valueType:t,typeName:ae.ZodRecord,...pe(r)})}}let BR=(()=>{class e extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==W.map)return q(s,{code:L.invalid_type,expected:W.map,received:s.parsedType}),oe;const o=this._def.keyType,a=this._def.valueType,c=[...s.data.entries()].map(([l,u],d)=>({key:o._parse(new Zr(s,l,s.path,[d,"key"])),value:a._parse(new Zr(s,u,s.path,[d,"value"]))}));if(s.common.async){const l=new Map;return Promise.resolve().then($(function*(){for(const u of c){const d=yield u.key,f=yield u.value;if("aborted"===d.status||"aborted"===f.status)return oe;("dirty"===d.status||"dirty"===f.status)&&i.dirty(),l.set(d.value,f.value)}return{status:i.value,value:l}}))}{const l=new Map;for(const u of c){const d=u.key,f=u.value;if("aborted"===d.status||"aborted"===f.status)return oe;("dirty"===d.status||"dirty"===f.status)&&i.dirty(),l.set(d.value,f.value)}return{status:i.value,value:l}}}}return e.create=(t,r,i)=>new e({valueType:r,keyType:t,typeName:ae.ZodMap,...pe(i)}),e})(),UR=(()=>{class e extends ve{_parse(r){const{status:i,ctx:s}=this._processInputParams(r);if(s.parsedType!==W.set)return q(s,{code:L.invalid_type,expected:W.set,received:s.parsedType}),oe;const o=this._def;null!==o.minSize&&s.data.sizeo.maxSize.value&&(q(s,{code:L.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),i.dirty());const a=this._def.valueType;function c(u){const d=new Set;for(const f of u){if("aborted"===f.status)return oe;"dirty"===f.status&&i.dirty(),d.add(f.value)}return{status:i.value,value:d}}const l=[...s.data.values()].map((u,d)=>a._parse(new Zr(s,u,s.path,d)));return s.common.async?Promise.all(l).then(u=>c(u)):c(l)}min(r,i){return new e({...this._def,minSize:{value:r,message:te.toString(i)}})}max(r,i){return new e({...this._def,maxSize:{value:r,message:te.toString(i)}})}size(r,i){return this.min(r,i).max(r,i)}nonempty(r){return this.min(1,r)}}return e.create=(t,r)=>new e({valueType:t,minSize:null,maxSize:null,typeName:ae.ZodSet,...pe(r)}),e})();class Qa extends ve{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==W.function)return q(r,{code:L.invalid_type,expected:W.function,received:r.parsedType}),oe;function i(c,l){return op({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,sp(),qa].filter(u=>!!u),issueData:{code:L.invalid_arguments,argumentsError:l}})}function s(c,l){return op({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,sp(),qa].filter(u=>!!u),issueData:{code:L.invalid_return_type,returnTypeError:l}})}const o={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof dp){const c=this;return un($(function*(...l){const u=new Mi([]),d=yield c._def.args.parseAsync(l,o).catch(p=>{throw u.addIssue(i(l,p)),u}),f=yield Reflect.apply(a,this,d);return yield c._def.returns._def.type.parseAsync(f,o).catch(p=>{throw u.addIssue(s(f,p)),u})}))}{const c=this;return un(function(...l){const u=c._def.args.safeParse(l,o);if(!u.success)throw new Mi([i(l,u.error)]);const d=Reflect.apply(a,this,u.data),f=c._def.returns.safeParse(d,o);if(!f.success)throw new Mi([s(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Qa({...this._def,args:Ka.create(t).rest(hu.create())})}returns(t){return new Qa({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,i){return new Qa({args:t||Ka.create([]).rest(hu.create()),returns:r||hu.create(),typeName:ae.ZodFunction,...pe(i)})}}let o_=(()=>{class e extends ve{get schema(){return this._def.getter()}_parse(r){const{ctx:i}=this._processInputParams(r);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}return e.create=(t,r)=>new e({getter:t,typeName:ae.ZodLazy,...pe(r)}),e})(),a_=(()=>{class e extends ve{_parse(r){if(r.data!==this._def.value){const i=this._getOrReturnCtx(r);return q(i,{received:i.data,code:L.invalid_literal,expected:this._def.value}),oe}return{status:"valid",value:r.data}}get value(){return this._def.value}}return e.create=(t,r)=>new e({value:t,typeName:ae.ZodLiteral,...pe(r)}),e})();function jR(e,t){return new gs({values:e,typeName:ae.ZodEnum,...pe(t)})}class gs extends ve{constructor(){super(...arguments),du.set(this,void 0)}_parse(t){if("string"!=typeof t.data){const r=this._getOrReturnCtx(t);return q(r,{expected:xe.joinValues(this._def.values),received:r.parsedType,code:L.invalid_type}),oe}if(ap(this,du,"f")||NR(this,du,new Set(this._def.values),"f"),!ap(this,du,"f").has(t.data)){const r=this._getOrReturnCtx(t);return q(r,{received:r.data,code:L.invalid_enum_value,options:this._def.values}),oe}return un(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return gs.create(t,{...this._def,...r})}exclude(t,r=this._def){return gs.create(this.options.filter(i=>!t.includes(i)),{...this._def,...r})}}du=new WeakMap,gs.create=jR;class mu extends ve{constructor(){super(...arguments),fu.set(this,void 0)}_parse(t){const r=xe.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==W.string&&i.parsedType!==W.number){const s=xe.objectValues(r);return q(i,{expected:xe.joinValues(s),received:i.parsedType,code:L.invalid_type}),oe}if(ap(this,fu,"f")||NR(this,fu,new Set(xe.getValidEnumValues(this._def.values)),"f"),!ap(this,fu,"f").has(t.data)){const s=xe.objectValues(r);return q(i,{received:i.data,code:L.invalid_enum_value,options:s}),oe}return un(t.data)}get enum(){return this._def.values}}fu=new WeakMap,mu.create=(e,t)=>new mu({values:e,typeName:ae.ZodNativeEnum,...pe(t)});let dp=(()=>{class e extends ve{unwrap(){return this._def.type}_parse(r){const{ctx:i}=this._processInputParams(r);if(i.parsedType!==W.promise&&!1===i.common.async)return q(i,{code:L.invalid_type,expected:W.promise,received:i.parsedType}),oe;const s=i.parsedType===W.promise?i.data:Promise.resolve(i.data);return un(s.then(o=>this._def.type.parseAsync(o,{path:i.path,errorMap:i.common.contextualErrorMap})))}}return e.create=(t,r)=>new e({type:t,typeName:ae.ZodPromise,...pe(r)}),e})(),ao=(()=>{class e extends ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){var i=this;const{status:s,ctx:o}=this._processInputParams(r),a=this._def.effect||null,c={addIssue:l=>{q(o,l),l.fatal?s.abort():s.dirty()},get path(){return o.path}};if(c.addIssue=c.addIssue.bind(c),"preprocess"===a.type){const l=a.transform(o.data,c);if(o.common.async)return Promise.resolve(l).then(function(){var u=$(function*(d){if("aborted"===s.value)return oe;const f=yield i._def.schema._parseAsync({data:d,path:o.path,parent:o});return"aborted"===f.status?oe:"dirty"===f.status||"dirty"===s.value?Ga(f.value):f});return function(d){return u.apply(this,arguments)}}());{if("aborted"===s.value)return oe;const u=this._def.schema._parseSync({data:l,path:o.path,parent:o});return"aborted"===u.status?oe:"dirty"===u.status||"dirty"===s.value?Ga(u.value):u}}if("refinement"===a.type){const l=u=>{const d=a.refinement(u,c);if(o.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(!1===o.common.async){const u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return"aborted"===u.status?oe:("dirty"===u.status&&s.dirty(),l(u.value),{status:s.value,value:u.value})}return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>"aborted"===u.status?oe:("dirty"===u.status&&s.dirty(),l(u.value).then(()=>({status:s.value,value:u.value}))))}if("transform"===a.type){if(!1===o.common.async){const l=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!lu(l))return l;const u=a.transform(l.value,c);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:u}}return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(l=>lu(l)?Promise.resolve(a.transform(l.value,c)).then(u=>({status:s.value,value:u})):l)}xe.assertNever(a)}}return e.create=(t,r,i)=>new e({schema:t,typeName:ae.ZodEffects,effect:r,...pe(i)}),e.createWithPreprocess=(t,r,i)=>new e({schema:r,effect:{type:"preprocess",transform:t},typeName:ae.ZodEffects,...pe(i)}),e})(),ms=(()=>{class e extends ve{_parse(r){return this._getType(r)===W.undefined?un(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ae.ZodOptional,...pe(r)}),e})(),Ya=(()=>{class e extends ve{_parse(r){return this._getType(r)===W.null?un(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ae.ZodNullable,...pe(r)}),e})(),c_=(()=>{class e extends ve{_parse(r){const{ctx:i}=this._processInputParams(r);let s=i.data;return i.parsedType===W.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ae.ZodDefault,defaultValue:"function"==typeof r.default?r.default:()=>r.default,...pe(r)}),e})(),l_=(()=>{class e extends ve{_parse(r){const{ctx:i}=this._processInputParams(r),s={...i,common:{...i.common,issues:[]}},o=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return uu(o)?o.then(a=>({status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new Mi(s.common.issues)},input:s.data})})):{status:"valid",value:"valid"===o.status?o.value:this._def.catchValue({get error(){return new Mi(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ae.ZodCatch,catchValue:"function"==typeof r.catch?r.catch:()=>r.catch,...pe(r)}),e})(),$R=(()=>{class e extends ve{_parse(r){if(this._getType(r)!==W.nan){const s=this._getOrReturnCtx(r);return q(s,{code:L.invalid_type,expected:W.nan,received:s.parsedType}),oe}return{status:"valid",value:r.data}}}return e.create=t=>new e({typeName:ae.ZodNaN,...pe(t)}),e})();const mZ=Symbol("zod_brand");class u_ extends ve{_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.type._parse({data:r.data,path:r.path,parent:r})}unwrap(){return this._def.type}}class yu extends ve{_parse(t){var r=this;const{status:i,ctx:s}=this._processInputParams(t);if(s.common.async)return function(){var a=$(function*(){const c=yield r._def.in._parseAsync({data:s.data,path:s.path,parent:s});return"aborted"===c.status?oe:"dirty"===c.status?(i.dirty(),Ga(c.value)):r._def.out._parseAsync({data:c.value,path:s.path,parent:s})});return function(){return a.apply(this,arguments)}}()();{const o=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===o.status?oe:"dirty"===o.status?(i.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:s.path,parent:s})}}static create(t,r){return new yu({in:t,out:r,typeName:ae.ZodPipeline})}}let d_=(()=>{class e extends ve{_parse(r){const i=this._def.innerType._parse(r),s=o=>(lu(o)&&(o.value=Object.freeze(o.value)),o);return uu(i)?i.then(o=>s(o)):s(i)}unwrap(){return this._def.innerType}}return e.create=(t,r)=>new e({innerType:t,typeName:ae.ZodReadonly,...pe(r)}),e})();function VR(e,t={},r){return e?lp.create().superRefine((i,s)=>{var o,a;if(!e(i)){const c="function"==typeof t?t(i):"string"==typeof t?{message:t}:t,l=null===(a=null!==(o=c.fatal)&&void 0!==o?o:r)||void 0===a||a;s.addIssue({code:"custom",..."string"==typeof c?{message:c}:c,fatal:l})}}):lp.create()}const yZ={object:Za.lazycreate};var ae=function(e){return e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly",e}(ae||{});const HR=cp.create,zR=Yw.create,qR=Xw.create,GR=ao.create;var V=Object.freeze({__proto__:null,defaultErrorMap:qa,setErrorMap:function XW(e){MR=e},getErrorMap:sp,makeIssue:op,EMPTY_PATH:[],addIssueToContext:q,ParseStatus:Qt,INVALID:oe,DIRTY:Ga,OK:un,isAborted:Zw,isDirty:Kw,isValid:lu,isAsync:uu,get util(){return xe},get objectUtil(){return AR},ZodParsedType:W,getParsedType:ps,ZodType:ve,datetimeRegex:PR,ZodString:cp,ZodNumber:Yw,ZodBigInt:Jw,ZodBoolean:Xw,ZodDate:e_,ZodSymbol:LR,ZodUndefined:t_,ZodNull:n_,ZodAny:lp,ZodUnknown:hu,ZodNever:oo,ZodVoid:FR,ZodArray:pu,ZodObject:Za,ZodUnion:r_,ZodDiscriminatedUnion:up,ZodIntersection:s_,ZodTuple:Ka,ZodRecord:gu,ZodMap:BR,ZodSet:UR,ZodFunction:Qa,ZodLazy:o_,ZodLiteral:a_,ZodEnum:gs,ZodNativeEnum:mu,ZodPromise:dp,ZodEffects:ao,ZodTransformer:ao,ZodOptional:ms,ZodNullable:Ya,ZodDefault:c_,ZodCatch:l_,ZodNaN:$R,BRAND:mZ,ZodBranded:u_,ZodPipeline:yu,ZodReadonly:d_,custom:VR,Schema:ve,ZodSchema:ve,late:yZ,get ZodFirstPartyTypeKind(){return ae},coerce:{string:e=>cp.create({...e,coerce:!0}),number:e=>Yw.create({...e,coerce:!0}),boolean:e=>Xw.create({...e,coerce:!0}),bigint:e=>Jw.create({...e,coerce:!0}),date:e=>e_.create({...e,coerce:!0})},any:lp.create,array:pu.create,bigint:Jw.create,boolean:qR,date:e_.create,discriminatedUnion:up.create,effect:GR,enum:gs.create,function:Qa.create,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>VR(r=>r instanceof e,t),intersection:s_.create,lazy:o_.create,literal:a_.create,map:BR.create,nan:$R.create,nativeEnum:mu.create,never:oo.create,null:n_.create,nullable:Ya.create,number:zR,object:Za.create,oboolean:()=>qR().optional(),onumber:()=>zR().optional(),optional:ms.create,ostring:()=>HR().optional(),pipeline:yu.create,preprocess:ao.createWithPreprocess,promise:dp.create,record:gu.create,set:UR.create,strictObject:Za.strictCreate,string:HR,symbol:LR.create,transformer:GR,tuple:Ka.create,undefined:t_.create,union:r_.create,unknown:hu.create,void:FR.create,NEVER:oe,ZodIssueCode:L,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Mi});class et{static id(){return V.string().regex(/^[0-9a-f]{64}$/)}static event(){return V.object({id:et.id(),kind:V.number().int().nonnegative(),pubkey:et.id(),tags:V.string().array().array(),content:V.string(),created_at:V.number().int().nonnegative(),sig:V.string()})}static filter(){return V.object({kinds:V.number().int().nonnegative().array().optional(),ids:et.id().array().optional(),authors:et.id().array().optional(),since:V.number().int().nonnegative().optional(),until:V.number().int().nonnegative().optional(),limit:V.number().int().nonnegative().optional(),search:V.string().optional()}).passthrough().transform(t=>{const r=["kinds","ids","authors","since","until","limit","search"];return Object.entries(t).reduce((i,[s,o])=>((r.includes(s)||s.startsWith("#"))&&(i[s]=o),i),{})})}static bech32(t){return V.string().regex(/^[\x21-\x7E]{1,83}1[023456789acdefghjklmnpqrstuvwxyz]{6,}$/).refine(r=>!t||r.startsWith(`${t}1`))}static clientEVENT(){return V.tuple([V.literal("EVENT"),et.event()])}static clientREQ(){return V.tuple([V.literal("REQ"),V.string()]).rest(et.filter())}static clientCOUNT(){return V.tuple([V.literal("COUNT"),V.string()]).rest(et.filter())}static clientCLOSE(){return V.tuple([V.literal("CLOSE"),V.string()])}static clientAUTH(){return V.tuple([V.literal("AUTH"),et.event()])}static clientMsg(){return V.union([et.clientEVENT(),et.clientREQ(),et.clientCOUNT(),et.clientCLOSE(),et.clientAUTH()])}static relayEVENT(){return V.tuple([V.literal("EVENT"),V.string(),et.event()])}static relayOK(){return V.tuple([V.literal("OK"),et.id(),V.boolean(),V.string()])}static relayEOSE(){return V.tuple([V.literal("EOSE"),V.string()])}static relayNOTICE(){return V.tuple([V.literal("NOTICE"),V.string()])}static relayCLOSED(){return V.tuple([V.literal("CLOSED"),V.string(),V.string()])}static relayAUTH(){return V.tuple([V.literal("AUTH"),V.string()])}static relayCOUNT(){return V.tuple([V.literal("COUNT"),V.string(),V.object({count:V.number().int().nonnegative(),approximate:V.boolean().optional()})])}static relayMsg(){return V.union([et.relayEVENT(),et.relayOK(),et.relayEOSE(),et.relayNOTICE(),et.relayCLOSED(),et.relayAUTH(),et.relayCOUNT()])}static metadata(){return V.object({about:V.string().optional().catch(void 0),banner:V.string().url().optional().catch(void 0),bot:V.boolean().optional().catch(void 0),display_name:V.string().optional().catch(void 0),lud06:et.bech32("lnurl").optional().catch(void 0),lud16:V.string().email().optional().catch(void 0),name:V.string().optional().catch(void 0),nip05:V.string().email().optional().catch(void 0),picture:V.string().url().optional().catch(void 0),website:V.string().url().optional().catch(void 0)}).passthrough()}static connectRequest(){return V.object({id:V.string(),method:V.string(),params:V.string().array()})}static connectResponse(){return V.object({id:V.string(),result:V.string(),error:V.string().optional()})}static json(){return V.string().transform((t,r)=>{try{return JSON.parse(t)}catch{return r.addIssue({code:V.ZodIssueCode.custom,message:"Invalid JSON"}),V.NEVER}})}}class KZ{socket;subscriptions=new Map;ee=new EventTarget;constructor(t,r={}){const{auth:i,backoff:s=new ZW(1e3),verifyEvent:o=ka}=r;this.socket=new QW(t).withBuffer(new YW).withBackoff(!1===s?void 0:s).onOpen(()=>{for(const a of this.subscriptions.values())this.send(a)}).onMessage((a,c)=>{const l=et.json().pipe(et.relayMsg()).safeParse(c.data);if(!l.success)return;const u=l.data;switch(u[0]){case"EVENT":case"EOSE":case"CLOSED":if("EVENT"===u[0]&&!o(u[2]))break;"CLOSED"===u[0]&&this.subscriptions.delete(u[1]),this.ee.dispatchEvent(new CustomEvent(`sub:${u[1]}`,{detail:u}));break;case"OK":this.ee.dispatchEvent(new CustomEvent(`ok:${u[1]}`,{detail:u}));break;case"NOTICE":this.ee.dispatchEvent(new CustomEvent("notice",{detail:u}));break;case"COUNT":this.ee.dispatchEvent(new CustomEvent(`count:${u[1]}`,{detail:u}));break;case"AUTH":i?.(u[1]).then(d=>this.send(["AUTH",d])).catch(()=>{})}}).build()}send(t){switch(t[0]){case"REQ":this.subscriptions.set(t[1],t);break;case"CLOSE":this.subscriptions.delete(t[1]);break;case"EVENT":case"COUNT":return this.socket.send(JSON.stringify(t))}this.socket.readyState===WebSocket.OPEN&&this.socket.send(JSON.stringify(t))}req(t,r={}){var i=this;return ip(function*(){const{signal:s}=r,o=crypto.randomUUID(),a=i.on(`sub:${o}`,s),c=["REQ",o,...t];i.send(c);try{var d,l=!1,u=!1;try{for(var h,f=ss(a);l=!(h=yield hs(f.next())).done;l=!1){const p=h.value;if("EOSE"===p[0]&&(yield p),"CLOSED"===p[0])break;if("EVENT"===p[0]){if(!Nh(t,p[2]))continue;yield p}}}catch(p){u=!0,d=p}finally{try{l&&null!=f.return&&(yield hs(f.return()))}finally{if(u)throw d}}}finally{i.send(["CLOSE",o])}})()}query(t,r){var i=this;return $(function*(){const s=new Kn,o=t.reduce((f,h)=>f+KM(h),0);if(0===o)return[];var l,a=!1,c=!1;try{for(var d,u=ss(i.req(t,r));a=!(d=yield u.next()).done;a=!1){const f=d.value;if("EOSE"===f[0])break;if("EVENT"===f[0]&&s.add(f[2]),"CLOSED"===f[0])throw new Error("Subscription closed");if(s.size>=o)break}}catch(f){c=!0,l=f}finally{try{a&&null!=u.return&&(yield u.return())}finally{if(c)throw l}}return[...s]})()}event(t,r){var i=this;return $(function*(){const s=i.once(`ok:${t.id}`,r?.signal);i.send(["EVENT",t]);const[,,o,a]=yield s;if(!o)throw new Error(a)})()}count(t,r){var i=this;return $(function*(){const s=crypto.randomUUID(),o=i.once(`count:${s}`,r?.signal);i.send(["COUNT",s,...t]);const[,,a]=yield o;return a})()}on(t,r){var i=this;return ip(function*(){if(r?.aborted)throw i.abortError();const s=new TR(r),o=f=>s.push(f.detail);i.ee.addEventListener(t,o);try{var l,a=!1,c=!1;try{for(var d,u=ss(s);a=!(d=yield hs(u.next())).done;a=!1)yield d.value}catch(f){c=!0,l=f}finally{try{a&&null!=u.return&&(yield hs(u.return()))}finally{if(c)throw l}}}finally{i.ee.removeEventListener(t,o)}})()}once(t,r){var i=this;return $(function*(){var a,s=!1,o=!1;try{for(var l,c=ss(i.on(t,r));s=!(l=yield c.next()).done;s=!1)return l.value}catch(u){o=!0,a=u}finally{try{s&&null!=c.return&&(yield c.return())}finally{if(o)throw a}}throw new Error("Unreachable")})()}abortError(){return new DOMException("The signal has been aborted","AbortError")}close(){var t=this;return $(function*(){t.socket.readyState!==WebSocket.CLOSED&&(yield new Promise(r=>{t.socket.addEventListener(Ge.close,r,{once:!0}),t.socket.close()}))})()}}function vu(e){return Nt((t,r)=>{try{t.subscribe(r)}finally{r.add(e)}})}class fp extends WW{constructor(){var t;super({open:t=>new KZ(t),reqRouter:(t=$(function*(r){const i=[];return"wss://nos.lol".split(",").forEach(s=>{i.push([s,r])}),new Map(i)}),function(i){return t.apply(this,arguments)}),eventRouter:function(){var t=$(function*(){return"wss://nos.lol".split(",")});return function(){return t.apply(this,arguments)}}()})}observe(t){var r=this;console.info((new Date).toLocaleString(),"[[subscribe filter]]",t);const i=new AbortController,s=new ot;return $(function*(){var c,o=!1,a=!1;try{for(var u,l=ss(r.req(t,i));o=!(u=yield l.next()).done;o=!1){const d=u.value;if("CLOSED"===d[0]){s.error(d);break}"EVENT"===d[0]&&s.next(d[2])}}catch(d){a=!0,c=d}finally{try{o&&null!=l.return&&(yield l.return())}finally{if(a)throw c}}})(),s.asObservable().pipe(vu(()=>{console.info((new Date).toLocaleString(),"[[unsubscribe filter]]",t),i.abort()}))}}let WR=(()=>{class e{constructor(){this.pubkeySet=new Set,this.loadList()}loadList(){try{const r=sessionStorage.getItem("alwaysIgnoreWannachat");if(r){let i=JSON.parse(r);i instanceof Array?this.pubkeySet=new Set(i):sessionStorage.setItem("alwaysIgnoreWannachat","[]")}}catch{sessionStorage.setItem("alwaysIgnoreWannachat","[]")}}saveInList(r){this.pubkeySet.add(r),sessionStorage.setItem("alwaysIgnoreWannachat",JSON.stringify([...this.pubkeySet]))}isInList(r){return this.pubkeySet.has(r)}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),ZR=(()=>{class e{constructor(r,i){this.npool=r,this.ignoreListService=i}listenUserStatusUpdate(r){return console.info((new Date).toLocaleString(),"observing filter:",[{kinds:[Kt.UserStatuses],"#t":["omegle"],authors:[r]}]),this.npool.observe([{kinds:[Kt.UserStatuses],"#t":["omegle"],authors:[r]}])}queryWannachatResponse(r){return console.info((new Date).toLocaleString(),"quering filter:",[{kinds:[Kt.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}]),this.npool.query([{kinds:[Kt.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}])}listenWannachatResponse(r){return console.info((new Date).toLocaleString(),"observing filter:",[{kinds:[Kt.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}]),this.npool.observe([{kinds:[Kt.UserStatuses],"#t":["chating","omegle"],"#p":[r.pubkey],limit:1}])}queryChatAvailable(){var r=this;return $(function*(){const i=Math.floor((new Date).getTime()/1e3);console.info((new Date).toLocaleString(),"quering filter: ",[{kinds:[Kt.UserStatuses],"#t":["wannachat","omegle"],since:i-600}]);let o=yield r.npool.query([{kinds:[Kt.UserStatuses],"#t":["wannachat","omegle"],since:i-600}]);o=o.filter(c=>!r.ignoreListService.isInList(c.pubkey));const a=o[Math.floor(Math.random()*o.length)];return a?console.info((new Date).toLocaleString(),"wanna chat found:",a):console.info((new Date).toLocaleString(),"wanna chat NOT found..."),Promise.resolve(a||null)})()}static#e=this.\u0275fac=function(i){return new(i||e)(G(fp),G(WR))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();class co{constructor(t){const{type:r,data:i}=Gl.decode(t);if("nsec"===r)this.nsec=t,this.secretKey=i,this.pubkey=UM(this.secretKey),this.npub=Gl.npubEncode(this.pubkey);else{if("npub"!==r)throw new Error("Invalid argument, NostrUser expect nsec or npub string");this.npub=t,this.pubkey=i.toString(),this.nsec=void 0,this.secretKey=void 0}}static fromPubkey(t){return new co(Gl.npubEncode(t))}static fromSecretKeyBytes(t){return new co(Gl.nsecEncode(t))}static create(){return this.fromSecretKeyBytes(M7())}toString(){return this.pubkey}}class QZ extends Rt{constructor(t,r){super()}schedule(t,r=0){return this}}const hp={setInterval(e,t,...r){const{delegate:i}=hp;return i?.setInterval?i.setInterval(e,t,...r):setInterval(e,t,...r)},clearInterval(e){const{delegate:t}=hp;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},KR={now:()=>(KR.delegate||Date).now(),delegate:void 0};class wu{constructor(t,r=wu.now){this.schedulerActionCtor=t,this.now=r}schedule(t,r=0,i){return new this.schedulerActionCtor(this,t).schedule(i,r)}}wu.now=KR.now;const XZ=new class JZ extends wu{constructor(t,r=wu.now){super(t,r),this.actions=[],this._active=!1}flush(t){const{actions:r}=this;if(this._active)return void r.push(t);let i;this._active=!0;do{if(i=t.execute(t.state,t.delay))break}while(t=r.shift());if(this._active=!1,i){for(;t=r.shift();)t.unsubscribe();throw i}}}(class YZ extends QZ{constructor(t,r){super(t,r),this.scheduler=t,this.work=r,this.pending=!1}schedule(t,r=0){var i;if(this.closed)return this;this.state=t;const s=this.id,o=this.scheduler;return null!=s&&(this.id=this.recycleAsyncId(o,s,r)),this.pending=!0,this.delay=r,this.id=null!==(i=this.id)&&void 0!==i?i:this.requestAsyncId(o,this.id,r),this}requestAsyncId(t,r,i=0){return hp.setInterval(t.flush.bind(t,this),i)}recycleAsyncId(t,r,i=0){if(null!=i&&this.delay===i&&!1===this.pending)return r;null!=r&&hp.clearInterval(r)}execute(t,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const i=this._execute(t,r);if(i)return i;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,r){let s,i=!1;try{this.work(t)}catch(o){i=!0,s=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s}unsubscribe(){if(!this.closed){const{id:t,scheduler:r}=this,{actions:i}=r;this.work=this.state=this.scheduler=null,this.pending=!1,Gu(i,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,super.unsubscribe()}}});function ys(e){return this instanceof ys?(this.v=e,this):new ys(e)}function XR(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,t=e[Symbol.asyncIterator];return t?t.call(e):(e=function g_(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=e[o]&&function(a){return new Promise(function(c,l){!function s(o,a,c,l){Promise.resolve(l).then(function(u){o({value:u,done:c})},a)}(c,l,(a=e[o](a)).done,a.value)})}}}"function"==typeof SuppressedError&&SuppressedError;const e2=e=>e&&"number"==typeof e.length&&"function"!=typeof e;function t2(e){return nt(e?.then)}function n2(e){return nt(e[ng])}function r2(e){return Symbol.asyncIterator&&nt(e?.[Symbol.asyncIterator])}function i2(e){return new TypeError(`You provided ${null!==e&&"object"==typeof e?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}const s2=function EK(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}();function o2(e){return nt(e?.[s2])}function a2(e){return function JR(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s,i=r.apply(e,t||[]),o=[];return s=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",function a(p){return function(g){return Promise.resolve(g).then(p,f)}}),s[Symbol.asyncIterator]=function(){return this},s;function c(p,g){i[p]&&(s[p]=function(m){return new Promise(function(y,v){o.push([p,m,y,v])>1||l(p,m)})},g&&(s[p]=g(s[p])))}function l(p,g){try{!function u(p){p.value instanceof ys?Promise.resolve(p.value.v).then(d,f):h(o[0][2],p)}(i[p](g))}catch(m){h(o[0][3],m)}}function d(p){l("next",p)}function f(p){l("throw",p)}function h(p,g){p(g),o.shift(),o.length&&l(o[0][0],o[0][1])}}(this,arguments,function*(){const r=e.getReader();try{for(;;){const{value:i,done:s}=yield ys(r.read());if(s)return yield ys(void 0);yield yield ys(i)}}finally{r.releaseLock()}})}function c2(e){return nt(e?.getReader)}function Kr(e){if(e instanceof Ot)return e;if(null!=e){if(n2(e))return function DK(e){return new Ot(t=>{const r=e[ng]();if(nt(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}(e);if(e2(e))return function CK(e){return new Ot(t=>{for(let r=0;r{e.then(r=>{t.closed||(t.next(r),t.complete())},r=>t.error(r)).then(null,zb)})}(e);if(r2(e))return l2(e);if(o2(e))return function IK(e){return new Ot(t=>{for(const r of e)if(t.next(r),t.closed)return;t.complete()})}(e);if(c2(e))return function TK(e){return l2(a2(e))}(e)}throw i2(e)}function l2(e){return new Ot(t=>{(function xK(e,t){var r,i,s,o;return function QR(e,t,r,i){return new(r||(r=Promise))(function(o,a){function c(d){try{u(i.next(d))}catch(f){a(f)}}function l(d){try{u(i.throw(d))}catch(f){a(f)}}function u(d){d.done?o(d.value):function s(o){return o instanceof r?o:new r(function(a){a(o)})}(d.value).then(c,l)}u((i=i.apply(e,t||[])).next())})}(this,void 0,void 0,function*(){try{for(r=XR(e);!(i=yield r.next()).done;)if(t.next(i.value),t.closed)return}catch(a){s={error:a}}finally{try{i&&!i.done&&(o=r.return)&&(yield o.call(r))}finally{if(s)throw s.error}}t.complete()})})(e,t).catch(r=>t.error(r))})}function Qr(e,t,r,i=0,s=!1){const o=t.schedule(function(){r(),s?e.add(this.schedule(null,i)):this.unsubscribe()},i);if(e.add(o),!s)return o}const AK=qu(e=>function(r=null){e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=r});function u2(e,t){const{first:r,each:i,with:s=MK,scheduler:o=t??XZ,meta:a=null}=function eK(e){return e instanceof Date&&!isNaN(e)}(e)?{first:e}:"number"==typeof e?{each:e}:e;if(null==r&&null==i)throw new TypeError("No timeout provided.");return Nt((c,l)=>{let u,d,f=null,h=0;const p=g=>{d=Qr(l,o,()=>{try{u.unsubscribe(),Kr(s({meta:a,lastValue:f,seen:h})).subscribe(l)}catch(m){l.error(m)}},g)};u=c.subscribe(_t(l,g=>{d?.unsubscribe(),h++,l.next(f=g),i>0&&p(i)},void 0,void 0,()=>{d?.closed||d?.unsubscribe(),f=null})),!h&&p(null!=r?"number"==typeof r?r:+r-o.now():i)})}function MK(e){throw new AK(e)}function vs(e){return Nt((t,r)=>{let o,i=null,s=!1;i=t.subscribe(_t(r,void 0,void 0,a=>{o=Kr(e(a,vs(e)(t))),i?(i.unsubscribe(),i=null,o.subscribe(r)):s=!0})),s&&(i.unsubscribe(),i=null,o.subscribe(r))})}function Ja(e,t){const r=nt(e)?e:()=>e,i=s=>s.error(r());return new Ot(t?s=>t.schedule(i,0,s):i)}let m_=(()=>{class e{constructor(r){this.globalConfigService=r,this.largeExpirationTime=1800}getCurrentTimestamp(){return Math.floor(Date.now()/1e3)}getExpirationTimestamp(r=this.globalConfigService.wannachatStatusDefaultTimeoutInSeconds){const s=Math.floor(Date.now()/1e3)+r;return String(s)}createEncryptedDirectMessage(r,i,s){var o=this;return $(function*(){const a=yield Kl.encrypt(r.secretKey,i.pubkey,s),c={kind:Kt.EncryptedDirectMessage,content:a,created_at:o.getCurrentTimestamp(),tags:[["p",i.pubkey],["expiration",o.getExpirationTimestamp(o.largeExpirationTime)]]},l=Zn(c,r.secretKey);return Promise.resolve(l)})()}createWannaChatUserStatus(r){return this.createUserStatus(r,"wannachat",[["expiration",this.getExpirationTimestamp()],["t","omegle"],["t","wannachat"]])}createDisconnectedUserStatus(r){return this.createUserStatus(r,"disconnected",[["expiration",this.getExpirationTimestamp()]])}createTypingUserStatus(r){return this.createUserStatus(r,"typing",[["t","omegle"],["expiration",this.getExpirationTimestamp(this.largeExpirationTime)]])}createChatingUserStatus(r,i){return this.createUserStatus(r,"chating",[["expiration",this.getExpirationTimestamp(this.largeExpirationTime)],["p",i.pubkey],["t","omegle"],["t","chating"]])}deleteUserHistory(r){const i={kind:5,tags:[["k",String(Kt.EncryptedDirectMessage)],["k",String(Kt.UserStatuses)],["expiration",this.getExpirationTimestamp()]],created_at:Math.floor((new Date).getTime()/1e3),content:""};return Zn(i,r.secretKey)}cleanUserStatus(r){return this.createUserStatus(r,"",[["t","omegle"]])}createUserStatus(r,i,s){const o=[["d","general"],...s||[]],a={kind:Kt.UserStatuses,content:i,created_at:this.getCurrentTimestamp(),tags:o};return Zn(a,r.secretKey)}static#e=this.\u0275fac=function(i){return new(i||e)(G(Kv))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),d2=(()=>{class e{constructor(r,i,s,o,a){this.nostrEventFactory=r,this.findStrangerNostr=i,this.ignoreListService=s,this.config=o,this.npool=a}publish(r){return this.npool.event(r)}searchStranger(r){var i=this;return $(function*(){const s=yield i.findStrangerNostr.queryChatAvailable();if(s){console.info((new Date).toLocaleString(),"inviting ",s.pubkey," to chat and listening confirmation");const o=i.listenChatingConfirmation(s,r);yield i.inviteToChating(r,s);const a=yield o;return i.ignoreListService.saveInList(s.pubkey),a?Promise.resolve(co.fromPubkey(s.pubkey)):(yield i.disconnect(r),i.searchStranger(r))}return yield i.publishWannaChatStatus(r),new Promise(o=>{const a=i.findStrangerNostr.listenWannachatResponse(r).pipe(u2(1e3*i.config.wannachatStatusDefaultTimeoutInSeconds),vs(c=>(a.unsubscribe(),i.deleteUserHistory(r).then(()=>i.searchStranger(r).then(l=>o(l))),Ja(()=>new c)))).subscribe({next:c=>{i.ignoreListService.saveInList(c.pubkey),i.replyChatInvitation(c,r).then(l=>l&&o(l)),a.unsubscribe()},error:c=>console.error((new Date).toLocaleString(),c)})})})()}replyChatInvitation(r,i){var s=this;return $(function*(){return console.info((new Date).toLocaleString(),"event was listen: ",r),console.info((new Date).toLocaleString(),"it must be a chating invitation from ",r.pubkey,", repling invitation..."),yield s.inviteToChating(i,r),console.info((new Date).toLocaleString(),"replied... resolving... "),console.info((new Date).toLocaleString(),"[searchStranger] unsubscribe"),Promise.resolve(co.fromPubkey(r.pubkey))})()}isChatingToMe(r,i){console.info((new Date).toLocaleString(),"is wannachat reply with chating? event: ",r);const s=r.tags.filter(([o])=>"p"===o).find(([,o])=>o===i.pubkey)||[];return console.info((new Date).toLocaleString(),"is wannachat reply with chating?",s.length?"yes":"no"),!!s.length}inviteToChating(r,i){const s=co.fromPubkey(i.pubkey);return this.publishChatInviteStatus(r,s)}listenChatingConfirmation(r,i){var s=this;return $(function*(){return new Promise(o=>{console.info((new Date).toLocaleString(),"listening status update from: ",r.pubkey);const a=s.findStrangerNostr.listenUserStatusUpdate(r.pubkey).pipe(u2(5e3),vs(c=>Ja(()=>new Error("chat confirmation timeout after 5s waiting, there is no stranger connected to this session")))).subscribe({next:c=>s.receiveChatingConfirmation(a,c,r,i).then(l=>{"boolean"==typeof l&&o(l)}),error:()=>o(!1)})})})()}receiveChatingConfirmation(r,i,s,o){return i.id===s.id&&"wannachat"===i.content?(console.info((new Date).toLocaleString(),"stranger #wannachat status was listen, ignoring and waiting new status..."),Promise.resolve(void 0)):(r.unsubscribe(),console.info((new Date).toLocaleString(),"[listenUserStatusUpdate] unsubscribe"),console.info((new Date).toLocaleString(),"stranger ",s.pubkey," update status: ",i),this.isChatingToMe(i,o)?(console.info((new Date).toLocaleString(),'is "chating" status confirmed, resolved with true'),Promise.resolve(!0)):(console.info((new Date).toLocaleString(),"unexpected status was given, resolved with false, event: ",i),Promise.resolve(!1)))}publishWannaChatStatus(r){var i=this;return $(function*(){const s=i.nostrEventFactory.createWannaChatUserStatus(r);return console.info((new Date).toLocaleString(),"updating my status to: ",s),yield i.npool.event(s),Promise.resolve(s)})()}publishChatInviteStatus(r,i){var s=this;return $(function*(){const o=s.nostrEventFactory.createChatingUserStatus(r,i);return console.info((new Date).toLocaleString(),"updating my status to: ",o),yield s.npool.event(o),Promise.resolve(o)})()}deleteUserHistory(r){var i=this;return $(function*(){const s=i.nostrEventFactory.deleteUserHistory(r);console.info((new Date).toLocaleString(),"deleting user history"),yield i.npool.event(s)})()}connect(){const r=co.create();return this.ignoreListService.saveInList(r.pubkey),r}disconnect(r){var i=this;return $(function*(){const s=i.nostrEventFactory.createDisconnectedUserStatus(r);return console.info((new Date).toLocaleString(),"updating my status to: ",s),yield i.deleteUserHistory(r),yield i.npool.event(s),Promise.resolve(s)})()}static#e=this.\u0275fac=function(i){return new(i||e)(G(m_),G(ZR),G(WR),G(Kv),G(fp))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})(),f2=(()=>{class e{constructor(r,i){this.nostrEventFactory=r,this.npool=i,this.updateUserCountTimeout=12e4}openEncryptedDirectMessage(r,i,s){return $(function*(){return Kl.decrypt(r.secretKey,i.pubkey,s.content)})()}listenMessages(r,i){return this.npool.observe([{kinds:[Kt.EncryptedDirectMessage],authors:[i.pubkey],"#p":[r.pubkey]}])}listenStrangerStatus(r){return this.npool.observe([{kinds:[Kt.UserStatuses],authors:[r.pubkey]}])}listenCurrenOnlineUsers(){const r=new ot;let i=!1;const s=()=>{i||(i=!0,console.info((new Date).toLocaleString(),"user count requested"),this.npool.query([{kinds:[Kt.UserStatuses],"#t":["omegle"]}]).then(a=>{const c=new Set;console.info((new Date).toLocaleString(),"count events",a),a.forEach(u=>c.add(u.pubkey));const l=[...c].length;console.info((new Date).toLocaleString(),"active users counted: ",l),r.next(l),i=!1}).catch(a=>{console.error((new Date).toLocaleString(),"user count lauched error",a),i=!1,clearInterval(o)}))},o=setInterval(s,this.updateUserCountTimeout);return s(),r.asObservable().pipe(vu(()=>clearInterval(o)))}sendMessage(r,i,s){var o=this;return $(function*(){yield o.stopTyping(r);const a=yield o.nostrEventFactory.createEncryptedDirectMessage(r,i,s);return o.npool.event(a)})()}isTyping(r){const i=this.nostrEventFactory.createTypingUserStatus(r);return this.npool.event(i)}stopTyping(r){const i=this.nostrEventFactory.cleanUserStatus(r);return this.npool.event(i)}static#e=this.\u0275fac=function(i){return new(i||e)(G(m_),G(fp))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})(),NK=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({providers:[ZR,d2,f2],imports:[Ea]})}return e})();function h2(e,t=0){return Nt((r,i)=>{r.subscribe(_t(i,s=>Qr(i,e,()=>i.next(s),t),()=>Qr(i,e,()=>i.complete(),t),s=>Qr(i,e,()=>i.error(s),t)))})}function p2(e,t=0){return Nt((r,i)=>{i.add(e.schedule(()=>r.subscribe(i),t))})}function g2(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ot(r=>{Qr(r,t,()=>{const i=e[Symbol.asyncIterator]();Qr(r,t,()=>{i.next().then(s=>{s.done?r.complete():r.next(s.value)})},0,!0)})})}function Ft(e,t){return t?function BK(e,t){if(null!=e){if(n2(e))return function OK(e,t){return Kr(e).pipe(p2(t),h2(t))}(e,t);if(e2(e))return function PK(e,t){return new Ot(r=>{let i=0;return t.schedule(function(){i===e.length?r.complete():(r.next(e[i++]),r.closed||this.schedule())})})}(e,t);if(t2(e))return function kK(e,t){return Kr(e).pipe(p2(t),h2(t))}(e,t);if(r2(e))return g2(e,t);if(o2(e))return function LK(e,t){return new Ot(r=>{let i;return Qr(r,t,()=>{i=e[s2](),Qr(r,t,()=>{let s,o;try{({value:s,done:o}=i.next())}catch(a){return void r.error(a)}o?r.complete():r.next(s)},0,!0)}),()=>nt(i?.return)&&i.return()})}(e,t);if(c2(e))return function FK(e,t){return g2(a2(e),t)}(e,t)}throw i2(e)}(e,t):Kr(e)}function y_(e){return e[e.length-1]}function pp(e){return function UK(e){return e&&nt(e.schedule)}(y_(e))?e.pop():void 0}function ue(...e){return Ft(e,pp(e))}const{isArray:$K}=Array,{getPrototypeOf:VK,prototype:HK,keys:zK}=Object;const{isArray:WK}=Array;function v_(...e){const t=pp(e),r=function jK(e){return nt(y_(e))?e.pop():void 0}(e),{args:i,keys:s}=function qK(e){if(1===e.length){const t=e[0];if($K(t))return{args:t,keys:null};if(function GK(e){return e&&"object"==typeof e&&VK(e)===HK}(t)){const r=zK(t);return{args:r.map(i=>t[i]),keys:r}}}return{args:e,keys:null}}(e);if(0===i.length)return Ft([],t);const o=new Ot(function YK(e,t,r=Cs){return i=>{m2(t,()=>{const{length:s}=e,o=new Array(s);let a=s,c=s;for(let l=0;l{const u=Ft(e[l],t);let d=!1;u.subscribe(_t(i,f=>{o[l]=f,d||(d=!0,c--),c||i.next(r(o.slice()))},()=>{--a||i.complete()}))},i)},i)}}(i,t,s?a=>function QK(e,t){return e.reduce((r,i,s)=>(r[i]=t[s],r),{})}(s,a):Cs));return r?o.pipe(function KK(e){return Ue(t=>function ZK(e,t){return WK(t)?e(...t):e(t)}(e,t))}(r)):o}function m2(e,t,r){e?Qr(r,e,t):t()}const gp=qu(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"});function Yt(e,t,r=1/0){return nt(t)?Yt((i,s)=>Ue((o,a)=>t(i,o,s,a))(Kr(e(i,s))),r):("number"==typeof t&&(r=t),Nt((i,s)=>function JK(e,t,r,i,s,o,a,c){const l=[];let u=0,d=0,f=!1;const h=()=>{f&&!l.length&&!u&&t.complete()},p=m=>u{o&&t.next(m),u++;let y=!1;Kr(r(m,d++)).subscribe(_t(t,v=>{s?.(v),o?p(v):t.next(v)},()=>{y=!0},void 0,()=>{if(y)try{for(u--;l.length&&ug(v)):g(v)}h()}catch(v){t.error(v)}}))};return e.subscribe(_t(t,p,()=>{f=!0,h()})),()=>{c?.()}}(i,s,e,r)))}function _u(e=1/0){return Yt(Cs,e)}function w_(...e){return function XK(){return _u(1)}()(Ft(e,pp(e)))}function y2(e){return new Ot(t=>{Kr(e()).subscribe(t)})}const Yr=new Ot(e=>e.complete());function __(){return Nt((e,t)=>{let r=null;e._refCount++;const i=_t(t,void 0,void 0,void 0,()=>{if(!e||e._refCount<=0||0<--e._refCount)return void(r=null);const s=e._connection,o=r;r=null,s&&(!o||s===o)&&s.unsubscribe(),t.unsubscribe()});e.subscribe(i),i.closed||(r=e.connect())})}class v2 extends Ot{constructor(t,r){super(),this.source=t,this.subjectFactory=r,this._subject=null,this._refCount=0,this._connection=null,Zb(t)&&(this.lift=t.lift)}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;const{_connection:t}=this;this._subject=this._connection=null,t?.unsubscribe()}connect(){let t=this._connection;if(!t){t=this._connection=new Rt;const r=this.getSubject();t.add(this.source.subscribe(_t(r,void 0,()=>{this._teardown(),r.complete()},i=>{this._teardown(),r.error(i)},()=>this._teardown()))),t.closed&&(this._connection=null,t=Rt.EMPTY)}return t}refCount(){return __()(this)}}function Jr(e,t){return Nt((r,i)=>{let s=null,o=0,a=!1;const c=()=>a&&!s&&i.complete();r.subscribe(_t(i,l=>{s?.unsubscribe();let u=0;const d=o++;Kr(e(l,d)).subscribe(s=_t(i,f=>i.next(t?t(l,f,d,u++):f),()=>{s=null,c()}))},()=>{a=!0,c()}))})}function Xa(e){return e<=0?()=>Yr:Nt((t,r)=>{let i=0;t.subscribe(_t(r,s=>{++i<=e&&(r.next(s),e<=i&&r.complete())}))})}function ws(e,t){return Nt((r,i)=>{let s=0;r.subscribe(_t(i,o=>e.call(t,o,s++)&&i.next(o)))})}function mp(e){return Nt((t,r)=>{let i=!1;t.subscribe(_t(r,s=>{i=!0,r.next(s)},()=>{i||r.next(e),r.complete()}))})}function w2(e=nQ){return Nt((t,r)=>{let i=!1;t.subscribe(_t(r,s=>{i=!0,r.next(s)},()=>i?r.complete():r.error(e())))})}function nQ(){return new gp}function lo(e,t){const r=arguments.length>=2;return i=>i.pipe(e?ws((s,o)=>e(s,o,i)):Cs,Xa(1),r?mp(t):w2(()=>new gp))}function bu(e,t){return nt(t)?Yt(e,t,1):Yt(e,1)}function dn(e,t,r){const i=nt(e)||t||r?{next:e,error:t,complete:r}:e;return i?Nt((s,o)=>{var a;null===(a=i.subscribe)||void 0===a||a.call(i);let c=!0;s.subscribe(_t(o,l=>{var u;null===(u=i.next)||void 0===u||u.call(i,l),o.next(l)},()=>{var l;c=!1,null===(l=i.complete)||void 0===l||l.call(i),o.complete()},l=>{var u;c=!1,null===(u=i.error)||void 0===u||u.call(i,l),o.error(l)},()=>{var l,u;c&&(null===(l=i.unsubscribe)||void 0===l||l.call(i)),null===(u=i.finalize)||void 0===u||u.call(i)}))}):Cs}function b_(e){return e<=0?()=>Yr:Nt((t,r)=>{let i=[];t.subscribe(_t(r,s=>{i.push(s),e{for(const s of i)r.next(s);r.complete()},void 0,()=>{i=null}))})}const ge="primary",Eu=Symbol("RouteTitle");class cQ{constructor(t){this.params=t||{}}has(t){return Object.prototype.hasOwnProperty.call(this.params,t)}get(t){if(this.has(t)){const r=this.params[t];return Array.isArray(r)?r[0]:r}return null}getAll(t){if(this.has(t)){const r=this.params[t];return Array.isArray(r)?r:[r]}return[]}get keys(){return Object.keys(this.params)}}function ec(e){return new cQ(e)}function lQ(e,t,r){const i=r.path.split("/");if(i.length>e.length||"full"===r.pathMatch&&(t.hasChildren()||i.lengthi[o]===s)}return e===t}function b2(e){return e.length>0?e[e.length-1]:null}function _s(e){return function RK(e){return!!e&&(e instanceof Ot||nt(e.lift)&&nt(e.subscribe))}(e)?e:Lf(e)?Ft(Promise.resolve(e)):ue(e)}const dQ={exact:function C2(e,t,r){if(!uo(e.segments,t.segments)||!yp(e.segments,t.segments,r)||e.numberOfChildren!==t.numberOfChildren)return!1;for(const i in t.children)if(!e.children[i]||!C2(e.children[i],t.children[i],r))return!1;return!0},subset:S2},E2={exact:function fQ(e,t){return Xr(e,t)},subset:function hQ(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(r=>_2(e[r],t[r]))},ignored:()=>!0};function D2(e,t,r){return dQ[r.paths](e.root,t.root,r.matrixParams)&&E2[r.queryParams](e.queryParams,t.queryParams)&&!("exact"===r.fragment&&e.fragment!==t.fragment)}function S2(e,t,r){return I2(e,t,t.segments,r)}function I2(e,t,r,i){if(e.segments.length>r.length){const s=e.segments.slice(0,r.length);return!(!uo(s,r)||t.hasChildren()||!yp(s,r,i))}if(e.segments.length===r.length){if(!uo(e.segments,r)||!yp(e.segments,r,i))return!1;for(const s in t.children)if(!e.children[s]||!S2(e.children[s],t.children[s],i))return!1;return!0}{const s=r.slice(0,e.segments.length),o=r.slice(e.segments.length);return!!(uo(e.segments,s)&&yp(e.segments,s,i)&&e.children[ge])&&I2(e.children[ge],t,o,i)}}function yp(e,t,r){return t.every((i,s)=>E2[r](e[s].parameters,i.parameters))}class tc{constructor(t=new Ve([],{}),r={},i=null){this.root=t,this.queryParams=r,this.fragment=i}get queryParamMap(){return this._queryParamMap??=ec(this.queryParams),this._queryParamMap}toString(){return mQ.serialize(this)}}class Ve{constructor(t,r){this.segments=t,this.children=r,this.parent=null,Object.values(r).forEach(i=>i.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return vp(this)}}class Du{constructor(t,r){this.path=t,this.parameters=r}get parameterMap(){return this._parameterMap??=ec(this.parameters),this._parameterMap}toString(){return A2(this)}}function uo(e,t){return e.length===t.length&&e.every((r,i)=>r.path===t[i].path)}let nc=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>new D_,providedIn:"root"})}return e})();class D_{parse(t){const r=new TQ(t);return new tc(r.parseRootSegment(),r.parseQueryParams(),r.parseFragment())}serialize(t){const r=`/${Cu(t.root,!0)}`,i=function wQ(e){const t=Object.entries(e).map(([r,i])=>Array.isArray(i)?i.map(s=>`${wp(r)}=${wp(s)}`).join("&"):`${wp(r)}=${wp(i)}`).filter(r=>r);return t.length?`?${t.join("&")}`:""}(t.queryParams),s="string"==typeof t.fragment?`#${function yQ(e){return encodeURI(e)}(t.fragment)}`:"";return`${r}${i}${s}`}}const mQ=new D_;function vp(e){return e.segments.map(t=>A2(t)).join("/")}function Cu(e,t){if(!e.hasChildren())return vp(e);if(t){const r=e.children[ge]?Cu(e.children[ge],!1):"",i=[];return Object.entries(e.children).forEach(([s,o])=>{s!==ge&&i.push(`${s}:${Cu(o,!1)}`)}),i.length>0?`${r}(${i.join("//")})`:r}{const r=function gQ(e,t){let r=[];return Object.entries(e.children).forEach(([i,s])=>{i===ge&&(r=r.concat(t(s,i)))}),Object.entries(e.children).forEach(([i,s])=>{i!==ge&&(r=r.concat(t(s,i)))}),r}(e,(i,s)=>s===ge?[Cu(e.children[ge],!1)]:[`${s}:${Cu(i,!1)}`]);return 1===Object.keys(e.children).length&&null!=e.children[ge]?`${vp(e)}/${r[0]}`:`${vp(e)}/(${r.join("//")})`}}function T2(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function wp(e){return T2(e).replace(/%3B/gi,";")}function C_(e){return T2(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function _p(e){return decodeURIComponent(e)}function x2(e){return _p(e.replace(/\+/g,"%20"))}function A2(e){return`${C_(e.path)}${function vQ(e){return Object.entries(e).map(([t,r])=>`;${C_(t)}=${C_(r)}`).join("")}(e.parameters)}`}const _Q=/^[^\/()?;#]+/;function S_(e){const t=e.match(_Q);return t?t[0]:""}const bQ=/^[^\/()?;=#]+/,DQ=/^[^=?&#]+/,SQ=/^[^&#]+/;class TQ{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Ve([],{}):new Ve([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let r={};this.peekStartsWith("/(")&&(this.capture("/"),r=this.parseParens(!0));let i={};return this.peekStartsWith("(")&&(i=this.parseParens(!1)),(t.length>0||Object.keys(r).length>0)&&(i[ge]=new Ve(t,r)),i}parseSegment(){const t=S_(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new M(4009,!1);return this.capture(t),new Du(_p(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const r=function EQ(e){const t=e.match(bQ);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let i="";if(this.consumeOptional("=")){const s=S_(this.remaining);s&&(i=s,this.capture(i))}t[_p(r)]=_p(i)}parseQueryParam(t){const r=function CQ(e){const t=e.match(DQ);return t?t[0]:""}(this.remaining);if(!r)return;this.capture(r);let i="";if(this.consumeOptional("=")){const a=function IQ(e){const t=e.match(SQ);return t?t[0]:""}(this.remaining);a&&(i=a,this.capture(i))}const s=x2(r),o=x2(i);if(t.hasOwnProperty(s)){let a=t[s];Array.isArray(a)||(a=[a],t[s]=a),a.push(o)}else t[s]=o}parseParens(t){const r={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const i=S_(this.remaining),s=this.remaining[i.length];if("/"!==s&&")"!==s&&";"!==s)throw new M(4010,!1);let o;i.indexOf(":")>-1?(o=i.slice(0,i.indexOf(":")),this.capture(o),this.capture(":")):t&&(o=ge);const a=this.parseChildren();r[o]=1===Object.keys(a).length?a[ge]:new Ve([],a),this.consumeOptional("//")}return r}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new M(4011,!1)}}function M2(e){return e.segments.length>0?new Ve([],{[ge]:e}):e}function N2(e){const t={};for(const[i,s]of Object.entries(e.children)){const o=N2(s);if(i===ge&&0===o.segments.length&&o.hasChildren())for(const[a,c]of Object.entries(o.children))t[a]=c;else(o.segments.length>0||o.hasChildren())&&(t[i]=o)}return function xQ(e){if(1===e.numberOfChildren&&e.children[ge]){const t=e.children[ge];return new Ve(e.segments.concat(t.segments),t.children)}return e}(new Ve(e.segments,t))}function rc(e){return e instanceof tc}function R2(e){let t;const s=M2(function r(o){const a={};for(const l of o.children){const u=r(l);a[l.outlet]=u}const c=new Ve(o.url,a);return o===e&&(t=c),c}(e.root));return t??s}function O2(e,t,r,i){let s=e;for(;s.parent;)s=s.parent;if(0===t.length)return I_(s,s,s,r,i);const o=function MQ(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new P2(!0,0,e);let t=0,r=!1;const i=e.reduce((s,o,a)=>{if("object"==typeof o&&null!=o){if(o.outlets){const c={};return Object.entries(o.outlets).forEach(([l,u])=>{c[l]="string"==typeof u?u.split("/"):u}),[...s,{outlets:c}]}if(o.segmentPath)return[...s,o.segmentPath]}return"string"!=typeof o?[...s,o]:0===a?(o.split("/").forEach((c,l)=>{0==l&&"."===c||(0==l&&""===c?r=!0:".."===c?t++:""!=c&&s.push(c))}),s):[...s,o]},[]);return new P2(r,t,i)}(t);if(o.toRoot())return I_(s,s,new Ve([],{}),r,i);const a=function NQ(e,t,r){if(e.isAbsolute)return new Ep(t,!0,0);if(!r)return new Ep(t,!1,NaN);if(null===r.parent)return new Ep(r,!0,0);const i=bp(e.commands[0])?0:1;return function RQ(e,t,r){let i=e,s=t,o=r;for(;o>s;){if(o-=s,i=i.parent,!i)throw new M(4005,!1);s=i.segments.length}return new Ep(i,!1,s-o)}(r,r.segments.length-1+i,e.numberOfDoubleDots)}(o,s,e),c=a.processChildren?Iu(a.segmentGroup,a.index,o.commands):L2(a.segmentGroup,a.index,o.commands);return I_(s,a.segmentGroup,c,r,i)}function bp(e){return"object"==typeof e&&null!=e&&!e.outlets&&!e.segmentPath}function Su(e){return"object"==typeof e&&null!=e&&e.outlets}function I_(e,t,r,i,s){let a,o={};i&&Object.entries(i).forEach(([l,u])=>{o[l]=Array.isArray(u)?u.map(d=>`${d}`):`${u}`}),a=e===t?r:k2(e,t,r);const c=M2(N2(a));return new tc(c,o,s)}function k2(e,t,r){const i={};return Object.entries(e.children).forEach(([s,o])=>{i[s]=o===t?r:k2(o,t,r)}),new Ve(e.segments,i)}class P2{constructor(t,r,i){if(this.isAbsolute=t,this.numberOfDoubleDots=r,this.commands=i,t&&i.length>0&&bp(i[0]))throw new M(4003,!1);const s=i.find(Su);if(s&&s!==b2(i))throw new M(4004,!1)}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Ep{constructor(t,r,i){this.segmentGroup=t,this.processChildren=r,this.index=i}}function L2(e,t,r){if(e??=new Ve([],{}),0===e.segments.length&&e.hasChildren())return Iu(e,t,r);const i=function kQ(e,t,r){let i=0,s=t;const o={match:!1,pathIndex:0,commandIndex:0};for(;s=r.length)return o;const a=e.segments[s],c=r[i];if(Su(c))break;const l=`${c}`,u=i0&&void 0===l)break;if(l&&u&&"object"==typeof u&&void 0===u.outlets){if(!B2(l,u,a))return o;i+=2}else{if(!B2(l,{},a))return o;i++}s++}return{match:!0,pathIndex:s,commandIndex:i}}(e,t,r),s=r.slice(i.commandIndex);if(i.match&&i.pathIndexo!==ge)&&e.children[ge]&&1===e.numberOfChildren&&0===e.children[ge].segments.length){const o=Iu(e.children[ge],t,r);return new Ve(e.segments,o.children)}return Object.entries(i).forEach(([o,a])=>{"string"==typeof a&&(a=[a]),null!==a&&(s[o]=L2(e.children[o],t,a))}),Object.entries(e.children).forEach(([o,a])=>{void 0===i[o]&&(s[o]=a)}),new Ve(e.segments,s)}}function T_(e,t,r){const i=e.segments.slice(0,t);let s=0;for(;s{"string"==typeof i&&(i=[i]),null!==i&&(t[r]=T_(new Ve([],{}),0,i))}),t}function F2(e){const t={};return Object.entries(e).forEach(([r,i])=>t[r]=`${i}`),t}function B2(e,t,r){return e==r.path&&Xr(t,r.parameters)}const Tu="imperative";var Te=function(e){return e[e.NavigationStart=0]="NavigationStart",e[e.NavigationEnd=1]="NavigationEnd",e[e.NavigationCancel=2]="NavigationCancel",e[e.NavigationError=3]="NavigationError",e[e.RoutesRecognized=4]="RoutesRecognized",e[e.ResolveStart=5]="ResolveStart",e[e.ResolveEnd=6]="ResolveEnd",e[e.GuardsCheckStart=7]="GuardsCheckStart",e[e.GuardsCheckEnd=8]="GuardsCheckEnd",e[e.RouteConfigLoadStart=9]="RouteConfigLoadStart",e[e.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",e[e.ChildActivationStart=11]="ChildActivationStart",e[e.ChildActivationEnd=12]="ChildActivationEnd",e[e.ActivationStart=13]="ActivationStart",e[e.ActivationEnd=14]="ActivationEnd",e[e.Scroll=15]="Scroll",e[e.NavigationSkipped=16]="NavigationSkipped",e}(Te||{});class ei{constructor(t,r){this.id=t,this.url=r}}class Dp extends ei{constructor(t,r,i="imperative",s=null){super(t,r),this.type=Te.NavigationStart,this.navigationTrigger=i,this.restoredState=s}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class Ri extends ei{constructor(t,r,i){super(t,r),this.urlAfterRedirects=i,this.type=Te.NavigationEnd}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}var Fn=function(e){return e[e.Redirect=0]="Redirect",e[e.SupersededByNewNavigation=1]="SupersededByNewNavigation",e[e.NoDataFromResolver=2]="NoDataFromResolver",e[e.GuardRejected=3]="GuardRejected",e}(Fn||{}),Cp=function(e){return e[e.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",e[e.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",e}(Cp||{});class ic extends ei{constructor(t,r,i,s){super(t,r),this.reason=i,this.code=s,this.type=Te.NavigationCancel}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class sc extends ei{constructor(t,r,i,s){super(t,r),this.reason=i,this.code=s,this.type=Te.NavigationSkipped}}class Sp extends ei{constructor(t,r,i,s){super(t,r),this.error=i,this.target=s,this.type=Te.NavigationError}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class U2 extends ei{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Te.RoutesRecognized}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class LQ extends ei{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Te.GuardsCheckStart}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class FQ extends ei{constructor(t,r,i,s,o){super(t,r),this.urlAfterRedirects=i,this.state=s,this.shouldActivate=o,this.type=Te.GuardsCheckEnd}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class BQ extends ei{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Te.ResolveStart}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class UQ extends ei{constructor(t,r,i,s){super(t,r),this.urlAfterRedirects=i,this.state=s,this.type=Te.ResolveEnd}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class jQ{constructor(t){this.route=t,this.type=Te.RouteConfigLoadStart}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class $Q{constructor(t){this.route=t,this.type=Te.RouteConfigLoadEnd}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class VQ{constructor(t){this.snapshot=t,this.type=Te.ChildActivationStart}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class HQ{constructor(t){this.snapshot=t,this.type=Te.ChildActivationEnd}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class zQ{constructor(t){this.snapshot=t,this.type=Te.ActivationStart}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class qQ{constructor(t){this.snapshot=t,this.type=Te.ActivationEnd}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class j2{constructor(t,r,i){this.routerEvent=t,this.position=r,this.anchor=i,this.type=Te.Scroll}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class x_{}class A_{constructor(t){this.url=t}}class GQ{constructor(){this.outlet=null,this.route=null,this.injector=null,this.children=new xu,this.attachRef=null}}let xu=(()=>{class e{constructor(){this.contexts=new Map}onChildOutletCreated(r,i){const s=this.getOrCreateContext(r);s.outlet=i,this.contexts.set(r,s)}onChildOutletDestroyed(r){const i=this.getContext(r);i&&(i.outlet=null,i.attachRef=null)}onOutletDeactivated(){const r=this.contexts;return this.contexts=new Map,r}onOutletReAttached(r){this.contexts=r}getOrCreateContext(r){let i=this.getContext(r);return i||(i=new GQ,this.contexts.set(r,i)),i}getContext(r){return this.contexts.get(r)||null}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();class $2{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const r=this.pathFromRoot(t);return r.length>1?r[r.length-2]:null}children(t){const r=M_(t,this._root);return r?r.children.map(i=>i.value):[]}firstChild(t){const r=M_(t,this._root);return r&&r.children.length>0?r.children[0].value:null}siblings(t){const r=N_(t,this._root);return r.length<2?[]:r[r.length-2].children.map(s=>s.value).filter(s=>s!==t)}pathFromRoot(t){return N_(t,this._root).map(r=>r.value)}}function M_(e,t){if(e===t.value)return t;for(const r of t.children){const i=M_(e,r);if(i)return i}return null}function N_(e,t){if(e===t.value)return[t];for(const r of t.children){const i=N_(e,r);if(i.length)return i.unshift(t),i}return[]}class vr{constructor(t,r){this.value=t,this.children=r}toString(){return`TreeNode(${this.value})`}}function oc(e){const t={};return e&&e.children.forEach(r=>t[r.value.outlet]=r),t}class V2 extends $2{constructor(t,r){super(t),this.snapshot=r,k_(this,t)}toString(){return this.snapshot.toString()}}function H2(e){const t=function WQ(e){const o=new O_([],{},{},"",{},ge,e,null,{});return new z2("",new vr(o,[]))}(e),r=new jn([new Du("",{})]),i=new jn({}),s=new jn({}),o=new jn({}),a=new jn(""),c=new ac(r,i,o,a,s,ge,e,t.root);return c.snapshot=t.root,new V2(new vr(c,[]),t)}class ac{constructor(t,r,i,s,o,a,c,l){this.urlSubject=t,this.paramsSubject=r,this.queryParamsSubject=i,this.fragmentSubject=s,this.dataSubject=o,this.outlet=a,this.component=c,this._futureSnapshot=l,this.title=this.dataSubject?.pipe(Ue(u=>u[Eu]))??ue(void 0),this.url=t,this.params=r,this.queryParams=i,this.fragment=s,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(Ue(t=>ec(t))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(Ue(t=>ec(t))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function R_(e,t,r="emptyOnly"){let i;const{routeConfig:s}=e;return i=null===t||"always"!==r&&""!==s?.path&&(t.component||t.routeConfig?.loadComponent)?{params:{...e.params},data:{...e.data},resolve:{...e.data,...e._resolvedData??{}}}:{params:{...t.params,...e.params},data:{...t.data,...e.data},resolve:{...e.data,...t.data,...s?.data,...e._resolvedData}},s&&G2(s)&&(i.resolve[Eu]=s.title),i}class O_{get title(){return this.data?.[Eu]}constructor(t,r,i,s,o,a,c,l,u){this.url=t,this.params=r,this.queryParams=i,this.fragment=s,this.data=o,this.outlet=a,this.component=c,this.routeConfig=l,this._resolve=u}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??=ec(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=ec(this.queryParams),this._queryParamMap}toString(){return`Route(url:'${this.url.map(i=>i.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class z2 extends $2{constructor(t,r){super(r),this.url=t,k_(this,r)}toString(){return q2(this._root)}}function k_(e,t){t.value._routerState=e,t.children.forEach(r=>k_(e,r))}function q2(e){const t=e.children.length>0?` { ${e.children.map(q2).join(", ")} } `:"";return`${e.value}${t}`}function P_(e){if(e.snapshot){const t=e.snapshot,r=e._futureSnapshot;e.snapshot=r,Xr(t.queryParams,r.queryParams)||e.queryParamsSubject.next(r.queryParams),t.fragment!==r.fragment&&e.fragmentSubject.next(r.fragment),Xr(t.params,r.params)||e.paramsSubject.next(r.params),function uQ(e,t){if(e.length!==t.length)return!1;for(let r=0;rXr(r.parameters,t[i].parameters))}(e.url,t.url);return r&&!(!e.parent!=!t.parent)&&(!e.parent||L_(e.parent,t.parent))}function G2(e){return"string"==typeof e.title||null===e.title}let F_=(()=>{class e{constructor(){this.activated=null,this._activatedRoute=null,this.name=ge,this.activateEvents=new rn,this.deactivateEvents=new rn,this.attachEvents=new rn,this.detachEvents=new rn,this.parentContexts=P(xu),this.location=P(or),this.changeDetector=P(Uf),this.environmentInjector=P(gn),this.inputBinder=P(Ip,{optional:!0}),this.supportsBindingToComponentInputs=!0}get activatedComponentRef(){return this.activated}ngOnChanges(r){if(r.name){const{firstChange:i,previousValue:s}=r.name;if(i)return;this.isTrackedInParentContexts(s)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(s)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(r){return this.parentContexts.getContext(r)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;const r=this.parentContexts.getContext(this.name);r?.route&&(r.attachRef?this.attach(r.attachRef,r.route):this.activateWith(r.route,r.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new M(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new M(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new M(4012,!1);this.location.detach();const r=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(r.instance),r}attach(r,i){this.activated=r,this._activatedRoute=i,this.location.insert(r.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(r.instance)}deactivate(){if(this.activated){const r=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(r)}}activateWith(r,i){if(this.isActivated)throw new M(4013,!1);this._activatedRoute=r;const s=this.location,a=r.snapshot.component,c=this.parentContexts.getOrCreateContext(this.name).children,l=new B_(r,c,s.injector);this.activated=s.createComponent(a,{index:s.length,injector:l,environmentInjector:i??this.environmentInjector}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275dir=Xt({type:e,selectors:[["router-outlet"]],inputs:{name:"name"},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],standalone:!0,features:[Ms]})}return e})();class B_{__ngOutletInjector(t){return new B_(this.route,this.childContexts,t)}constructor(t,r,i){this.route=t,this.childContexts=r,this.parent=i}get(t,r){return t===ac?this.route:t===xu?this.childContexts:this.parent.get(t,r)}}const Ip=new K("");let W2=(()=>{class e{constructor(){this.outletDataSubscriptions=new Map}bindActivatedRouteToOutletComponent(r){this.unsubscribeFromRouteData(r),this.subscribeToRouteData(r)}unsubscribeFromRouteData(r){this.outletDataSubscriptions.get(r)?.unsubscribe(),this.outletDataSubscriptions.delete(r)}subscribeToRouteData(r){const{activatedRoute:i}=r,s=v_([i.queryParams,i.params,i.data]).pipe(Jr(([o,a,c],l)=>(c={...o,...a,...c},0===l?ue(c):Promise.resolve(c)))).subscribe(o=>{if(!r.isActivated||!r.activatedComponentRef||r.activatedRoute!==i||null===i.component)return void this.unsubscribeFromRouteData(r);const a=function iV(e){const t=we(e);if(!t)return null;const r=new ll(t);return{get selector(){return r.selector},get type(){return r.componentType},get inputs(){return r.inputs},get outputs(){return r.outputs},get ngContentSelectors(){return r.ngContentSelectors},get isStandalone(){return t.standalone},get isSignal(){return t.signals}}}(i.component);if(a)for(const{templateName:c}of a.inputs)r.activatedComponentRef.setInput(c,o[c]);else this.unsubscribeFromRouteData(r)});this.outletDataSubscriptions.set(r,s)}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();function Au(e,t,r){if(r&&e.shouldReuseRoute(t.value,r.value.snapshot)){const i=r.value;i._futureSnapshot=t.value;const s=function KQ(e,t,r){return t.children.map(i=>{for(const s of r.children)if(e.shouldReuseRoute(i.value,s.value.snapshot))return Au(e,i,s);return Au(e,i)})}(e,t,r);return new vr(i,s)}{if(e.shouldAttach(t.value)){const o=e.retrieve(t.value);if(null!==o){const a=o.route;return a.value._futureSnapshot=t.value,a.children=t.children.map(c=>Au(e,c)),a}}const i=function QQ(e){return new ac(new jn(e.url),new jn(e.params),new jn(e.queryParams),new jn(e.fragment),new jn(e.data),e.outlet,e.component,e)}(t.value),s=t.children.map(o=>Au(e,o));return new vr(i,s)}}const Z2="ngNavigationCancelingError";function K2(e,t){const{redirectTo:r,navigationBehaviorOptions:i}=rc(t)?{redirectTo:t,navigationBehaviorOptions:void 0}:t,s=Q2(!1,Fn.Redirect);return s.url=r,s.navigationBehaviorOptions=i,s}function Q2(e,t){const r=new Error(`NavigationCancelingError: ${e||""}`);return r[Z2]=!0,r.cancellationCode=t,r}function Y2(e){return!!e&&e[Z2]}let J2=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275cmp=So({type:e,selectors:[["ng-component"]],standalone:!0,features:[Mf],decls:1,vars:0,template:function(i,s){1&i&&mi(0,"router-outlet")},dependencies:[F_],encapsulation:2})}return e})();function U_(e){const t=e.children&&e.children.map(U_),r=t?{...e,children:t}:{...e};return!r.component&&!r.loadComponent&&(t||r.loadChildren)&&r.outlet&&r.outlet!==ge&&(r.component=J2),r}function ti(e){return e.outlet||ge}function Mu(e){if(!e)return null;if(e.routeConfig?._injector)return e.routeConfig._injector;for(let t=e.parent;t;t=t.parent){const r=t.routeConfig;if(r?._loadedInjector)return r._loadedInjector;if(r?._injector)return r._injector}return null}class iY{constructor(t,r,i,s,o){this.routeReuseStrategy=t,this.futureState=r,this.currState=i,this.forwardEvent=s,this.inputBindingEnabled=o}activate(t){const r=this.futureState._root,i=this.currState?this.currState._root:null;this.deactivateChildRoutes(r,i,t),P_(this.futureState.root),this.activateChildRoutes(r,i,t)}deactivateChildRoutes(t,r,i){const s=oc(r);t.children.forEach(o=>{const a=o.value.outlet;this.deactivateRoutes(o,s[a],i),delete s[a]}),Object.values(s).forEach(o=>{this.deactivateRouteAndItsChildren(o,i)})}deactivateRoutes(t,r,i){const s=t.value,o=r?r.value:null;if(s===o)if(s.component){const a=i.getContext(s.outlet);a&&this.deactivateChildRoutes(t,r,a.children)}else this.deactivateChildRoutes(t,r,i);else o&&this.deactivateRouteAndItsChildren(r,i)}deactivateRouteAndItsChildren(t,r){t.value.component&&this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,r):this.deactivateRouteAndOutlet(t,r)}detachAndStoreRouteSubtree(t,r){const i=r.getContext(t.value.outlet),s=i&&t.value.component?i.children:r,o=oc(t);for(const a of Object.values(o))this.deactivateRouteAndItsChildren(a,s);if(i&&i.outlet){const a=i.outlet.detach(),c=i.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:a,route:t,contexts:c})}}deactivateRouteAndOutlet(t,r){const i=r.getContext(t.value.outlet),s=i&&t.value.component?i.children:r,o=oc(t);for(const a of Object.values(o))this.deactivateRouteAndItsChildren(a,s);i&&(i.outlet&&(i.outlet.deactivate(),i.children.onOutletDeactivated()),i.attachRef=null,i.route=null)}activateChildRoutes(t,r,i){const s=oc(r);t.children.forEach(o=>{this.activateRoutes(o,s[o.value.outlet],i),this.forwardEvent(new qQ(o.value.snapshot))}),t.children.length&&this.forwardEvent(new HQ(t.value.snapshot))}activateRoutes(t,r,i){const s=t.value,o=r?r.value:null;if(P_(s),s===o)if(s.component){const a=i.getOrCreateContext(s.outlet);this.activateChildRoutes(t,r,a.children)}else this.activateChildRoutes(t,r,i);else if(s.component){const a=i.getOrCreateContext(s.outlet);if(this.routeReuseStrategy.shouldAttach(s.snapshot)){const c=this.routeReuseStrategy.retrieve(s.snapshot);this.routeReuseStrategy.store(s.snapshot,null),a.children.onOutletReAttached(c.contexts),a.attachRef=c.componentRef,a.route=c.route.value,a.outlet&&a.outlet.attach(c.componentRef,c.route.value),P_(c.route.value),this.activateChildRoutes(t,null,a.children)}else{const c=Mu(s.snapshot);a.attachRef=null,a.route=s,a.injector=c,a.outlet&&a.outlet.activateWith(s,a.injector),this.activateChildRoutes(t,null,a.children)}}else this.activateChildRoutes(t,null,i)}}class X2{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class Tp{constructor(t,r){this.component=t,this.route=r}}function sY(e,t,r){const i=e._root;return Nu(i,t?t._root:null,r,[i.value])}function cc(e,t){const r=Symbol(),i=t.get(e,r);return i===r?"function"!=typeof e||function Fk(e){return null!==Ju(e)}(e)?t.get(e):e:i}function Nu(e,t,r,i,s={canDeactivateChecks:[],canActivateChecks:[]}){const o=oc(t);return e.children.forEach(a=>{(function aY(e,t,r,i,s={canDeactivateChecks:[],canActivateChecks:[]}){const o=e.value,a=t?t.value:null,c=r?r.getContext(e.value.outlet):null;if(a&&o.routeConfig===a.routeConfig){const l=function cY(e,t,r){if("function"==typeof r)return r(e,t);switch(r){case"pathParamsChange":return!uo(e.url,t.url);case"pathParamsOrQueryParamsChange":return!uo(e.url,t.url)||!Xr(e.queryParams,t.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!L_(e,t)||!Xr(e.queryParams,t.queryParams);default:return!L_(e,t)}}(a,o,o.routeConfig.runGuardsAndResolvers);l?s.canActivateChecks.push(new X2(i)):(o.data=a.data,o._resolvedData=a._resolvedData),Nu(e,t,o.component?c?c.children:null:r,i,s),l&&c&&c.outlet&&c.outlet.isActivated&&s.canDeactivateChecks.push(new Tp(c.outlet.component,a))}else a&&Ru(t,c,s),s.canActivateChecks.push(new X2(i)),Nu(e,null,o.component?c?c.children:null:r,i,s)})(a,o[a.value.outlet],r,i.concat([a.value]),s),delete o[a.value.outlet]}),Object.entries(o).forEach(([a,c])=>Ru(c,r.getContext(a),s)),s}function Ru(e,t,r){const i=oc(e),s=e.value;Object.entries(i).forEach(([o,a])=>{Ru(a,s.component?t?t.children.getContext(o):null:t,r)}),r.canDeactivateChecks.push(new Tp(s.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,s))}function Ou(e){return"function"==typeof e}function eO(e){return e instanceof gp||"EmptyError"===e?.name}const xp=Symbol("INITIAL_VALUE");function lc(){return Jr(e=>v_(e.map(t=>t.pipe(Xa(1),function tQ(...e){const t=pp(e);return Nt((r,i)=>{(t?w_(e,r,t):w_(e,r)).subscribe(i)})}(xp)))).pipe(Ue(t=>{for(const r of t)if(!0!==r){if(r===xp)return xp;if(!1===r||r instanceof tc)return r}return!0}),ws(t=>t!==xp),Xa(1)))}function tO(e){return function Tk(...e){return qb(e)}(dn(t=>{if(rc(t))throw K2(0,t)}),Ue(t=>!0===t))}class j_{constructor(t){this.segmentGroup=t||null}}class $_ extends Error{constructor(t){super(),this.urlTree=t}}function uc(e){return Ja(new j_(e))}class TY{constructor(t,r){this.urlSerializer=t,this.urlTree=r}lineralizeSegments(t,r){let i=[],s=r.root;for(;;){if(i=i.concat(s.segments),0===s.numberOfChildren)return ue(i);if(s.numberOfChildren>1||!s.children[ge])return Ja(new M(4e3,!1));s=s.children[ge]}}applyRedirectCommands(t,r,i){const s=this.applyRedirectCreateUrlTree(r,this.urlSerializer.parse(r),t,i);if(r.startsWith("/"))throw new $_(s);return s}applyRedirectCreateUrlTree(t,r,i,s){const o=this.createSegmentGroup(t,r.root,i,s);return new tc(o,this.createQueryParams(r.queryParams,this.urlTree.queryParams),r.fragment)}createQueryParams(t,r){const i={};return Object.entries(t).forEach(([s,o])=>{if("string"==typeof o&&o.startsWith(":")){const c=o.substring(1);i[s]=r[c]}else i[s]=o}),i}createSegmentGroup(t,r,i,s){const o=this.createSegments(t,r.segments,i,s);let a={};return Object.entries(r.children).forEach(([c,l])=>{a[c]=this.createSegmentGroup(t,l,i,s)}),new Ve(o,a)}createSegments(t,r,i,s){return r.map(o=>o.path.startsWith(":")?this.findPosParam(t,o,s):this.findOrReturn(o,i))}findPosParam(t,r,i){const s=i[r.path.substring(1)];if(!s)throw new M(4001,!1);return s}findOrReturn(t,r){let i=0;for(const s of r){if(s.path===t.path)return r.splice(i),s;i++}return t}}const V_={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function xY(e,t,r,i,s){const o=H_(e,t,r);return o.matched?(i=function JQ(e,t){return e.providers&&!e._injector&&(e._injector=hf(e.providers,t,`Route: ${e.path}`)),e._injector??t}(t,i),function CY(e,t,r,i){const s=t.canMatch;return s&&0!==s.length?ue(s.map(a=>{const c=cc(a,e);return _s(function pY(e){return e&&Ou(e.canMatch)}(c)?c.canMatch(t,r):oi(e,()=>c(t,r)))})).pipe(lc(),tO()):ue(!0)}(i,t,r).pipe(Ue(a=>!0===a?o:{...V_}))):ue(o)}function H_(e,t,r){if("**"===t.path)return function AY(e){return{matched:!0,parameters:e.length>0?b2(e).parameters:{},consumedSegments:e,remainingSegments:[],positionalParamSegments:{}}}(r);if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||r.length>0)?{...V_}:{matched:!0,consumedSegments:[],remainingSegments:r,parameters:{},positionalParamSegments:{}};const s=(t.matcher||lQ)(r,e,t);if(!s)return{...V_};const o={};Object.entries(s.posParams??{}).forEach(([c,l])=>{o[c]=l.path});const a=s.consumed.length>0?{...o,...s.consumed[s.consumed.length-1].parameters}:o;return{matched:!0,consumedSegments:s.consumed,remainingSegments:r.slice(s.consumed.length),parameters:a,positionalParamSegments:s.posParams??{}}}function nO(e,t,r,i){return r.length>0&&function RY(e,t,r){return r.some(i=>Ap(e,t,i)&&ti(i)!==ge)}(e,r,i)?{segmentGroup:new Ve(t,NY(i,new Ve(r,e.children))),slicedSegments:[]}:0===r.length&&function OY(e,t,r){return r.some(i=>Ap(e,t,i))}(e,r,i)?{segmentGroup:new Ve(e.segments,MY(e,r,i,e.children)),slicedSegments:r}:{segmentGroup:new Ve(e.segments,e.children),slicedSegments:r}}function MY(e,t,r,i){const s={};for(const o of r)if(Ap(e,t,o)&&!i[ti(o)]){const a=new Ve([],{});s[ti(o)]=a}return{...i,...s}}function NY(e,t){const r={};r[ge]=t;for(const i of e)if(""===i.path&&ti(i)!==ge){const s=new Ve([],{});r[ti(i)]=s}return r}function Ap(e,t,r){return(!(e.hasChildren()||t.length>0)||"full"!==r.pathMatch)&&""===r.path}class LY{}class UY{constructor(t,r,i,s,o,a,c){this.injector=t,this.configLoader=r,this.rootComponentType=i,this.config=s,this.urlTree=o,this.paramsInheritanceStrategy=a,this.urlSerializer=c,this.applyRedirects=new TY(this.urlSerializer,this.urlTree),this.absoluteRedirectCount=0,this.allowRedirects=!0}noMatchError(t){return new M(4002,`'${t.segmentGroup}'`)}recognize(){const t=nO(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(t).pipe(Ue(r=>{const i=new O_([],Object.freeze({}),Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,{},ge,this.rootComponentType,null,{}),s=new vr(i,r),o=new z2("",s),a=function AQ(e,t,r=null,i=null){return O2(R2(e),t,r,i)}(i,[],this.urlTree.queryParams,this.urlTree.fragment);return a.queryParams=this.urlTree.queryParams,o.url=this.urlSerializer.serialize(a),this.inheritParamsAndData(o._root,null),{state:o,tree:a}}))}match(t){return this.processSegmentGroup(this.injector,this.config,t,ge).pipe(vs(i=>{if(i instanceof $_)return this.urlTree=i.urlTree,this.match(i.urlTree.root);throw i instanceof j_?this.noMatchError(i):i}))}inheritParamsAndData(t,r){const i=t.value,s=R_(i,r,this.paramsInheritanceStrategy);i.params=Object.freeze(s.params),i.data=Object.freeze(s.data),t.children.forEach(o=>this.inheritParamsAndData(o,i))}processSegmentGroup(t,r,i,s){return 0===i.segments.length&&i.hasChildren()?this.processChildren(t,r,i):this.processSegment(t,r,i,i.segments,s,!0).pipe(Ue(o=>o instanceof vr?[o]:[]))}processChildren(t,r,i){const s=[];for(const o of Object.keys(i.children))"primary"===o?s.unshift(o):s.push(o);return Ft(s).pipe(bu(o=>{const a=i.children[o],c=function nY(e,t){const r=e.filter(i=>ti(i)===t);return r.push(...e.filter(i=>ti(i)!==t)),r}(r,o);return this.processSegmentGroup(t,c,a,o)}),function iQ(e,t){return Nt(function rQ(e,t,r,i,s){return(o,a)=>{let c=r,l=t,u=0;o.subscribe(_t(a,d=>{const f=u++;l=c?e(l,d,f):(c=!0,d),i&&a.next(l)},s&&(()=>{c&&a.next(l),a.complete()})))}}(e,t,arguments.length>=2,!0))}((o,a)=>(o.push(...a),o)),mp(null),function sQ(e,t){const r=arguments.length>=2;return i=>i.pipe(e?ws((s,o)=>e(s,o,i)):Cs,b_(1),r?mp(t):w2(()=>new gp))}(),Yt(o=>{if(null===o)return uc(i);const a=rO(o);return function jY(e){e.sort((t,r)=>t.value.outlet===ge?-1:r.value.outlet===ge?1:t.value.outlet.localeCompare(r.value.outlet))}(a),ue(a)}))}processSegment(t,r,i,s,o,a){return Ft(r).pipe(bu(c=>this.processSegmentAgainstRoute(c._injector??t,r,c,i,s,o,a).pipe(vs(l=>{if(l instanceof j_)return ue(null);throw l}))),lo(c=>!!c),vs(c=>{if(eO(c))return function PY(e,t,r){return 0===t.length&&!e.children[r]}(i,s,o)?ue(new LY):uc(i);throw c}))}processSegmentAgainstRoute(t,r,i,s,o,a,c){return function kY(e,t,r,i){return!!(ti(e)===i||i!==ge&&Ap(t,r,e))&&H_(t,e,r).matched}(i,s,o,a)?void 0===i.redirectTo?this.matchSegmentAgainstRoute(t,s,i,o,a):this.allowRedirects&&c?this.expandSegmentAgainstRouteUsingRedirect(t,s,r,i,o,a):uc(s):uc(s)}expandSegmentAgainstRouteUsingRedirect(t,r,i,s,o,a){const{matched:c,consumedSegments:l,positionalParamSegments:u,remainingSegments:d}=H_(r,s,o);if(!c)return uc(r);s.redirectTo.startsWith("/")&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>31&&(this.allowRedirects=!1));const f=this.applyRedirects.applyRedirectCommands(l,s.redirectTo,u);return this.applyRedirects.lineralizeSegments(s,f).pipe(Yt(h=>this.processSegment(t,i,r,h.concat(d),a,!1)))}matchSegmentAgainstRoute(t,r,i,s,o){const a=xY(r,i,s,t);return"**"===i.path&&(r.children={}),a.pipe(Jr(c=>c.matched?this.getChildConfig(t=i._injector??t,i,s).pipe(Jr(({routes:l})=>{const u=i._loadedInjector??t,{consumedSegments:d,remainingSegments:f,parameters:h}=c,p=new O_(d,h,Object.freeze({...this.urlTree.queryParams}),this.urlTree.fragment,function VY(e){return e.data||{}}(i),ti(i),i.component??i._loadedComponent??null,i,function HY(e){return e.resolve||{}}(i)),{segmentGroup:g,slicedSegments:m}=nO(r,d,f,l);if(0===m.length&&g.hasChildren())return this.processChildren(u,l,g).pipe(Ue(v=>null===v?null:new vr(p,v)));if(0===l.length&&0===m.length)return ue(new vr(p,[]));const y=ti(i)===o;return this.processSegment(u,l,g,m,y?ge:o,!0).pipe(Ue(v=>new vr(p,v instanceof vr?[v]:[])))})):uc(r)))}getChildConfig(t,r,i){return r.children?ue({routes:r.children,injector:t}):r.loadChildren?void 0!==r._loadedRoutes?ue({routes:r._loadedRoutes,injector:r._loadedInjector}):function DY(e,t,r,i){const s=t.canLoad;return void 0===s||0===s.length?ue(!0):ue(s.map(a=>{const c=cc(a,e);return _s(function uY(e){return e&&Ou(e.canLoad)}(c)?c.canLoad(t,r):oi(e,()=>c(t,r)))})).pipe(lc(),tO())}(t,r,i).pipe(Yt(s=>s?this.configLoader.loadChildren(t,r).pipe(dn(o=>{r._loadedRoutes=o.routes,r._loadedInjector=o.injector})):function IY(e){return Ja(Q2(!1,Fn.GuardRejected))}())):ue({routes:[],injector:t})}}function $Y(e){const t=e.value.routeConfig;return t&&""===t.path}function rO(e){const t=[],r=new Set;for(const i of e){if(!$Y(i)){t.push(i);continue}const s=t.find(o=>i.value.routeConfig===o.value.routeConfig);void 0!==s?(s.children.push(...i.children),r.add(s)):t.push(i)}for(const i of r){const s=rO(i.children);t.push(new vr(i.value,s))}return t.filter(i=>!r.has(i))}function iO(e){const t=e.children.map(r=>iO(r)).flat();return[e,...t]}function z_(e){return Jr(t=>{const r=e(t);return r?Ft(r).pipe(Ue(()=>t)):ue(t)})}let sO=(()=>{class e{buildTitle(r){let i,s=r.root;for(;void 0!==s;)i=this.getResolvedTitleForRoute(s)??i,s=s.children.find(o=>o.outlet===ge);return i}getResolvedTitleForRoute(r){return r.data[Eu]}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>P(KY),providedIn:"root"})}return e})(),KY=(()=>{class e extends sO{constructor(r){super(),this.title=r}updateTitle(r){const i=this.buildTitle(r);void 0!==i&&this.title.setTitle(i)}static#e=this.\u0275fac=function(i){return new(i||e)(G(MH))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const dc=new K("",{providedIn:"root",factory:()=>({})}),fc=new K("");let q_=(()=>{class e{constructor(){this.componentLoaders=new WeakMap,this.childrenLoaders=new WeakMap,this.compiler=P(H1)}loadComponent(r){if(this.componentLoaders.get(r))return this.componentLoaders.get(r);if(r._loadedComponent)return ue(r._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(r);const i=_s(r.loadComponent()).pipe(Ue(oO),dn(o=>{this.onLoadEndListener&&this.onLoadEndListener(r),r._loadedComponent=o}),vu(()=>{this.componentLoaders.delete(r)})),s=new v2(i,()=>new ot).pipe(__());return this.componentLoaders.set(r,s),s}loadChildren(r,i){if(this.childrenLoaders.get(i))return this.childrenLoaders.get(i);if(i._loadedRoutes)return ue({routes:i._loadedRoutes,injector:i._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(i);const o=function QY(e,t,r,i){return _s(e.loadChildren()).pipe(Ue(oO),Yt(s=>s instanceof tI||Array.isArray(s)?ue(s):Ft(t.compileModuleAsync(s))),Ue(s=>{i&&i(e);let o,a,c=!1;return Array.isArray(s)?(a=s,!0):(o=s.create(r).injector,a=o.get(fc,[],{optional:!0,self:!0}).flat()),{routes:a.map(U_),injector:o}}))}(i,this.compiler,r,this.onLoadEndListener).pipe(vu(()=>{this.childrenLoaders.delete(i)})),a=new v2(o,()=>new ot).pipe(__());return this.childrenLoaders.set(i,a),a}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function oO(e){return function YY(e){return e&&"object"==typeof e&&"default"in e}(e)?e.default:e}let G_=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>P(JY),providedIn:"root"})}return e})(),JY=(()=>{class e{shouldProcessUrl(r){return!0}extract(r){return r}merge(r,i){return r}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const aO=new K(""),cO=new K("");function XY(e,t,r){const i=e.get(cO),s=e.get(Wt);return e.get(Ne).runOutsideAngular(()=>{if(!s.startViewTransition||i.skipNextTransition)return i.skipNextTransition=!1,new Promise(u=>setTimeout(u));let o;const a=new Promise(u=>{o=u}),c=s.startViewTransition(()=>(o(),function eJ(e){return new Promise(t=>{uy(t,{injector:e})})}(e))),{onViewTransitionCreated:l}=i;return l&&oi(e,()=>l({transition:c,from:t,to:r})),a})}let Mp=(()=>{class e{get hasRequestedNavigation(){return 0!==this.navigationId}constructor(){this.currentNavigation=null,this.currentTransition=null,this.lastSuccessfulNavigation=null,this.events=new ot,this.transitionAbortSubject=new ot,this.configLoader=P(q_),this.environmentInjector=P(gn),this.urlSerializer=P(nc),this.rootContexts=P(xu),this.location=P(Ml),this.inputBindingEnabled=null!==P(Ip,{optional:!0}),this.titleStrategy=P(sO),this.options=P(dc,{optional:!0})||{},this.paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly",this.urlHandlingStrategy=P(G_),this.createViewTransition=P(aO,{optional:!0}),this.navigationId=0,this.afterPreactivation=()=>ue(void 0),this.rootComponentType=null,this.configLoader.onLoadEndListener=s=>this.events.next(new $Q(s)),this.configLoader.onLoadStartListener=s=>this.events.next(new jQ(s))}complete(){this.transitions?.complete()}handleNavigationRequest(r){const i=++this.navigationId;this.transitions?.next({...this.transitions.value,...r,id:i})}setupNavigations(r,i,s){return this.transitions=new jn({id:0,currentUrlTree:i,currentRawUrl:i,extractedUrl:this.urlHandlingStrategy.extract(i),urlAfterRedirects:this.urlHandlingStrategy.extract(i),rawUrl:i,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:Tu,restoredState:null,currentSnapshot:s.snapshot,targetSnapshot:null,currentRouterState:s,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.transitions.pipe(ws(o=>0!==o.id),Ue(o=>({...o,extractedUrl:this.urlHandlingStrategy.extract(o.rawUrl)})),Jr(o=>{let a=!1,c=!1;return ue(o).pipe(Jr(l=>{if(this.navigationId>o.id)return this.cancelNavigationTransition(o,"",Fn.SupersededByNewNavigation),Yr;this.currentTransition=o,this.currentNavigation={id:l.id,initialUrl:l.rawUrl,extractedUrl:l.extractedUrl,trigger:l.source,extras:l.extras,previousNavigation:this.lastSuccessfulNavigation?{...this.lastSuccessfulNavigation,previousNavigation:null}:null};const u=!r.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl();if(!u&&"reload"!==(l.extras.onSameUrlNavigation??r.onSameUrlNavigation)){const f="";return this.events.next(new sc(l.id,this.urlSerializer.serialize(l.rawUrl),f,Cp.IgnoredSameUrlNavigation)),l.resolve(null),Yr}if(this.urlHandlingStrategy.shouldProcessUrl(l.rawUrl))return ue(l).pipe(Jr(f=>{const h=this.transitions?.getValue();return this.events.next(new Dp(f.id,this.urlSerializer.serialize(f.extractedUrl),f.source,f.restoredState)),h!==this.transitions?.getValue()?Yr:Promise.resolve(f)}),function zY(e,t,r,i,s,o){return Yt(a=>function FY(e,t,r,i,s,o,a="emptyOnly"){return new UY(e,t,r,i,s,a,o).recognize()}(e,t,r,i,a.extractedUrl,s,o).pipe(Ue(({state:c,tree:l})=>({...a,targetSnapshot:c,urlAfterRedirects:l}))))}(this.environmentInjector,this.configLoader,this.rootComponentType,r.config,this.urlSerializer,this.paramsInheritanceStrategy),dn(f=>{o.targetSnapshot=f.targetSnapshot,o.urlAfterRedirects=f.urlAfterRedirects,this.currentNavigation={...this.currentNavigation,finalUrl:f.urlAfterRedirects};const h=new U2(f.id,this.urlSerializer.serialize(f.extractedUrl),this.urlSerializer.serialize(f.urlAfterRedirects),f.targetSnapshot);this.events.next(h)}));if(u&&this.urlHandlingStrategy.shouldProcessUrl(l.currentRawUrl)){const{id:f,extractedUrl:h,source:p,restoredState:g,extras:m}=l,y=new Dp(f,this.urlSerializer.serialize(h),p,g);this.events.next(y);const v=H2(this.rootComponentType).snapshot;return this.currentTransition=o={...l,targetSnapshot:v,urlAfterRedirects:h,extras:{...m,skipLocationChange:!1,replaceUrl:!1}},this.currentNavigation.finalUrl=h,ue(o)}{const f="";return this.events.next(new sc(l.id,this.urlSerializer.serialize(l.extractedUrl),f,Cp.IgnoredByUrlHandlingStrategy)),l.resolve(null),Yr}}),dn(l=>{const u=new LQ(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot);this.events.next(u)}),Ue(l=>(this.currentTransition=o={...l,guards:sY(l.targetSnapshot,l.currentSnapshot,this.rootContexts)},o)),function gY(e,t){return Yt(r=>{const{targetSnapshot:i,currentSnapshot:s,guards:{canActivateChecks:o,canDeactivateChecks:a}}=r;return 0===a.length&&0===o.length?ue({...r,guardsResult:!0}):function mY(e,t,r,i){return Ft(e).pipe(Yt(s=>function EY(e,t,r,i,s){const o=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return o&&0!==o.length?ue(o.map(c=>{const l=Mu(t)??s,u=cc(c,l);return _s(function hY(e){return e&&Ou(e.canDeactivate)}(u)?u.canDeactivate(e,t,r,i):oi(l,()=>u(e,t,r,i))).pipe(lo())})).pipe(lc()):ue(!0)}(s.component,s.route,r,t,i)),lo(s=>!0!==s,!0))}(a,i,s,e).pipe(Yt(c=>c&&function lY(e){return"boolean"==typeof e}(c)?function yY(e,t,r,i){return Ft(t).pipe(bu(s=>w_(function wY(e,t){return null!==e&&t&&t(new VQ(e)),ue(!0)}(s.route.parent,i),function vY(e,t){return null!==e&&t&&t(new zQ(e)),ue(!0)}(s.route,i),function bY(e,t,r){const i=t[t.length-1],o=t.slice(0,t.length-1).reverse().map(a=>function oY(e){const t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null}(a)).filter(a=>null!==a).map(a=>y2(()=>ue(a.guards.map(l=>{const u=Mu(a.node)??r,d=cc(l,u);return _s(function fY(e){return e&&Ou(e.canActivateChild)}(d)?d.canActivateChild(i,e):oi(u,()=>d(i,e))).pipe(lo())})).pipe(lc())));return ue(o).pipe(lc())}(e,s.path,r),function _Y(e,t,r){const i=t.routeConfig?t.routeConfig.canActivate:null;if(!i||0===i.length)return ue(!0);const s=i.map(o=>y2(()=>{const a=Mu(t)??r,c=cc(o,a);return _s(function dY(e){return e&&Ou(e.canActivate)}(c)?c.canActivate(t,e):oi(a,()=>c(t,e))).pipe(lo())}));return ue(s).pipe(lc())}(e,s.route,r))),lo(s=>!0!==s,!0))}(i,o,e,t):ue(c)),Ue(c=>({...r,guardsResult:c})))})}(this.environmentInjector,l=>this.events.next(l)),dn(l=>{if(o.guardsResult=l.guardsResult,rc(l.guardsResult))throw K2(0,l.guardsResult);const u=new FQ(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects),l.targetSnapshot,!!l.guardsResult);this.events.next(u)}),ws(l=>!!l.guardsResult||(this.cancelNavigationTransition(l,"",Fn.GuardRejected),!1)),z_(l=>{if(l.guards.canActivateChecks.length)return ue(l).pipe(dn(u=>{const d=new BQ(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(d)}),Jr(u=>{let d=!1;return ue(u).pipe(function qY(e,t){return Yt(r=>{const{targetSnapshot:i,guards:{canActivateChecks:s}}=r;if(!s.length)return ue(r);const o=new Set(s.map(l=>l.route)),a=new Set;for(const l of o)if(!a.has(l))for(const u of iO(l))a.add(u);let c=0;return Ft(a).pipe(bu(l=>o.has(l)?function GY(e,t,r,i){const s=e.routeConfig,o=e._resolve;return void 0!==s?.title&&!G2(s)&&(o[Eu]=s.title),function WY(e,t,r,i){const s=E_(e);if(0===s.length)return ue({});const o={};return Ft(s).pipe(Yt(a=>function ZY(e,t,r,i){const s=Mu(t)??i,o=cc(e,s);return _s(o.resolve?o.resolve(t,r):oi(s,()=>o(t,r)))}(e[a],t,r,i).pipe(lo(),dn(c=>{o[a]=c}))),b_(1),function oQ(e){return Ue(()=>e)}(o),vs(a=>eO(a)?Yr:Ja(a)))}(o,e,t,i).pipe(Ue(a=>(e._resolvedData=a,e.data=R_(e,e.parent,r).resolve,null)))}(l,i,e,t):(l.data=R_(l,l.parent,e).resolve,ue(void 0))),dn(()=>c++),b_(1),Yt(l=>c===a.size?ue(r):Yr))})}(this.paramsInheritanceStrategy,this.environmentInjector),dn({next:()=>d=!0,complete:()=>{d||this.cancelNavigationTransition(u,"",Fn.NoDataFromResolver)}}))}),dn(u=>{const d=new UQ(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(d)}))}),z_(l=>{const u=d=>{const f=[];d.routeConfig?.loadComponent&&!d.routeConfig._loadedComponent&&f.push(this.configLoader.loadComponent(d.routeConfig).pipe(dn(h=>{d.component=h}),Ue(()=>{})));for(const h of d.children)f.push(...u(h));return f};return v_(u(l.targetSnapshot.root)).pipe(mp(null),Xa(1))}),z_(()=>this.afterPreactivation()),Jr(()=>{const{currentSnapshot:l,targetSnapshot:u}=o,d=this.createViewTransition?.(this.environmentInjector,l.root,u.root);return d?Ft(d).pipe(Ue(()=>o)):ue(o)}),Ue(l=>{const u=function ZQ(e,t,r){const i=Au(e,t._root,r?r._root:void 0);return new V2(i,t)}(r.routeReuseStrategy,l.targetSnapshot,l.currentRouterState);return this.currentTransition=o={...l,targetRouterState:u},this.currentNavigation.targetRouterState=u,o}),dn(()=>{this.events.next(new x_)}),((e,t,r,i)=>Ue(s=>(new iY(t,s.targetRouterState,s.currentRouterState,r,i).activate(e),s)))(this.rootContexts,r.routeReuseStrategy,l=>this.events.next(l),this.inputBindingEnabled),Xa(1),dn({next:l=>{a=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new Ri(l.id,this.urlSerializer.serialize(l.extractedUrl),this.urlSerializer.serialize(l.urlAfterRedirects))),this.titleStrategy?.updateTitle(l.targetRouterState.snapshot),l.resolve(!0)},complete:()=>{a=!0}}),function aQ(e){return Nt((t,r)=>{Kr(e).subscribe(_t(r,()=>r.complete(),Qp)),!r.closed&&t.subscribe(r)})}(this.transitionAbortSubject.pipe(dn(l=>{throw l}))),vu(()=>{!a&&!c&&this.cancelNavigationTransition(o,"",Fn.SupersededByNewNavigation),this.currentTransition?.id===o.id&&(this.currentNavigation=null,this.currentTransition=null)}),vs(l=>{if(c=!0,Y2(l))this.events.next(new ic(o.id,this.urlSerializer.serialize(o.extractedUrl),l.message,l.cancellationCode)),function YQ(e){return Y2(e)&&rc(e.url)}(l)?this.events.next(new A_(l.url)):o.resolve(!1);else{this.events.next(new Sp(o.id,this.urlSerializer.serialize(o.extractedUrl),l,o.targetSnapshot??void 0));try{o.resolve(r.errorHandler(l))}catch(u){this.options.resolveNavigationPromiseOnError?o.resolve(!1):o.reject(u)}}return Yr}))}))}cancelNavigationTransition(r,i,s){const o=new ic(r.id,this.urlSerializer.serialize(r.extractedUrl),i,s);this.events.next(o),r.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){return this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))).toString()!==this.currentTransition?.extractedUrl.toString()&&!this.currentTransition?.extras.skipLocationChange}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function tJ(e){return e!==Tu}let nJ=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>P(iJ),providedIn:"root"})}return e})();class rJ{shouldDetach(t){return!1}store(t,r){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,r){return t.routeConfig===r.routeConfig}}let iJ=(()=>{class e extends rJ{static#e=this.\u0275fac=(()=>{let r;return function(s){return(r||(r=nm(e)))(s||e)}})();static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),lO=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:()=>P(sJ),providedIn:"root"})}return e})(),sJ=(()=>{class e extends lO{constructor(){super(...arguments),this.location=P(Ml),this.urlSerializer=P(nc),this.options=P(dc,{optional:!0})||{},this.canceledNavigationResolution=this.options.canceledNavigationResolution||"replace",this.urlHandlingStrategy=P(G_),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.currentUrlTree=new tc,this.rawUrlTree=this.currentUrlTree,this.currentPageId=0,this.lastSuccessfulId=-1,this.routerState=H2(null),this.stateMemento=this.createStateMemento()}getCurrentUrlTree(){return this.currentUrlTree}getRawUrlTree(){return this.rawUrlTree}restoredState(){return this.location.getState()}get browserPageId(){return"computed"!==this.canceledNavigationResolution?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}getRouterState(){return this.routerState}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}registerNonRouterCurrentEntryChangeListener(r){return this.location.subscribe(i=>{"popstate"===i.type&&r(i.url,i.state)})}handleRouterEvent(r,i){if(r instanceof Dp)this.stateMemento=this.createStateMemento();else if(r instanceof sc)this.rawUrlTree=i.initialUrl;else if(r instanceof U2){if("eager"===this.urlUpdateStrategy&&!i.extras.skipLocationChange){const s=this.urlHandlingStrategy.merge(i.finalUrl,i.initialUrl);this.setBrowserUrl(s,i)}}else r instanceof x_?(this.currentUrlTree=i.finalUrl,this.rawUrlTree=this.urlHandlingStrategy.merge(i.finalUrl,i.initialUrl),this.routerState=i.targetRouterState,"deferred"===this.urlUpdateStrategy&&(i.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,i))):r instanceof ic&&(r.code===Fn.GuardRejected||r.code===Fn.NoDataFromResolver)?this.restoreHistory(i):r instanceof Sp?this.restoreHistory(i,!0):r instanceof Ri&&(this.lastSuccessfulId=r.id,this.currentPageId=this.browserPageId)}setBrowserUrl(r,i){const s=this.urlSerializer.serialize(r);if(this.location.isCurrentPathEqualTo(s)||i.extras.replaceUrl){const a={...i.extras.state,...this.generateNgRouterState(i.id,this.browserPageId)};this.location.replaceState(s,"",a)}else{const o={...i.extras.state,...this.generateNgRouterState(i.id,this.browserPageId+1)};this.location.go(s,"",o)}}restoreHistory(r,i=!1){if("computed"===this.canceledNavigationResolution){const o=this.currentPageId-this.browserPageId;0!==o?this.location.historyGo(o):this.currentUrlTree===r.finalUrl&&0===o&&(this.resetState(r),this.resetUrlToCurrentUrlTree())}else"replace"===this.canceledNavigationResolution&&(i&&this.resetState(r),this.resetUrlToCurrentUrlTree())}resetState(r){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,r.finalUrl??this.rawUrlTree)}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(r,i){return"computed"===this.canceledNavigationResolution?{navigationId:r,\u0275routerPageId:i}:{navigationId:r}}static#e=this.\u0275fac=(()=>{let r;return function(s){return(r||(r=nm(e)))(s||e)}})();static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var ku=function(e){return e[e.COMPLETE=0]="COMPLETE",e[e.FAILED=1]="FAILED",e[e.REDIRECTING=2]="REDIRECTING",e}(ku||{});function uO(e,t){e.events.pipe(ws(r=>r instanceof Ri||r instanceof ic||r instanceof Sp||r instanceof sc),Ue(r=>r instanceof Ri||r instanceof sc?ku.COMPLETE:r instanceof ic&&(r.code===Fn.Redirect||r.code===Fn.SupersededByNewNavigation)?ku.REDIRECTING:ku.FAILED),ws(r=>r!==ku.REDIRECTING),Xa(1)).subscribe(()=>{t()})}function oJ(e){throw e}const aJ={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},cJ={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"};let wr=(()=>{class e{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}constructor(){this.disposed=!1,this.isNgZoneEnabled=!1,this.console=P(O1),this.stateManager=P(lO),this.options=P(dc,{optional:!0})||{},this.pendingTasks=P(Ko),this.urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred",this.navigationTransitions=P(Mp),this.urlSerializer=P(nc),this.location=P(Ml),this.urlHandlingStrategy=P(G_),this._events=new ot,this.errorHandler=this.options.errorHandler||oJ,this.navigated=!1,this.routeReuseStrategy=P(nJ),this.onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore",this.config=P(fc,{optional:!0})?.flat()??[],this.componentInputBindingEnabled=!!P(Ip,{optional:!0}),this.eventsSubscription=new Rt,this.isNgZoneEnabled=P(Ne)instanceof Ne&&Ne.isInAngularZone(),this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this,this.currentUrlTree,this.routerState).subscribe({error:r=>{this.console.warn(r)}}),this.subscribeToNavigationEvents()}subscribeToNavigationEvents(){const r=this.navigationTransitions.events.subscribe(i=>{try{const s=this.navigationTransitions.currentTransition,o=this.navigationTransitions.currentNavigation;if(null!==s&&null!==o)if(this.stateManager.handleRouterEvent(i,o),i instanceof ic&&i.code!==Fn.Redirect&&i.code!==Fn.SupersededByNewNavigation)this.navigated=!0;else if(i instanceof Ri)this.navigated=!0;else if(i instanceof A_){const a=this.urlHandlingStrategy.merge(i.url,s.currentRawUrl),c={info:s.extras.info,skipLocationChange:s.extras.skipLocationChange,replaceUrl:"eager"===this.urlUpdateStrategy||tJ(s.source)};this.scheduleNavigation(a,Tu,null,c,{resolve:s.resolve,reject:s.reject,promise:s.promise})}(function uJ(e){return!(e instanceof x_||e instanceof A_)})(i)&&this._events.next(i)}catch(s){this.navigationTransitions.transitionAbortSubject.next(s)}});this.eventsSubscription.add(r)}resetRootComponentType(r){this.routerState.root.component=r,this.navigationTransitions.rootComponentType=r}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),Tu,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((r,i)=>{setTimeout(()=>{this.navigateToSyncWithBrowser(r,"popstate",i)},0)})}navigateToSyncWithBrowser(r,i,s){const o={replaceUrl:!0},a=s?.navigationId?s:null;if(s){const l={...s};delete l.navigationId,delete l.\u0275routerPageId,0!==Object.keys(l).length&&(o.state=l)}const c=this.parseUrl(r);this.scheduleNavigation(c,i,a,o)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(r){this.config=r.map(U_),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(r,i={}){const{relativeTo:s,queryParams:o,fragment:a,queryParamsHandling:c,preserveFragment:l}=i,u=l?this.currentUrlTree.fragment:a;let f,d=null;switch(c){case"merge":d={...this.currentUrlTree.queryParams,...o};break;case"preserve":d=this.currentUrlTree.queryParams;break;default:d=o||null}null!==d&&(d=this.removeEmptyProps(d));try{f=R2(s?s.snapshot:this.routerState.snapshot.root)}catch{("string"!=typeof r[0]||!r[0].startsWith("/"))&&(r=[]),f=this.currentUrlTree.root}return O2(f,r,d,u??null)}navigateByUrl(r,i={skipLocationChange:!1}){const s=rc(r)?r:this.parseUrl(r),o=this.urlHandlingStrategy.merge(s,this.rawUrlTree);return this.scheduleNavigation(o,Tu,null,i)}navigate(r,i={skipLocationChange:!1}){return function lJ(e){for(let t=0;t(null!=o&&(i[s]=o),i),{})}scheduleNavigation(r,i,s,o,a){if(this.disposed)return Promise.resolve(!1);let c,l,u;a?(c=a.resolve,l=a.reject,u=a.promise):u=new Promise((f,h)=>{c=f,l=h});const d=this.pendingTasks.add();return uO(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(d))}),this.navigationTransitions.handleNavigationRequest({source:i,restoredState:s,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:r,extras:o,resolve:c,reject:l,promise:u,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),u.catch(f=>Promise.reject(f))}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();class dO{}let hJ=(()=>{class e{constructor(r,i,s,o,a){this.router=r,this.injector=s,this.preloadingStrategy=o,this.loader=a}setUpPreloading(){this.subscription=this.router.events.pipe(ws(r=>r instanceof Ri),bu(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(r,i){const s=[];for(const o of i){o.providers&&!o._injector&&(o._injector=hf(o.providers,r,`Route: ${o.path}`));const a=o._injector??r,c=o._loadedInjector??a;(o.loadChildren&&!o._loadedRoutes&&void 0===o.canLoad||o.loadComponent&&!o._loadedComponent)&&s.push(this.preloadConfig(a,o)),(o.children||o._loadedRoutes)&&s.push(this.processRoutes(c,o.children??o._loadedRoutes))}return Ft(s).pipe(_u())}preloadConfig(r,i){return this.preloadingStrategy.preload(i,()=>{let s;s=i.loadChildren&&void 0===i.canLoad?this.loader.loadChildren(r,i):ue(null);const o=s.pipe(Yt(a=>null===a?ue(void 0):(i._loadedRoutes=a.routes,i._loadedInjector=a.injector,this.processRoutes(a.injector??r,a.routes))));return i.loadComponent&&!i._loadedComponent?Ft([o,this.loader.loadComponent(i)]).pipe(_u()):o})}static#e=this.\u0275fac=function(i){return new(i||e)(G(wr),G(H1),G(gn),G(dO),G(q_))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const Z_=new K("");let fO=(()=>{class e{constructor(r,i,s,o,a={}){this.urlSerializer=r,this.transitions=i,this.viewportScroller=s,this.zone=o,this.options=a,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},this.environmentInjector=P(gn),a.scrollPositionRestoration||="disabled",a.anchorScrolling||="disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(r=>{r instanceof Dp?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=r.navigationTrigger,this.restoredId=r.restoredState?r.restoredState.navigationId:0):r instanceof Ri?(this.lastId=r.id,this.scheduleScrollEvent(r,this.urlSerializer.parse(r.urlAfterRedirects).fragment)):r instanceof sc&&r.code===Cp.IgnoredSameUrlNavigation&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(r,this.urlSerializer.parse(r.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(r=>{r instanceof j2&&(r.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(r.position):r.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(r.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(r,i){var s=this;this.zone.runOutsideAngular($(function*(){yield new Promise(o=>{setTimeout(()=>{o()}),uy(()=>{o()},{injector:s.environmentInjector})}),s.zone.run(()=>{s.transitions.events.next(new j2(r,"popstate"===s.lastSource?s.store[s.restoredId]:null,i))})}))}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static#e=this.\u0275fac=function(i){!function LC(){throw new Error("invalid")}()};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();function ni(e,t){return{\u0275kind:e,\u0275providers:t}}function pO(){const e=P(qt);return t=>{const r=e.get(Br);if(t!==r.components[0])return;const i=e.get(wr),s=e.get(gO);1===e.get(K_)&&i.initialNavigation(),e.get(mO,null,Ee.Optional)?.setUpPreloading(),e.get(Z_,null,Ee.Optional)?.init(),i.resetRootComponentType(r.componentTypes[0]),s.closed||(s.next(),s.complete(),s.unsubscribe())}}const gO=new K("",{factory:()=>new ot}),K_=new K("",{providedIn:"root",factory:()=>1}),mO=new K("");function yJ(e){return ni(0,[{provide:mO,useExisting:hJ},{provide:dO,useExisting:e}])}function wJ(e){return ni(9,[{provide:aO,useValue:XY},{provide:cO,useValue:{skipNextTransition:!!e?.skipInitialTransition,...e}}])}const yO=new K("ROUTER_FORROOT_GUARD"),_J=[Ml,{provide:nc,useClass:D_},wr,xu,{provide:ac,useFactory:function hO(e){return e.routerState.root},deps:[wr]},q_,[]];let vO=(()=>{class e{constructor(r){}static forRoot(r,i){return{ngModule:e,providers:[_J,[],{provide:fc,multi:!0,useValue:r},{provide:yO,useFactory:CJ,deps:[[wr,new rd,new id]]},{provide:dc,useValue:i||{}},i?.useHash?{provide:qs,useClass:lV}:{provide:qs,useClass:Ox},{provide:Z_,useFactory:()=>{const e=P(M5),t=P(Ne),r=P(dc),i=P(Mp),s=P(nc);return r.scrollOffset&&e.setOffset(r.scrollOffset),new fO(s,i,e,t,r)}},i?.preloadingStrategy?yJ(i.preloadingStrategy).\u0275providers:[],i?.initialNavigation?SJ(i):[],i?.bindToComponentInputs?ni(8,[W2,{provide:Ip,useExisting:W2}]).\u0275providers:[],i?.enableViewTransitions?wJ().\u0275providers:[],[{provide:wO,useFactory:pO},{provide:fv,multi:!0,useExisting:wO}]]}}static forChild(r){return{ngModule:e,providers:[{provide:fc,multi:!0,useValue:r}]}}static#e=this.\u0275fac=function(i){return new(i||e)(G(yO,8))};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({})}return e})();function CJ(e){return"guarded"}function SJ(e){return["disabled"===e.initialNavigation?ni(3,[{provide:uv,multi:!0,useFactory:()=>{const t=P(wr);return()=>{t.setUpLocationChangeListener()}}},{provide:K_,useValue:2}]).\u0275providers:[],"enabledBlocking"===e.initialNavigation?ni(2,[{provide:K_,useValue:0},{provide:uv,multi:!0,deps:[qt],useFactory:t=>{const r=t.get(aV,Promise.resolve());return()=>r.then(()=>new Promise(i=>{const s=t.get(wr),o=t.get(gO);uO(s,()=>{i(!0)}),t.get(Mp).afterPreactivation=()=>(i(!0),o.closed?ue(void 0):o),s.initialNavigation()}))}}]).\u0275providers:[]]}const wO=new K("");var Oi=function(e){return e.STRANGE="STRANGE",e.YOU="YOU",e}(Oi||{}),ki=function(e){return e.CONNECTED="CONNECTED",e.UP_TO_DISCONNECT="UP_TO_DISCONNECT",e.DISCONNECTED="DISCONNECTED",e.SEARCHING_STRANGER="SEARCHING_STRANGER",e}(ki||{});let TJ=(()=>{class e{constructor(){this.authorTypes={[Oi.STRANGE]:"Stranger",[Oi.YOU]:"You"}}transform(r){return this.authorTypes[r]}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275pipe=en({name:"author",type:e,pure:!0})}return e})();const xJ=["conversation"];function AJ(e,t){1&e&&(Le(0,"div",18),at(1," You're now chatting with a random stranger. "),Qe())}function MJ(e,t){1&e&&(Le(0,"div",18),at(1," Looking for someone you can chat with. "),Qe())}function NJ(e,t){if(1&e&&(Le(0,"div",19)(1,"span"),at(2),function m1(e,t){const r=De();let i;const s=e+fe;r.firstCreatePass?(i=function Wj(e,t){if(t)for(let r=t.length-1;r>=0;r--){const i=t[r];if(e===i.name)return i}}(t,r.pipeRegistry),r.data[s]=i,i.onDestroy&&(r.destroyHooks??=[]).push(s,i.onDestroy)):i=r.data[s];const o=i.factory||(i.factory=Ss(i.type)),c=fn(X);try{const l=Dd(!1),u=o();return Dd(l),function mj(e,t,r,i){r>=e.data.length&&(e.data[r]=null,e.blueprint[r]=null),t[r]=i}(r,N(),s,u),u}finally{fn(c)}}(3,"author"),Qe(),Le(4,"span",20),at(5),Qe()()),2&e){const r=t.$implicit,i=It();Ie(),Uy("authorStranger",r.author===i.authorStrange)("authorYou",r.author===i.authorYou),Ie(),Fr("",y1(3,6,r.author),": "),Ie(3),Af(r.text)}}function RJ(e,t){1&e&&(Le(0,"div",18),at(1," Stranger is typing... "),Qe())}function OJ(e,t){1&e&&(Le(0,"div",18),at(1,"Stranger has disconnected."),Qe())}function kJ(e,t){1&e&&(Le(0,"div",18),at(1,"You have disconnected."),Qe())}function PJ(e,t){if(1&e&&(ha(0),Hn(1,OJ,2,0,"div",9)(2,kJ,2,0,"div",9),pa()),2&e){const r=It();Ie(),Ke("ngIf",r.whoDisconnected===r.authorStrange),Ie(),Ke("ngIf",r.whoDisconnected===r.authorYou)}}function LJ(e,t){if(1&e){const r=Vs();Le(0,"button",21),kn("click",function(){return ci(r),li(It().findStranger())}),at(1," Start "),Qe()}if(2&e){const r=It();kr("disabled",r.currentState===r.stateSearchingStranger?"disabled":null)}}function FJ(e,t){if(1&e){const r=Vs();Le(0,"button",22),kn("click",function(){ci(r);const s=It();return li(s.currentState=s.stateUpToDisconnect)}),at(1," Stop "),Qe()}}function BJ(e,t){if(1&e){const r=Vs();Le(0,"button",23),kn("click",function(){ci(r);const s=It(),o=xf(19);return s.disconnect(),li(s.cleanMessageField(o))}),at(1," Really? "),Qe()}}const UJ=[{path:"chat",component:(()=>{class e{constructor(r,i){this.findStrangerProxy=r,this.talkToStrangerNostr=i,this.stateConnected=ki.CONNECTED,this.stateUpToDisconnect=ki.UP_TO_DISCONNECT,this.stateDisconnected=ki.DISCONNECTED,this.stateSearchingStranger=ki.SEARCHING_STRANGER,this.authorStrange=Oi.STRANGE,this.authorYou=Oi.YOU,this.typingTimeoutAmount=2e3,this.typingTimeoutId=0,this.currentOnline=1,this.strangeIsTyping=!1,this.currentState=ki.DISCONNECTED,this.whoDisconnected=null,this.you=null,this.stranger=null,this.messages=[],this.subscriptions=new Rt}ngOnInit(){this.subscriptions.add(this.talkToStrangerNostr.listenCurrenOnlineUsers().subscribe(r=>this.currentOnline=r||1))}ngOnDestroy(){this.subscriptions.unsubscribe()}onBeforeUnload(){var r=this;return $(function*(){return yield r.disconnect(),!0})()}findStranger(){this.whoDisconnected=null,this.currentState=this.stateSearchingStranger,this.messages=[];const r=this.you=this.findStrangerProxy.connect();console.info((new Date).toLocaleString(),"me: ",r.pubkey),this.findStrangerProxy.searchStranger(this.you).then(i=>this.startConversation(r,i)).catch(i=>console.error((new Date).toLocaleString(),i))}disconnect(){return this.you?(this.stranger=null,this.findStrangerProxy.disconnect(this.you).then(()=>(this.currentState=ki.DISCONNECTED,this.strangeIsTyping=!1,this.whoDisconnected||(this.whoDisconnected=Oi.YOU),Promise.resolve()))):Promise.resolve()}startConversation(r,i){console.log((new Date).toLocaleString(),"starting conversation, stranger: ",i),this.stranger=i,this.currentState=ki.CONNECTED,1===this.currentOnline&&(this.currentOnline=2),this.subscriptions.add(this.talkToStrangerNostr.listenMessages(r,i).subscribe({next:s=>this.addMessageFromStranger(r,i,s)})),this.subscriptions.add(this.talkToStrangerNostr.listenStrangerStatus(i).subscribe({next:s=>this.handleStrangerStatus(s)}))}addMessageFromStranger(r,i,s){this.talkToStrangerNostr.openEncryptedDirectMessage(r,i,s).then(o=>{this.messages.push({text:o,author:Oi.STRANGE,time:s.created_at}),this.scrollConversationToTheEnd()})}handleStrangerStatus(r){"typing"===r.content?(this.strangeIsTyping=!0,this.scrollConversationToTheEnd()):"disconnected"===r.content?(this.strangeIsTyping=!1,this.whoDisconnected=Oi.STRANGE,this.currentState=ki.DISCONNECTED,this.disconnect()):this.strangeIsTyping=!1}sendMessage(r){const i=this.you,s=this.stranger;i&&s&&r.length&&(this.talkToStrangerNostr.sendMessage(i,s,r),this.messages.push({author:Oi.YOU,text:r,time:Math.floor((new Date).getTime()/1e3)}),this.scrollConversationToTheEnd())}scrollConversationToTheEnd(){setTimeout(()=>{const r=this.conversationEl.nativeElement;r.scrollTo({top:r.scrollHeight,behavior:"smooth"})})}cleanMessageField(r){setTimeout(()=>r.value="")}onTyping(){const r=this.you;r&&(this.typingTimeoutId||this.talkToStrangerNostr.isTyping(r),clearTimeout(this.typingTimeoutId),this.typingTimeoutId=Number(setTimeout(()=>{this.talkToStrangerNostr.stopTyping(r),this.typingTimeoutId=0},this.typingTimeoutAmount)))}static#e=this.\u0275fac=function(i){return new(i||e)(X(d2),X(f2))};static#t=this.\u0275cmp=So({type:e,selectors:[["omg-chat"]],viewQuery:function(i,s){if(1&i&&function VT(e,t,r){RS(e,t,r)}(xJ,5),2&i){let o;(function Qy(e){const t=N(),r=De(),i=Wg();wd(i+1);const s=by(r,i);if(e.dirty&&function GP(e){return!(4&~e[ee])}(t)===!(2&~s.metadata.flags)){if(null===s.matches)e.reset([]);else{const o=PS(t,i);e.reset(o,bD),e.notifyOnChanges()}return!0}return!1})(o=Yy())&&(s.conversationEl=o.first)}},hostBindings:function(i,s){1&i&&kn("beforeunload",function(){return s.onBeforeUnload()},0,gC)},decls:23,vars:11,consts:[["conversation",""],["messageField",""],["send",""],[1,"navbar"],["src","/omeglestr/assets/logo.png","alt","logo",1,"logo"],[1,"description"],[1,"online"],[1,"main"],[1,"conversation"],["class","message",4,"ngIf"],["class","chat",4,"ngFor","ngForOf"],[4,"ngIf"],["novalidate","","autocomplete","off",1,"form"],["type","button","class","btn start bottomLeftRadius",3,"click",4,"ngIf"],["type","button","class","btn bottomLeftRadius",3,"click",4,"ngIf"],["type","button","class","btn bottomLeftRadius bold",3,"click",4,"ngIf"],["name","text",1,"textarea",3,"keydown.enter","keydown"],["type","button",1,"btn","bottomRightRadius",3,"click"],[1,"message"],[1,"chat"],[1,"text"],["type","button",1,"btn","start","bottomLeftRadius",3,"click"],["type","button",1,"btn","bottomLeftRadius",3,"click"],["type","button",1,"btn","bottomLeftRadius","bold",3,"click"]],template:function(i,s){if(1&i){const o=Vs();Le(0,"section",3),mi(1,"img",4),Le(2,"h2",5),at(3,"Talk to strangers!"),Qe(),Le(4,"h2",6),at(5),Qe()(),Le(6,"main",7)(7,"section",8,0),Hn(9,AJ,2,0,"div",9)(10,MJ,2,0,"div",9)(11,NJ,6,8,"div",10)(12,RJ,2,0,"div",9)(13,PJ,3,2,"ng-container",11),Qe(),Le(14,"form",12),Hn(15,LJ,2,1,"button",13)(16,FJ,2,0,"button",14)(17,BJ,2,0,"button",15),Le(18,"textarea",16,1),kn("keydown.enter",function(){ci(o);const c=xf(19);return s.sendMessage(c.value),li(s.cleanMessageField(c))})("keydown",function(){return ci(o),li(s.onTyping())}),Qe(),Le(20,"button",17,2),kn("click",function(){ci(o);const c=xf(19);return s.sendMessage(c.value),li(s.cleanMessageField(c))}),at(22," Send "),Qe()()()}2&i&&(Ie(5),Af(s.currentOnline),Ie(4),Ke("ngIf",s.stranger),Ie(),Ke("ngIf",!s.stranger&&s.currentState===s.stateSearchingStranger),Ie(),Ke("ngForOf",s.messages),Ie(),Ke("ngIf",s.strangeIsTyping),Ie(),Ke("ngIf",s.currentState===s.stateDisconnected),Ie(2),Ke("ngIf",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger),Ie(),Ke("ngIf",s.currentState===s.stateConnected),Ie(),Ke("ngIf",s.currentState===s.stateUpToDisconnect),Ie(),kr("disabled",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger?"disabled":null),Ie(2),kr("disabled",s.currentState===s.stateDisconnected||s.currentState===s.stateSearchingStranger?"disabled":null))},dependencies:[qx,sh,TJ],encapsulation:2})}return e})()},{path:"",redirectTo:"chat",pathMatch:"full"}];let jJ=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({imports:[vO.forRoot(UJ,{useHash:!0}),vO]})}return e})(),Q_=(()=>{class e extends ot{constructor(){super()}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var ce=function(e){return e[e.State=0]="State",e[e.Transition=1]="Transition",e[e.Sequence=2]="Sequence",e[e.Group=3]="Group",e[e.Animate=4]="Animate",e[e.Keyframes=5]="Keyframes",e[e.Style=6]="Style",e[e.Trigger=7]="Trigger",e[e.Reference=8]="Reference",e[e.AnimateChild=9]="AnimateChild",e[e.AnimateRef=10]="AnimateRef",e[e.Query=11]="Query",e[e.Stagger=12]="Stagger",e}(ce||{});const Pi="*";function $J(e,t){return{type:ce.Trigger,name:e,definitions:t,options:{}}}function _O(e,t=null){return{type:ce.Animate,styles:t,timings:e}}function Pu(e){return{type:ce.Style,styles:e,offset:null}}function Y_(e,t,r){return{type:ce.State,name:e,styles:t,options:r}}function bO(e,t,r=null){return{type:ce.Transition,expr:e,animation:t,options:r}}class Lu{constructor(t=0,r=0){this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._originalOnDoneFns=[],this._originalOnStartFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this._position=0,this.parentPlayer=null,this.totalTime=t+r}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(t=>t()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(t){this._position=this.totalTime?t*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(t){const r="start"==t?this._onStartFns:this._onDoneFns;r.forEach(i=>i()),r.length=0}}class EO{constructor(t){this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=t;let r=0,i=0,s=0;const o=this.players.length;0==o?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++r==o&&this._onFinish()}),a.onDestroy(()=>{++i==o&&this._onDestroy()}),a.onStart(()=>{++s==o&&this._onStart()})}),this.totalTime=this.players.reduce((a,c)=>Math.max(a,c.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this.players.forEach(t=>t.init())}onStart(t){this._onStartFns.push(t)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(t=>t()),this._onStartFns=[])}onDone(t){this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(t=>t.play())}pause(){this.players.forEach(t=>t.pause())}restart(){this.players.forEach(t=>t.restart())}finish(){this._onFinish(),this.players.forEach(t=>t.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(t=>t.destroy()),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}reset(){this.players.forEach(t=>t.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(t){const r=t*this.totalTime;this.players.forEach(i=>{const s=i.totalTime?Math.min(1,r/i.totalTime):1;i.setPosition(s)})}getPosition(){const t=this.players.reduce((r,i)=>null===r||i.totalTime>r.totalTime?i:r,null);return null!=t?t.getPosition():0}beforeDestroy(){this.players.forEach(t=>{t.beforeDestroy&&t.beforeDestroy()})}triggerCallback(t){const r="start"==t?this._onStartFns:this._onDoneFns;r.forEach(i=>i()),r.length=0}}const DO=["toast-component",""];function WJ(e,t){if(1&e){const r=Vs();Le(0,"button",5),kn("click",function(){return ci(r),li(It().remove())}),Le(1,"span",6),at(2,"\xd7"),Qe()()}}function ZJ(e,t){if(1&e&&(ha(0),at(1),pa()),2&e){const r=It(2);Ie(),Fr("[",r.duplicatesCount+1,"]")}}function KJ(e,t){if(1&e&&(Le(0,"div"),at(1),Hn(2,ZJ,2,1,"ng-container",4),Qe()),2&e){const r=It();gi(r.options.titleClass),kr("aria-label",r.title),Ie(),Fr(" ",r.title," "),Ie(),Ke("ngIf",r.duplicatesCount)}}function QJ(e,t){if(1&e&&mi(0,"div",7),2&e){const r=It();gi(r.options.messageClass),Ke("innerHTML",r.message,xm)}}function YJ(e,t){if(1&e&&(Le(0,"div",8),at(1),Qe()),2&e){const r=It();gi(r.options.messageClass),kr("aria-label",r.message),Ie(),Fr(" ",r.message," ")}}function JJ(e,t){if(1&e&&(Le(0,"div"),mi(1,"div",9),Qe()),2&e){const r=It();Ie(),fa("width",r.width()+"%")}}class sX{_attachedHost;component;viewContainerRef;injector;constructor(t,r){this.component=t,this.injector=r}attach(t,r){return this._attachedHost=t,t.attach(this,r)}detach(){const t=this._attachedHost;if(t)return this._attachedHost=void 0,t.detach()}get isAttached(){return null!=this._attachedHost}setAttachedHost(t){this._attachedHost=t}}class oX{_attachedPortal;_disposeFn;attach(t,r){return this._attachedPortal=t,this.attachComponentPortal(t,r)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(t){this._disposeFn=t}}class aX{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new ot;_activate=new ot;_manualClose=new ot;_resetTimeout=new ot;_countDuplicate=new ot;constructor(t){this._overlayRef=t}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(t,r){t&&this._resetTimeout.next(),r&&this._countDuplicate.next(++this.duplicatesCount)}}class Np{toastId;config;message;title;toastType;toastRef;_onTap=new ot;_onAction=new ot;constructor(t,r,i,s,o,a){this.toastId=t,this.config=r,this.message=i,this.title=s,this.toastType=o,this.toastRef=a,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(t){this._onAction.next(t)}onAction(){return this._onAction.asObservable()}}const SO=new K("ToastConfig");class cX extends oX{_hostDomElement;_componentFactoryResolver;_appRef;constructor(t,r,i){super(),this._hostDomElement=t,this._componentFactoryResolver=r,this._appRef=i}attachComponentPortal(t,r){const i=this._componentFactoryResolver.resolveComponentFactory(t.component);let s;return s=i.create(t.injector),this._appRef.attachView(s.hostView),this.setDisposeFn(()=>{this._appRef.detachView(s.hostView),s.destroy()}),r?this._hostDomElement.insertBefore(this._getComponentRootNode(s),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(s)),s}_getComponentRootNode(t){return t.hostView.rootNodes[0]}}let lX=(()=>{class e{_document=P(Wt);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){const r=this._document.createElement("div");r.classList.add("overlay-container"),r.setAttribute("aria-live","polite"),this._document.body.appendChild(r),this._containerElement=r}static \u0275fac=function(i){return new(i||e)};static \u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();class uX{_portalHost;constructor(t){this._portalHost=t}attach(t,r=!0){return this._portalHost.attach(t,r)}detach(){return this._portalHost.detach()}}let dX=(()=>{class e{_overlayContainer=P(lX);_componentFactoryResolver=P(sl);_appRef=P(Br);_document=P(Wt);_paneElements=new Map;create(r,i){return this._createOverlayRef(this.getPaneElement(r,i))}getPaneElement(r="",i){return this._paneElements.get(i)||this._paneElements.set(i,{}),this._paneElements.get(i)[r]||(this._paneElements.get(i)[r]=this._createPaneElement(r,i)),this._paneElements.get(i)[r]}_createPaneElement(r,i){const s=this._document.createElement("div");return s.id="toast-container",s.classList.add(r),s.classList.add("toast-container"),i?i.getContainerElement().appendChild(s):this._overlayContainer.getContainerElement().appendChild(s),s}_createPortalHost(r){return new cX(r,this._componentFactoryResolver,this._appRef)}_createOverlayRef(r){return new uX(this._createPortalHost(r))}static \u0275fac=function(i){return new(i||e)};static \u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),X_=(()=>{class e{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(r,i,s,o,a){this.overlay=i,this._injector=s,this.sanitizer=o,this.ngZone=a,this.toastrConfig={...r.default,...r.config},r.config.iconClasses&&(this.toastrConfig.iconClasses={...r.default.iconClasses,...r.config.iconClasses})}show(r,i,s={},o=""){return this._preBuildNotification(o,r,i,this.applyConfig(s))}success(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.success||"",r,i,this.applyConfig(s))}error(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.error||"",r,i,this.applyConfig(s))}info(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.info||"",r,i,this.applyConfig(s))}warning(r,i,s={}){return this._preBuildNotification(this.toastrConfig.iconClasses.warning||"",r,i,this.applyConfig(s))}clear(r){for(const i of this.toasts)if(void 0!==r){if(i.toastId===r)return void i.toastRef.manualClose()}else i.toastRef.manualClose()}remove(r){const i=this._findToast(r);if(!i||(i.activeToast.toastRef.close(),this.toasts.splice(i.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActivethis._buildNotification(r,i,s,o)):this._buildNotification(r,i,s,o)}_buildNotification(r,i,s,o){if(!o.toastComponent)throw new Error("toastComponent required");const a=this.findDuplicate(s,i,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&s||i)&&this.toastrConfig.preventDuplicates&&null!==a)return a;this.previousToastMessage=i;let c=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(c=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));const l=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let u=i;i&&o.enableHtml&&(u=this.sanitizer.sanitize(Nn.HTML,i));const d=new aX(l),f=new Np(this.index,o,u,s,r,d),p=qt.create({providers:[{provide:Np,useValue:f}],parent:this._injector}),g=new sX(o.toastComponent,p),m=l.attach(g,o.newestOnTop);d.componentInstance=m.instance;const y={toastId:this.index,title:s||"",message:i||"",toastRef:d,onShown:d.afterActivate(),onHidden:d.afterClosed(),onTap:f.onTap(),onAction:f.onAction(),portal:m};return c||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{y.toastRef.activate()})),this.toasts.push(y),y}static \u0275fac=function(i){return new(i||e)(G(SO),G(dX),G(qt),G(bA),G(Ne))};static \u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();const fX={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing",toastComponent:(()=>{class e{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=ul(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if("inactive"===this.state().value)return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(r,i,s){this.toastrService=r,this.toastPackage=i,this.ngZone=s,this.message=i.message,this.title=i.title,this.options=i.config,this.originalTimeout=i.config.timeOut,this.toastClasses=`${i.toastType} ${i.config.toastClass}`,this.sub=i.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=i.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=i.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=i.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state=ul({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(r=>({...r,value:"active"})),!0!==this.options.disableTimeOut&&"timeOut"!==this.options.disableTimeOut&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(0===this.width()||100===this.width()||!this.options.timeOut)return;const r=(new Date).getTime();this.width.set((this.hideTime-r)/this.options.timeOut*100),"increasing"===this.options.progressAnimation&&this.width.update(s=>100-s),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(r=>({...r,value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){"removed"!==this.state().value&&(clearTimeout(this.timeout),this.state.update(r=>({...r,value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){"removed"!==this.state().value&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){"removed"!==this.state().value&&"extendedTimeOut"!==this.options.disableTimeOut&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){!0===this.options.disableTimeOut||"extendedTimeOut"===this.options.disableTimeOut||0===this.options.extendedTimeOut||"removed"===this.state().value||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(r,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(r),i)):this.timeout=setTimeout(()=>r(),i)}outsideInterval(r,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(r),i)):this.intervalId=setInterval(()=>r(),i)}runInsideAngular(r){this.ngZone?this.ngZone.run(()=>r()):r()}static \u0275fac=function(i){return new(i||e)(X(X_),X(Np),X(Ne))};static \u0275cmp=So({type:e,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(i,s){1&i&&kn("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),2&i&&(qy("@flyInOut",s._state),gi(s.toastClasses),fa("display",s.displayStyle))},standalone:!0,features:[Mf],attrs:DO,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(i,s){1&i&&Hn(0,WJ,3,0,"button",0)(1,KJ,3,5,"div",1)(2,QJ,1,3,"div",2)(3,YJ,2,4,"div",3)(4,JJ,2,2,"div",4),2&i&&(Ke("ngIf",s.options.closeButton),Ie(),Ke("ngIf",s.title),Ie(),Ke("ngIf",s.message&&s.options.enableHtml),Ie(),Ke("ngIf",s.message&&!s.options.enableHtml),Ie(),Ke("ngIf",s.options.progressBar))},dependencies:[sh],encapsulation:2,data:{animation:[$J("flyInOut",[Y_("inactive",Pu({opacity:0})),Y_("active",Pu({opacity:1})),Y_("removed",Pu({opacity:0})),bO("inactive => active",_O("{{ easeTime }}ms {{ easing }}")),bO("active => removed",_O("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return e})()},hX=(e={})=>function Dc(e){return{\u0275providers:e}}([{provide:SO,useValue:{default:fX,config:e}}]);let pX=(()=>{class e{static forRoot(r={}){return{ngModule:e,providers:[hX(r)]}}static \u0275fac=function(i){return new(i||e)};static \u0275mod=pn({type:e});static \u0275inj=Jt({})}return e})(),gX=(()=>{class e{constructor(r,i){this.error$=r,this.toastrService=i,this.subscriptions=new Rt}ngOnInit(){this.subscriptions.add(this.error$.subscribe(r=>this.toastrService.error(r)))}ngOnDestroy(){this.subscriptions.unsubscribe()}static#e=this.\u0275fac=function(i){return new(i||e)(X(Q_),X(X_))};static#t=this.\u0275cmp=So({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(i,s){1&i&&mi(0,"router-outlet")},dependencies:[F_],encapsulation:2})}return e})(),mX=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({imports:[Ea]})}return e})(),yX=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({providers:[m_,fp],imports:[Ea]})}return e})();function IO(e){return new M(3e3,!1)}function bs(e){switch(e.length){case 0:return new Lu;case 1:return e[0];default:return new EO(e)}}function TO(e,t,r=new Map,i=new Map){const s=[],o=[];let a=-1,c=null;if(t.forEach(l=>{const u=l.get("offset"),d=u==a,f=d&&c||new Map;l.forEach((h,p)=>{let g=p,m=h;if("offset"!==p)switch(g=e.normalizePropertyName(g,s),m){case"!":m=r.get(p);break;case Pi:m=i.get(p);break;default:m=e.normalizeStyleValue(p,g,m,s)}f.set(g,m)}),d||o.push(f),c=f,a=u}),s.length)throw function jX(e){return new M(3502,!1)}();return o}function eb(e,t,r,i){switch(t){case"start":e.onStart(()=>i(r&&tb(r,"start",e)));break;case"done":e.onDone(()=>i(r&&tb(r,"done",e)));break;case"destroy":e.onDestroy(()=>i(r&&tb(r,"destroy",e)))}}function tb(e,t,r){const o=nb(e.element,e.triggerName,e.fromState,e.toState,t||e.phaseName,r.totalTime??e.totalTime,!!r.disabled),a=e._data;return null!=a&&(o._data=a),o}function nb(e,t,r,i,s="",o=0,a){return{element:e,triggerName:t,fromState:r,toState:i,phaseName:s,totalTime:o,disabled:!!a}}function Bn(e,t,r){let i=e.get(t);return i||e.set(t,i=r),i}function xO(e){const t=e.indexOf(":");return[e.substring(1,t),e.slice(t+1)]}const JX=typeof document>"u"?null:document.documentElement;function rb(e){const t=e.parentNode||e.host||null;return t===JX?null:t}let fo=null,AO=!1;function MO(e,t){for(;t;){if(t===e)return!0;t=rb(t)}return!1}function NO(e,t,r){if(r)return Array.from(e.querySelectorAll(t));const i=e.querySelector(t);return i?[i]:[]}let ib=(()=>{class e{validateStyleProperty(r){return function eee(e){fo||(fo=function tee(){return typeof document<"u"?document.body:null}()||{},AO=!!fo.style&&"WebkitAppearance"in fo.style);let t=!0;return fo.style&&!function XX(e){return"ebkit"==e.substring(1,6)}(e)&&(t=e in fo.style,!t&&AO&&(t="Webkit"+e.charAt(0).toUpperCase()+e.slice(1)in fo.style)),t}(r)}matchesElement(r,i){return!1}containsElement(r,i){return MO(r,i)}getParentElement(r){return rb(r)}query(r,i,s){return NO(r,i,s)}computeStyle(r,i,s){return s||""}animate(r,i,s,o,a,c=[],l){return new Lu(s,o)}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();class sb{static#e=this.NOOP=new ib}class ob{}const ree=1e3,ab="ng-enter",Rp="ng-leave",Op="ng-trigger",kp=".ng-trigger",OO="ng-animating",cb=".ng-animating";function Li(e){if("number"==typeof e)return e;const t=e.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:lb(parseFloat(t[1]),t[2])}function lb(e,t){return"s"===t?e*ree:e}function Pp(e,t,r){return e.hasOwnProperty("duration")?e:function see(e,t,r){let s,o=0,a="";if("string"==typeof e){const c=e.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===c)return t.push(IO()),{duration:0,delay:0,easing:""};s=lb(parseFloat(c[1]),c[2]);const l=c[3];null!=l&&(o=lb(parseFloat(l),c[4]));const u=c[5];u&&(a=u)}else s=e;if(!r){let c=!1,l=t.length;s<0&&(t.push(function vX(){return new M(3100,!1)}()),c=!0),o<0&&(t.push(function wX(){return new M(3101,!1)}()),c=!0),c&&t.splice(l,0,IO())}return{duration:s,delay:o,easing:a}}(e,t,r)}function ri(e,t,r){t.forEach((i,s)=>{const o=db(s);r&&!r.has(s)&&r.set(s,e.style[o]),e.style[o]=i})}function ho(e,t){t.forEach((r,i)=>{const s=db(i);e.style[s]=""})}function Fu(e){return Array.isArray(e)?1==e.length?e[0]:function VJ(e,t=null){return{type:ce.Sequence,steps:e,options:t}}(e):e}const ub=new RegExp("{{\\s*(.+?)\\s*}}","g");function PO(e){let t=[];if("string"==typeof e){let r;for(;r=ub.exec(e);)t.push(r[1]);ub.lastIndex=0}return t}function Bu(e,t,r){const i=`${e}`,s=i.replace(ub,(o,a)=>{let c=t[a];return null==c&&(r.push(function bX(e){return new M(3003,!1)}()),c=""),c.toString()});return s==i?e:s}const cee=/-+([a-z0-9])/g;function db(e){return e.replace(cee,(...t)=>t[1].toUpperCase())}function Un(e,t,r){switch(t.type){case ce.Trigger:return e.visitTrigger(t,r);case ce.State:return e.visitState(t,r);case ce.Transition:return e.visitTransition(t,r);case ce.Sequence:return e.visitSequence(t,r);case ce.Group:return e.visitGroup(t,r);case ce.Animate:return e.visitAnimate(t,r);case ce.Keyframes:return e.visitKeyframes(t,r);case ce.Style:return e.visitStyle(t,r);case ce.Reference:return e.visitReference(t,r);case ce.AnimateChild:return e.visitAnimateChild(t,r);case ce.AnimateRef:return e.visitAnimateRef(t,r);case ce.Query:return e.visitQuery(t,r);case ce.Stagger:return e.visitStagger(t,r);default:throw function EX(e){return new M(3004,!1)}()}}function fb(e,t){return window.getComputedStyle(e)[t]}const dee=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]);class LO extends ob{normalizePropertyName(t,r){return db(t)}normalizeStyleValue(t,r,i,s){let o="";const a=i.toString().trim();if(dee.has(r)&&0!==i&&"0"!==i)if("number"==typeof i)o="px";else{const c=i.match(/^[+-]?[\d\.]+([a-z]*)$/);c&&0==c[1].length&&s.push(function DX(e,t){return new M(3005,!1)}())}return a+o}}const Lp="*";const Fp=new Set(["true","1"]),Bp=new Set(["false","0"]);function FO(e,t){const r=Fp.has(e)||Bp.has(e),i=Fp.has(t)||Bp.has(t);return(s,o)=>{let a=e==Lp||e==s,c=t==Lp||t==o;return!a&&r&&"boolean"==typeof s&&(a=s?Fp.has(e):Bp.has(e)),!c&&i&&"boolean"==typeof o&&(c=o?Fp.has(t):Bp.has(t)),a&&c}}const gee=new RegExp("s*:selfs*,?","g");function hb(e,t,r,i){return new mee(e).build(t,r,i)}class mee{constructor(t){this._driver=t}build(t,r,i){const s=new wee(r);return this._resetContextStyleTimingState(s),Un(this,Fu(t),s)}_resetContextStyleTimingState(t){t.currentQuerySelector="",t.collectedStyles=new Map,t.collectedStyles.set("",new Map),t.currentTime=0}visitTrigger(t,r){let i=r.queryCount=0,s=r.depCount=0;const o=[],a=[];return"@"==t.name.charAt(0)&&r.errors.push(function CX(){return new M(3006,!1)}()),t.definitions.forEach(c=>{if(this._resetContextStyleTimingState(r),c.type==ce.State){const l=c,u=l.name;u.toString().split(/\s*,\s*/).forEach(d=>{l.name=d,o.push(this.visitState(l,r))}),l.name=u}else if(c.type==ce.Transition){const l=this.visitTransition(c,r);i+=l.queryCount,s+=l.depCount,a.push(l)}else r.errors.push(function SX(){return new M(3007,!1)}())}),{type:ce.Trigger,name:t.name,states:o,transitions:a,queryCount:i,depCount:s,options:null}}visitState(t,r){const i=this.visitStyle(t.styles,r),s=t.options&&t.options.params||null;if(i.containsDynamicStyles){const o=new Set,a=s||{};i.styles.forEach(c=>{c instanceof Map&&c.forEach(l=>{PO(l).forEach(u=>{a.hasOwnProperty(u)||o.add(u)})})}),o.size&&r.errors.push(function IX(e,t){return new M(3008,!1)}(0,o.values()))}return{type:ce.State,name:t.name,style:i,options:s?{params:s}:null}}visitTransition(t,r){r.queryCount=0,r.depCount=0;const i=Un(this,Fu(t.animation),r),s=function fee(e,t){const r=[];return"string"==typeof e?e.split(/\s*,\s*/).forEach(i=>function hee(e,t,r){if(":"==e[0]){const l=function pee(e,t){switch(e){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(r,i)=>parseFloat(i)>parseFloat(r);case":decrement":return(r,i)=>parseFloat(i) *"}}(e,r);if("function"==typeof l)return void t.push(l);e=l}const i=e.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return r.push(function PX(e){return new M(3015,!1)}()),t;const s=i[1],o=i[2],a=i[3];t.push(FO(s,a)),"<"==o[0]&&(s!=Lp||a!=Lp)&&t.push(FO(a,s))}(i,r,t)):r.push(e),r}(t.expr,r.errors);return{type:ce.Transition,matchers:s,animation:i,queryCount:r.queryCount,depCount:r.depCount,options:po(t.options)}}visitSequence(t,r){return{type:ce.Sequence,steps:t.steps.map(i=>Un(this,i,r)),options:po(t.options)}}visitGroup(t,r){const i=r.currentTime;let s=0;const o=t.steps.map(a=>{r.currentTime=i;const c=Un(this,a,r);return s=Math.max(s,r.currentTime),c});return r.currentTime=s,{type:ce.Group,steps:o,options:po(t.options)}}visitAnimate(t,r){const i=function bee(e,t){if(e.hasOwnProperty("duration"))return e;if("number"==typeof e)return pb(Pp(e,t).duration,0,"");const r=e;if(r.split(/\s+/).some(o=>"{"==o.charAt(0)&&"{"==o.charAt(1))){const o=pb(0,0,"");return o.dynamic=!0,o.strValue=r,o}const s=Pp(r,t);return pb(s.duration,s.delay,s.easing)}(t.timings,r.errors);r.currentAnimateTimings=i;let s,o=t.styles?t.styles:Pu({});if(o.type==ce.Keyframes)s=this.visitKeyframes(o,r);else{let a=t.styles,c=!1;if(!a){c=!0;const u={};i.easing&&(u.easing=i.easing),a=Pu(u)}r.currentTime+=i.duration+i.delay;const l=this.visitStyle(a,r);l.isEmptyStep=c,s=l}return r.currentAnimateTimings=null,{type:ce.Animate,timings:i,style:s,options:null}}visitStyle(t,r){const i=this._makeStyleAst(t,r);return this._validateStyleAst(i,r),i}_makeStyleAst(t,r){const i=[],s=Array.isArray(t.styles)?t.styles:[t.styles];for(let c of s)"string"==typeof c?c===Pi?i.push(c):r.errors.push(new M(3002,!1)):i.push(new Map(Object.entries(c)));let o=!1,a=null;return i.forEach(c=>{if(c instanceof Map&&(c.has("easing")&&(a=c.get("easing"),c.delete("easing")),!o))for(let l of c.values())if(l.toString().indexOf("{{")>=0){o=!0;break}}),{type:ce.Style,styles:i,easing:a,offset:t.offset,containsDynamicStyles:o,options:null}}_validateStyleAst(t,r){const i=r.currentAnimateTimings;let s=r.currentTime,o=r.currentTime;i&&o>0&&(o-=i.duration+i.delay),t.styles.forEach(a=>{"string"!=typeof a&&a.forEach((c,l)=>{const u=r.collectedStyles.get(r.currentQuerySelector),d=u.get(l);let f=!0;d&&(o!=s&&o>=d.startTime&&s<=d.endTime&&(r.errors.push(function xX(e,t,r,i,s){return new M(3010,!1)}()),f=!1),o=d.startTime),f&&u.set(l,{startTime:o,endTime:s}),r.options&&function aee(e,t,r){const i=t.params||{},s=PO(e);s.length&&s.forEach(o=>{i.hasOwnProperty(o)||r.push(function _X(e){return new M(3001,!1)}())})}(c,r.options,r.errors)})})}visitKeyframes(t,r){const i={type:ce.Keyframes,styles:[],options:null};if(!r.currentAnimateTimings)return r.errors.push(function AX(){return new M(3011,!1)}()),i;let o=0;const a=[];let c=!1,l=!1,u=0;const d=t.steps.map(v=>{const w=this._makeStyleAst(v,r);let _=null!=w.offset?w.offset:function _ee(e){if("string"==typeof e)return null;let t=null;if(Array.isArray(e))e.forEach(r=>{if(r instanceof Map&&r.has("offset")){const i=r;t=parseFloat(i.get("offset")),i.delete("offset")}});else if(e instanceof Map&&e.has("offset")){const r=e;t=parseFloat(r.get("offset")),r.delete("offset")}return t}(w.styles),b=0;return null!=_&&(o++,b=w.offset=_),l=l||b<0||b>1,c=c||b0&&o{const _=h>0?w==p?1:h*w:a[w],b=_*y;r.currentTime=g+m.delay+b,m.duration=b,this._validateStyleAst(v,r),v.offset=_,i.styles.push(v)}),i}visitReference(t,r){return{type:ce.Reference,animation:Un(this,Fu(t.animation),r),options:po(t.options)}}visitAnimateChild(t,r){return r.depCount++,{type:ce.AnimateChild,options:po(t.options)}}visitAnimateRef(t,r){return{type:ce.AnimateRef,animation:this.visitReference(t.animation,r),options:po(t.options)}}visitQuery(t,r){const i=r.currentQuerySelector,s=t.options||{};r.queryCount++,r.currentQuery=t;const[o,a]=function yee(e){const t=!!e.split(/\s*,\s*/).find(r=>":self"==r);return t&&(e=e.replace(gee,"")),e=e.replace(/@\*/g,kp).replace(/@\w+/g,r=>kp+"-"+r.slice(1)).replace(/:animating/g,cb),[e,t]}(t.selector);r.currentQuerySelector=i.length?i+" "+o:o,Bn(r.collectedStyles,r.currentQuerySelector,new Map);const c=Un(this,Fu(t.animation),r);return r.currentQuery=null,r.currentQuerySelector=i,{type:ce.Query,selector:o,limit:s.limit||0,optional:!!s.optional,includeSelf:a,animation:c,originalSelector:t.selector,options:po(t.options)}}visitStagger(t,r){r.currentQuery||r.errors.push(function OX(){return new M(3013,!1)}());const i="full"===t.timings?{duration:0,delay:0,easing:"full"}:Pp(t.timings,r.errors,!0);return{type:ce.Stagger,animation:Un(this,Fu(t.animation),r),timings:i,options:null}}}class wee{constructor(t){this.errors=t,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles=new Map,this.options=null,this.unsupportedCSSPropertiesFound=new Set}}function po(e){return e?(e={...e}).params&&(e.params=function vee(e){return e?{...e}:null}(e.params)):e={},e}function pb(e,t,r){return{duration:e,delay:t,easing:r}}function gb(e,t,r,i,s,o,a=null,c=!1){return{type:1,element:e,keyframes:t,preStyleProps:r,postStyleProps:i,duration:s,delay:o,totalTime:s+o,easing:a,subTimeline:c}}class Up{constructor(){this._map=new Map}get(t){return this._map.get(t)||[]}append(t,r){let i=this._map.get(t);i||this._map.set(t,i=[]),i.push(...r)}has(t){return this._map.has(t)}clear(){this._map.clear()}}const Cee=new RegExp(":enter","g"),Iee=new RegExp(":leave","g");function mb(e,t,r,i,s,o=new Map,a=new Map,c,l,u=[]){return(new Tee).buildKeyframes(e,t,r,i,s,o,a,c,l,u)}class Tee{buildKeyframes(t,r,i,s,o,a,c,l,u,d=[]){u=u||new Up;const f=new yb(t,r,u,s,o,d,[]);f.options=l;const h=l.delay?Li(l.delay):0;f.currentTimeline.delayNextStep(h),f.currentTimeline.setStyles([a],null,f.errors,l),Un(this,i,f);const p=f.timelines.filter(g=>g.containsAnimation());if(p.length&&c.size){let g;for(let m=p.length-1;m>=0;m--){const y=p[m];if(y.element===r){g=y;break}}g&&!g.allowOnlyTimelineStyles()&&g.setStyles([c],null,f.errors,l)}return p.length?p.map(g=>g.buildKeyframes()):[gb(r,[],[],[],0,h,"",!1)]}visitTrigger(t,r){}visitState(t,r){}visitTransition(t,r){}visitAnimateChild(t,r){const i=r.subInstructions.get(r.element);if(i){const s=r.createSubContext(t.options),o=r.currentTimeline.currentTime,a=this._visitSubInstructions(i,s,s.options);o!=a&&r.transformIntoNewTimeline(a)}r.previousNode=t}visitAnimateRef(t,r){const i=r.createSubContext(t.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([t.options,t.animation.options],r,i),this.visitReference(t.animation,i),r.transformIntoNewTimeline(i.currentTimeline.currentTime),r.previousNode=t}_applyAnimationRefDelays(t,r,i){for(const s of t){const o=s?.delay;if(o){const a="number"==typeof o?o:Li(Bu(o,s?.params??{},r.errors));i.delayNextStep(a)}}}_visitSubInstructions(t,r,i){let o=r.currentTimeline.currentTime;const a=null!=i.duration?Li(i.duration):null,c=null!=i.delay?Li(i.delay):null;return 0!==a&&t.forEach(l=>{const u=r.appendInstructionToTimeline(l,a,c);o=Math.max(o,u.duration+u.delay)}),o}visitReference(t,r){r.updateOptions(t.options,!0),Un(this,t.animation,r),r.previousNode=t}visitSequence(t,r){const i=r.subContextCount;let s=r;const o=t.options;if(o&&(o.params||o.delay)&&(s=r.createSubContext(o),s.transformIntoNewTimeline(),null!=o.delay)){s.previousNode.type==ce.Style&&(s.currentTimeline.snapshotCurrentStyles(),s.previousNode=jp);const a=Li(o.delay);s.delayNextStep(a)}t.steps.length&&(t.steps.forEach(a=>Un(this,a,s)),s.currentTimeline.applyStylesToKeyframe(),s.subContextCount>i&&s.transformIntoNewTimeline()),r.previousNode=t}visitGroup(t,r){const i=[];let s=r.currentTimeline.currentTime;const o=t.options&&t.options.delay?Li(t.options.delay):0;t.steps.forEach(a=>{const c=r.createSubContext(t.options);o&&c.delayNextStep(o),Un(this,a,c),s=Math.max(s,c.currentTimeline.currentTime),i.push(c.currentTimeline)}),i.forEach(a=>r.currentTimeline.mergeTimelineCollectedStyles(a)),r.transformIntoNewTimeline(s),r.previousNode=t}_visitTiming(t,r){if(t.dynamic){const i=t.strValue;return Pp(r.params?Bu(i,r.params,r.errors):i,r.errors)}return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,r){const i=r.currentAnimateTimings=this._visitTiming(t.timings,r),s=r.currentTimeline;i.delay&&(r.incrementTime(i.delay),s.snapshotCurrentStyles());const o=t.style;o.type==ce.Keyframes?this.visitKeyframes(o,r):(r.incrementTime(i.duration),this.visitStyle(o,r),s.applyStylesToKeyframe()),r.currentAnimateTimings=null,r.previousNode=t}visitStyle(t,r){const i=r.currentTimeline,s=r.currentAnimateTimings;!s&&i.hasCurrentStyleProperties()&&i.forwardFrame();const o=s&&s.easing||t.easing;t.isEmptyStep?i.applyEmptyStep(o):i.setStyles(t.styles,o,r.errors,r.options),r.previousNode=t}visitKeyframes(t,r){const i=r.currentAnimateTimings,s=r.currentTimeline.duration,o=i.duration,c=r.createSubContext().currentTimeline;c.easing=i.easing,t.styles.forEach(l=>{c.forwardTime((l.offset||0)*o),c.setStyles(l.styles,l.easing,r.errors,r.options),c.applyStylesToKeyframe()}),r.currentTimeline.mergeTimelineCollectedStyles(c),r.transformIntoNewTimeline(s+o),r.previousNode=t}visitQuery(t,r){const i=r.currentTimeline.currentTime,s=t.options||{},o=s.delay?Li(s.delay):0;o&&(r.previousNode.type===ce.Style||0==i&&r.currentTimeline.hasCurrentStyleProperties())&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=jp);let a=i;const c=r.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!s.optional,r.errors);r.currentQueryTotal=c.length;let l=null;c.forEach((u,d)=>{r.currentQueryIndex=d;const f=r.createSubContext(t.options,u);o&&f.delayNextStep(o),u===r.element&&(l=f.currentTimeline),Un(this,t.animation,f),f.currentTimeline.applyStylesToKeyframe(),a=Math.max(a,f.currentTimeline.currentTime)}),r.currentQueryIndex=0,r.currentQueryTotal=0,r.transformIntoNewTimeline(a),l&&(r.currentTimeline.mergeTimelineCollectedStyles(l),r.currentTimeline.snapshotCurrentStyles()),r.previousNode=t}visitStagger(t,r){const i=r.parentContext,s=r.currentTimeline,o=t.timings,a=Math.abs(o.duration),c=a*(r.currentQueryTotal-1);let l=a*r.currentQueryIndex;switch(o.duration<0?"reverse":o.easing){case"reverse":l=c-l;break;case"full":l=i.currentStaggerTime}const d=r.currentTimeline;l&&d.delayNextStep(l);const f=d.currentTime;Un(this,t.animation,r),r.previousNode=t,i.currentStaggerTime=s.currentTime-f+(s.startTime-i.currentTimeline.startTime)}}const jp={};class yb{constructor(t,r,i,s,o,a,c,l){this._driver=t,this.element=r,this.subInstructions=i,this._enterClassName=s,this._leaveClassName=o,this.errors=a,this.timelines=c,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=jp,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=l||new $p(this._driver,r,0),c.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,r){if(!t)return;const i=t;let s=this.options;null!=i.duration&&(s.duration=Li(i.duration)),null!=i.delay&&(s.delay=Li(i.delay));const o=i.params;if(o){let a=s.params;a||(a=this.options.params={}),Object.keys(o).forEach(c=>{(!r||!a.hasOwnProperty(c))&&(a[c]=Bu(o[c],a,this.errors))})}}_copyOptions(){const t={};if(this.options){const r=this.options.params;if(r){const i=t.params={};Object.keys(r).forEach(s=>{i[s]=r[s]})}}return t}createSubContext(t=null,r,i){const s=r||this.element,o=new yb(this._driver,s,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(s,i||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(t),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o}transformIntoNewTimeline(t){return this.previousNode=jp,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,r,i){const s={duration:r??t.duration,delay:this.currentTimeline.currentTime+(i??0)+t.delay,easing:""},o=new xee(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,s,t.stretchStartingKeyframe);return this.timelines.push(o),s}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,r,i,s,o,a){let c=[];if(s&&c.push(this.element),t.length>0){t=(t=t.replace(Cee,"."+this._enterClassName)).replace(Iee,"."+this._leaveClassName);let u=this._driver.query(this.element,t,1!=i);0!==i&&(u=i<0?u.slice(u.length+i,u.length):u.slice(0,i)),c.push(...u)}return!o&&0==c.length&&a.push(function kX(e){return new M(3014,!1)}()),c}}class $p{constructor(t,r,i,s){this._driver=t,this.element=r,this.startTime=i,this._elementTimelineStylesLookup=s,this.duration=0,this.easing=null,this._previousKeyframe=new Map,this._currentKeyframe=new Map,this._keyframes=new Map,this._styleSummary=new Map,this._localTimelineStyles=new Map,this._pendingStyles=new Map,this._backFill=new Map,this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(r),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(r,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(t){const r=1===this._keyframes.size&&this._pendingStyles.size;this.duration||r?(this.forwardTime(this.currentTime+t),r&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,r){return this.applyStylesToKeyframe(),new $p(this._driver,t,r||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=1,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,r){this._localTimelineStyles.set(t,r),this._globalTimelineStyles.set(t,r),this._styleSummary.set(t,{time:this.currentTime,value:r})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&this._previousKeyframe.set("easing",t);for(let[r,i]of this._globalTimelineStyles)this._backFill.set(r,i||Pi),this._currentKeyframe.set(r,Pi);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,r,i,s){r&&this._previousKeyframe.set("easing",r);const o=s&&s.params||{},a=function Aee(e,t){const r=new Map;let i;return e.forEach(s=>{if("*"===s){i??=t.keys();for(let o of i)r.set(o,Pi)}else for(let[o,a]of s)r.set(o,a)}),r}(t,this._globalTimelineStyles);for(let[c,l]of a){const u=Bu(l,o,i);this._pendingStyles.set(c,u),this._localTimelineStyles.has(c)||this._backFill.set(c,this._globalTimelineStyles.get(c)??Pi),this._updateStyle(c,u)}}applyStylesToKeyframe(){0!=this._pendingStyles.size&&(this._pendingStyles.forEach((t,r)=>{this._currentKeyframe.set(r,t)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((t,r)=>{this._currentKeyframe.has(r)||this._currentKeyframe.set(r,t)}))}snapshotCurrentStyles(){for(let[t,r]of this._localTimelineStyles)this._pendingStyles.set(t,r),this._updateStyle(t,r)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){const t=[];for(let r in this._currentKeyframe)t.push(r);return t}mergeTimelineCollectedStyles(t){t._styleSummary.forEach((r,i)=>{const s=this._styleSummary.get(i);(!s||r.time>s.time)&&this._updateStyle(i,r.value)})}buildKeyframes(){this.applyStylesToKeyframe();const t=new Set,r=new Set,i=1===this._keyframes.size&&0===this.duration;let s=[];this._keyframes.forEach((c,l)=>{const u=new Map([...this._backFill,...c]);u.forEach((d,f)=>{"!"===d?t.add(f):d===Pi&&r.add(f)}),i||u.set("offset",l/this.duration),s.push(u)});const o=[...t.values()],a=[...r.values()];if(i){const c=s[0],l=new Map(c);c.set("offset",0),l.set("offset",1),s=[c,l]}return gb(this.element,s,o,a,this.duration,this.startTime,this.easing,!1)}}class xee extends $p{constructor(t,r,i,s,o,a,c=!1){super(t,r,a.delay),this.keyframes=i,this.preStyleProps=s,this.postStyleProps=o,this._stretchStartingKeyframe=c,this.timings={duration:a.duration,delay:a.delay,easing:a.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:r,duration:i,easing:s}=this.timings;if(this._stretchStartingKeyframe&&r){const o=[],a=i+r,c=r/a,l=new Map(t[0]);l.set("offset",0),o.push(l);const u=new Map(t[0]);u.set("offset",jO(c)),o.push(u);const d=t.length-1;for(let f=1;f<=d;f++){let h=new Map(t[f]);const p=h.get("offset");h.set("offset",jO((r+p*i)/a)),o.push(h)}i=a,r=0,s="",t=o}return gb(this.element,t,this.preStyleProps,this.postStyleProps,i,r,s,!0)}}function jO(e,t=3){const r=Math.pow(10,t-1);return Math.round(e*r)/r}function $O(e,t,r,i,s,o,a,c,l,u,d,f,h){return{type:0,element:e,triggerName:t,isRemovalTransition:s,fromState:r,fromStyles:o,toState:i,toStyles:a,timelines:c,queriedElements:l,preStyleProps:u,postStyleProps:d,totalTime:f,errors:h}}const vb={};class VO{constructor(t,r,i){this._triggerName=t,this.ast=r,this._stateStyles=i}match(t,r,i,s){return function Mee(e,t,r,i,s){return e.some(o=>o(t,r,i,s))}(this.ast.matchers,t,r,i,s)}buildStyles(t,r,i){let s=this._stateStyles.get("*");return void 0!==t&&(s=this._stateStyles.get(t?.toString())||s),s?s.buildStyles(r,i):new Map}build(t,r,i,s,o,a,c,l,u,d){const f=[],h=this.ast.options&&this.ast.options.params||vb,g=this.buildStyles(i,c&&c.params||vb,f),m=l&&l.params||vb,y=this.buildStyles(s,m,f),v=new Set,w=new Map,_=new Map,b="void"===s,C={params:HO(m,h),delay:this.ast.options?.delay},D=d?[]:mb(t,r,this.ast.animation,o,a,g,y,C,u,f);let S=0;return D.forEach(T=>{S=Math.max(T.duration+T.delay,S)}),f.length?$O(r,this._triggerName,i,s,b,g,y,[],[],w,_,S,f):(D.forEach(T=>{const O=T.element,U=Bn(w,O,new Set);T.preStyleProps.forEach(j=>U.add(j));const B=Bn(_,O,new Set);T.postStyleProps.forEach(j=>B.add(j)),O!==r&&v.add(O)}),$O(r,this._triggerName,i,s,b,g,y,D,[...v.values()],w,_,S))}}function HO(e,t){const r={...t};return Object.entries(e).forEach(([i,s])=>{null!=s&&(r[i]=s)}),r}class Nee{constructor(t,r,i){this.styles=t,this.defaultParams=r,this.normalizer=i}buildStyles(t,r){const i=new Map,s=HO(t,this.defaultParams);return this.styles.styles.forEach(o=>{"string"!=typeof o&&o.forEach((a,c)=>{a&&(a=Bu(a,s,r));const l=this.normalizer.normalizePropertyName(c,r);a=this.normalizer.normalizeStyleValue(c,l,a,r),i.set(c,a)})}),i}}class Oee{constructor(t,r,i){this.name=t,this.ast=r,this._normalizer=i,this.transitionFactories=[],this.states=new Map,r.states.forEach(s=>{this.states.set(s.name,new Nee(s.style,s.options&&s.options.params||{},i))}),zO(this.states,"true","1"),zO(this.states,"false","0"),r.transitions.forEach(s=>{this.transitionFactories.push(new VO(t,s,this.states))}),this.fallbackTransition=function kee(e,t,r){return new VO(e,{type:ce.Transition,animation:{type:ce.Sequence,steps:[],options:null},matchers:[(a,c)=>!0],options:null,queryCount:0,depCount:0},t)}(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,r,i,s){return this.transitionFactories.find(a=>a.match(t,r,i,s))||null}matchStyles(t,r,i){return this.fallbackTransition.buildStyles(t,r,i)}}function zO(e,t,r){e.has(t)?e.has(r)||e.set(r,e.get(t)):e.has(r)&&e.set(t,e.get(r))}const Pee=new Up;class Lee{constructor(t,r,i){this.bodyNode=t,this._driver=r,this._normalizer=i,this._animations=new Map,this._playersById=new Map,this.players=[]}register(t,r){const i=[],o=hb(this._driver,r,i,[]);if(i.length)throw function $X(e){return new M(3503,!1)}();this._animations.set(t,o)}_buildPlayer(t,r,i){const s=t.element,o=TO(this._normalizer,t.keyframes,r,i);return this._driver.animate(s,o,t.duration,t.delay,t.easing,[],!0)}create(t,r,i={}){const s=[],o=this._animations.get(t);let a;const c=new Map;if(o?(a=mb(this._driver,r,o,ab,Rp,new Map,new Map,i,Pee,s),a.forEach(d=>{const f=Bn(c,d.element,new Map);d.postStyleProps.forEach(h=>f.set(h,null))})):(s.push(function VX(){return new M(3300,!1)}()),a=[]),s.length)throw function HX(e){return new M(3504,!1)}();c.forEach((d,f)=>{d.forEach((h,p)=>{d.set(p,this._driver.computeStyle(f,p,Pi))})});const u=bs(a.map(d=>{const f=c.get(d.element);return this._buildPlayer(d,new Map,f)}));return this._playersById.set(t,u),u.onDestroy(()=>this.destroy(t)),this.players.push(u),u}destroy(t){const r=this._getPlayer(t);r.destroy(),this._playersById.delete(t);const i=this.players.indexOf(r);i>=0&&this.players.splice(i,1)}_getPlayer(t){const r=this._playersById.get(t);if(!r)throw function zX(e){return new M(3301,!1)}();return r}listen(t,r,i,s){const o=nb(r,"","","");return eb(this._getPlayer(t),i,o,s),()=>{}}command(t,r,i,s){if("register"==i)return void this.register(t,s[0]);if("create"==i)return void this.create(t,r,s[0]||{});const o=this._getPlayer(t);switch(i){case"play":o.play();break;case"pause":o.pause();break;case"reset":o.reset();break;case"restart":o.restart();break;case"finish":o.finish();break;case"init":o.init();break;case"setPosition":o.setPosition(parseFloat(s[0]));break;case"destroy":this.destroy(t)}}}const qO="ng-animate-queued",wb="ng-animate-disabled",$ee=[],GO={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Vee={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},_r="__ng_removed";class _b{get params(){return this.options.params}constructor(t,r=""){this.namespaceId=r;const i=t&&t.hasOwnProperty("value");if(this.value=function Gee(e){return e??null}(i?t.value:t),i){const{value:o,...a}=t;this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(t){const r=t.params;if(r){const i=this.options.params;Object.keys(r).forEach(s=>{null==i[s]&&(i[s]=r[s])})}}}const Uu="void",bb=new _b(Uu);class Hee{constructor(t,r,i){this.id=t,this.hostElement=r,this._engine=i,this.players=[],this._triggers=new Map,this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,Yn(r,this._hostClassName)}listen(t,r,i,s){if(!this._triggers.has(r))throw function qX(e,t){return new M(3302,!1)}();if(null==i||0==i.length)throw function GX(e){return new M(3303,!1)}();if(!function Wee(e){return"start"==e||"done"==e}(i))throw function WX(e,t){return new M(3400,!1)}();const o=Bn(this._elementListeners,t,[]),a={name:r,phase:i,callback:s};o.push(a);const c=Bn(this._engine.statesByElement,t,new Map);return c.has(r)||(Yn(t,Op),Yn(t,Op+"-"+r),c.set(r,bb)),()=>{this._engine.afterFlush(()=>{const l=o.indexOf(a);l>=0&&o.splice(l,1),this._triggers.has(r)||c.delete(r)})}}register(t,r){return!this._triggers.has(t)&&(this._triggers.set(t,r),!0)}_getTrigger(t){const r=this._triggers.get(t);if(!r)throw function ZX(e){return new M(3401,!1)}();return r}trigger(t,r,i,s=!0){const o=this._getTrigger(r),a=new Eb(this.id,r,t);let c=this._engine.statesByElement.get(t);c||(Yn(t,Op),Yn(t,Op+"-"+r),this._engine.statesByElement.set(t,c=new Map));let l=c.get(r);const u=new _b(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&u.absorbOptions(l.options),c.set(r,u),l||(l=bb),u.value!==Uu&&l.value===u.value){if(!function Qee(e,t){const r=Object.keys(e),i=Object.keys(t);if(r.length!=i.length)return!1;for(let s=0;s{ho(t,y),ri(t,v)})}return}const h=Bn(this._engine.playersByElement,t,[]);h.forEach(m=>{m.namespaceId==this.id&&m.triggerName==r&&m.queued&&m.destroy()});let p=o.matchTransition(l.value,u.value,t,u.params),g=!1;if(!p){if(!s)return;p=o.fallbackTransition,g=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:r,transition:p,fromState:l,toState:u,player:a,isFallbackTransition:g}),g||(Yn(t,qO),a.onStart(()=>{hc(t,qO)})),a.onDone(()=>{let m=this.players.indexOf(a);m>=0&&this.players.splice(m,1);const y=this._engine.playersByElement.get(t);if(y){let v=y.indexOf(a);v>=0&&y.splice(v,1)}}),this.players.push(a),h.push(a),a}deregister(t){this._triggers.delete(t),this._engine.statesByElement.forEach(r=>r.delete(t)),this._elementListeners.forEach((r,i)=>{this._elementListeners.set(i,r.filter(s=>s.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);const r=this._engine.playersByElement.get(t);r&&(r.forEach(i=>i.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,r){const i=this._engine.driver.query(t,kp,!0);i.forEach(s=>{if(s[_r])return;const o=this._engine.fetchNamespacesByElement(s);o.size?o.forEach(a=>a.triggerLeaveAnimation(s,r,!1,!0)):this.clearElementCache(s)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(s=>this.clearElementCache(s)))}triggerLeaveAnimation(t,r,i,s){const o=this._engine.statesByElement.get(t),a=new Map;if(o){const c=[];if(o.forEach((l,u)=>{if(a.set(u,l.value),this._triggers.has(u)){const d=this.trigger(t,u,Uu,s);d&&c.push(d)}}),c.length)return this._engine.markElementAsRemoved(this.id,t,!0,r,a),i&&bs(c).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){const r=this._elementListeners.get(t),i=this._engine.statesByElement.get(t);if(r&&i){const s=new Set;r.forEach(o=>{const a=o.name;if(s.has(a))return;s.add(a);const l=this._triggers.get(a).fallbackTransition,u=i.get(a)||bb,d=new _b(Uu),f=new Eb(this.id,a,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:a,transition:l,fromState:u,toState:d,player:f,isFallbackTransition:!0})})}}removeNode(t,r){const i=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,r),this.triggerLeaveAnimation(t,r,!0))return;let s=!1;if(i.totalAnimations){const o=i.players.length?i.playersByQueriedElement.get(t):[];if(o&&o.length)s=!0;else{let a=t;for(;a=a.parentNode;)if(i.statesByElement.get(a)){s=!0;break}}}if(this.prepareLeaveAnimationListeners(t),s)i.markElementAsRemoved(this.id,t,!1,r);else{const o=t[_r];(!o||o===GO)&&(i.afterFlush(()=>this.clearElementCache(t)),i.destroyInnerAnimations(t),i._onRemovalComplete(t,r))}}insertNode(t,r){Yn(t,this._hostClassName)}drainQueuedTransitions(t){const r=[];return this._queue.forEach(i=>{const s=i.player;if(s.destroyed)return;const o=i.element,a=this._elementListeners.get(o);a&&a.forEach(c=>{if(c.name==i.triggerName){const l=nb(o,i.triggerName,i.fromState.value,i.toState.value);l._data=t,eb(i.player,c.phase,l,c.callback)}}),s.markedForDestroy?this._engine.afterFlush(()=>{s.destroy()}):r.push(i)}),this._queue=[],r.sort((i,s)=>{const o=i.transition.ast.depCount,a=s.transition.ast.depCount;return 0==o||0==a?o-a:this._engine.driver.containsElement(i.element,s.element)?1:-1})}destroy(t){this.players.forEach(r=>r.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}}class zee{_onRemovalComplete(t,r){this.onRemovalComplete(t,r)}constructor(t,r,i,s){this.bodyNode=t,this.driver=r,this._normalizer=i,this.scheduler=s,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=(o,a)=>{}}get queuedPlayers(){const t=[];return this._namespaceList.forEach(r=>{r.players.forEach(i=>{i.queued&&t.push(i)})}),t}createNamespace(t,r){const i=new Hee(t,r,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,r)?this._balanceNamespaceList(i,r):(this.newHostElements.set(r,i),this.collectEnterElement(r)),this._namespaceLookup[t]=i}_balanceNamespaceList(t,r){const i=this._namespaceList,s=this.namespacesByHostElement;if(i.length-1>=0){let a=!1,c=this.driver.getParentElement(r);for(;c;){const l=s.get(c);if(l){const u=i.indexOf(l);i.splice(u+1,0,t),a=!0;break}c=this.driver.getParentElement(c)}a||i.unshift(t)}else i.push(t);return s.set(r,t),t}register(t,r){let i=this._namespaceLookup[t];return i||(i=this.createNamespace(t,r)),i}registerTrigger(t,r,i){let s=this._namespaceLookup[t];s&&s.register(r,i)&&this.totalAnimations++}destroy(t,r){t&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{const i=this._fetchNamespace(t);this.namespacesByHostElement.delete(i.hostElement);const s=this._namespaceList.indexOf(i);s>=0&&this._namespaceList.splice(s,1),i.destroy(r),delete this._namespaceLookup[t]}))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){const r=new Set,i=this.statesByElement.get(t);if(i)for(let s of i.values())if(s.namespaceId){const o=this._fetchNamespace(s.namespaceId);o&&r.add(o)}return r}trigger(t,r,i,s){if(Vp(r)){const o=this._fetchNamespace(t);if(o)return o.trigger(r,i,s),!0}return!1}insertNode(t,r,i,s){if(!Vp(r))return;const o=r[_r];if(o&&o.setForRemoval){o.setForRemoval=!1,o.setForMove=!0;const a=this.collectedLeaveElements.indexOf(r);a>=0&&this.collectedLeaveElements.splice(a,1)}if(t){const a=this._fetchNamespace(t);a&&a.insertNode(r,i)}s&&this.collectEnterElement(r)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,r){r?this.disabledNodes.has(t)||(this.disabledNodes.add(t),Yn(t,wb)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),hc(t,wb))}removeNode(t,r,i){if(Vp(r)){this.scheduler?.notify();const s=t?this._fetchNamespace(t):null;s?s.removeNode(r,i):this.markElementAsRemoved(t,r,!1,i);const o=this.namespacesByHostElement.get(r);o&&o.id!==t&&o.removeNode(r,i)}else this._onRemovalComplete(r,i)}markElementAsRemoved(t,r,i,s,o){this.collectedLeaveElements.push(r),r[_r]={namespaceId:t,setForRemoval:s,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:o}}listen(t,r,i,s,o){return Vp(r)?this._fetchNamespace(t).listen(r,i,s,o):()=>{}}_buildInstruction(t,r,i,s,o){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,i,s,t.fromState.options,t.toState.options,r,o)}destroyInnerAnimations(t){let r=this.driver.query(t,kp,!0);r.forEach(i=>this.destroyActiveAnimationsForElement(i)),0!=this.playersByQueriedElement.size&&(r=this.driver.query(t,cb,!0),r.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(t){const r=this.playersByElement.get(t);r&&r.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(t){const r=this.playersByQueriedElement.get(t);r&&r.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return bs(this.players).onDone(()=>t());t()})}processLeaveNode(t){const r=t[_r];if(r&&r.setForRemoval){if(t[_r]=GO,r.namespaceId){this.destroyInnerAnimations(t);const i=this._fetchNamespace(r.namespaceId);i&&i.clearElementCache(t)}this._onRemovalComplete(t,r.setForRemoval)}t.classList?.contains(wb)&&this.markElementAsDisabled(t,!1),this.driver.query(t,".ng-animate-disabled",!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(t=-1){let r=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,s)=>this._balanceNamespaceList(i,s)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){const i=this._whenQuietFns;this._whenQuietFns=[],r.length?bs(r).onDone(()=>{i.forEach(s=>s())}):i.forEach(s=>s())}}reportError(t){throw function KX(e){return new M(3402,!1)}()}_flushAnimations(t,r){const i=new Up,s=[],o=new Map,a=[],c=new Map,l=new Map,u=new Map,d=new Set;this.disabledNodes.forEach(E=>{d.add(E);const x=this.driver.query(E,".ng-animate-queued",!0);for(let R=0;R{const R=ab+m++;g.set(x,R),E.forEach(A=>Yn(A,R))});const y=[],v=new Set,w=new Set;for(let E=0;Ev.add(A)):w.add(x))}const _=new Map,b=KO(h,Array.from(v));b.forEach((E,x)=>{const R=Rp+m++;_.set(x,R),E.forEach(A=>Yn(A,R))}),t.push(()=>{p.forEach((E,x)=>{const R=g.get(x);E.forEach(A=>hc(A,R))}),b.forEach((E,x)=>{const R=_.get(x);E.forEach(A=>hc(A,R))}),y.forEach(E=>{this.processLeaveNode(E)})});const C=[],D=[];for(let E=this._namespaceList.length-1;E>=0;E--)this._namespaceList[E].drainQueuedTransitions(r).forEach(R=>{const A=R.player,H=R.element;if(C.push(A),this.collectedEnterElements.length){const Se=H[_r];if(Se&&Se.setForMove){if(Se.previousTriggersValues&&Se.previousTriggersValues.has(R.triggerName)){const tt=Se.previousTriggersValues.get(R.triggerName),Ae=this.statesByElement.get(R.element);if(Ae&&Ae.has(R.triggerName)){const Cn=Ae.get(R.triggerName);Cn.value=tt,Ae.set(R.triggerName,Cn)}}return void A.destroy()}}const Q=!f||!this.driver.containsElement(f,H),J=_.get(H),_e=g.get(H),le=this._buildInstruction(R,i,_e,J,Q);if(le.errors&&le.errors.length)return void D.push(le);if(Q)return A.onStart(()=>ho(H,le.fromStyles)),A.onDestroy(()=>ri(H,le.toStyles)),void s.push(A);if(R.isFallbackTransition)return A.onStart(()=>ho(H,le.fromStyles)),A.onDestroy(()=>ri(H,le.toStyles)),void s.push(A);const lt=[];le.timelines.forEach(Se=>{Se.stretchStartingKeyframe=!0,this.disabledNodes.has(Se.element)||lt.push(Se)}),le.timelines=lt,i.append(H,le.timelines),a.push({instruction:le,player:A,element:H}),le.queriedElements.forEach(Se=>Bn(c,Se,[]).push(A)),le.preStyleProps.forEach((Se,tt)=>{if(Se.size){let Ae=l.get(tt);Ae||l.set(tt,Ae=new Set),Se.forEach((Cn,Bt)=>Ae.add(Bt))}}),le.postStyleProps.forEach((Se,tt)=>{let Ae=u.get(tt);Ae||u.set(tt,Ae=new Set),Se.forEach((Cn,Bt)=>Ae.add(Bt))})});if(D.length){const E=[];D.forEach(x=>{E.push(function QX(e,t){return new M(3505,!1)}())}),C.forEach(x=>x.destroy()),this.reportError(E)}const S=new Map,T=new Map;a.forEach(E=>{const x=E.element;i.has(x)&&(T.set(x,x),this._beforeAnimationBuild(E.player.namespaceId,E.instruction,S))}),s.forEach(E=>{const x=E.element;this._getPreviousPlayers(x,!1,E.namespaceId,E.triggerName,null).forEach(A=>{Bn(S,x,[]).push(A),A.destroy()})});const O=y.filter(E=>YO(E,l,u)),U=new Map;ZO(U,this.driver,w,u,Pi).forEach(E=>{YO(E,l,u)&&O.push(E)});const j=new Map;p.forEach((E,x)=>{ZO(j,this.driver,new Set(E),l,"!")}),O.forEach(E=>{const x=U.get(E),R=j.get(E);U.set(E,new Map([...x?.entries()??[],...R?.entries()??[]]))});const Y=[],k=[],I={};a.forEach(E=>{const{element:x,player:R,instruction:A}=E;if(i.has(x)){if(d.has(x))return R.onDestroy(()=>ri(x,A.toStyles)),R.disabled=!0,R.overrideTotalTime(A.totalTime),void s.push(R);let H=I;if(T.size>1){let J=x;const _e=[];for(;J=J.parentNode;){const le=T.get(J);if(le){H=le;break}_e.push(J)}_e.forEach(le=>T.set(le,H))}const Q=this._buildAnimation(R.namespaceId,A,S,o,j,U);if(R.setRealPlayer(Q),H===I)Y.push(R);else{const J=this.playersByElement.get(H);J&&J.length&&(R.parentPlayer=bs(J)),s.push(R)}}else ho(x,A.fromStyles),R.onDestroy(()=>ri(x,A.toStyles)),k.push(R),d.has(x)&&s.push(R)}),k.forEach(E=>{const x=o.get(E.element);if(x&&x.length){const R=bs(x);E.setRealPlayer(R)}}),s.forEach(E=>{E.parentPlayer?E.syncPlayerEvents(E.parentPlayer):E.destroy()});for(let E=0;E!Q.destroyed);H.length?Zee(this,x,H):this.processLeaveNode(x)}return y.length=0,Y.forEach(E=>{this.players.push(E),E.onDone(()=>{E.destroy();const x=this.players.indexOf(E);this.players.splice(x,1)}),E.play()}),Y}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,r,i,s,o){let a=[];if(r){const c=this.playersByQueriedElement.get(t);c&&(a=c)}else{const c=this.playersByElement.get(t);if(c){const l=!o||o==Uu;c.forEach(u=>{u.queued||!l&&u.triggerName!=s||a.push(u)})}}return(i||s)&&(a=a.filter(c=>!(i&&i!=c.namespaceId||s&&s!=c.triggerName))),a}_beforeAnimationBuild(t,r,i){const o=r.element,a=r.isRemovalTransition?void 0:t,c=r.isRemovalTransition?void 0:r.triggerName;for(const l of r.timelines){const u=l.element,d=u!==o,f=Bn(i,u,[]);this._getPreviousPlayers(u,d,a,c,r.toState).forEach(p=>{const g=p.getRealPlayer();g.beforeDestroy&&g.beforeDestroy(),p.destroy(),f.push(p)})}ho(o,r.fromStyles)}_buildAnimation(t,r,i,s,o,a){const c=r.triggerName,l=r.element,u=[],d=new Set,f=new Set,h=r.timelines.map(g=>{const m=g.element;d.add(m);const y=m[_r];if(y&&y.removedBeforeQueried)return new Lu(g.duration,g.delay);const v=m!==l,w=function Kee(e){const t=[];return QO(e,t),t}((i.get(m)||$ee).map(S=>S.getRealPlayer())).filter(S=>!!S.element&&S.element===m),_=o.get(m),b=a.get(m),C=TO(this._normalizer,g.keyframes,_,b),D=this._buildPlayer(g,C,w);if(g.subTimeline&&s&&f.add(m),v){const S=new Eb(t,c,m);S.setRealPlayer(D),u.push(S)}return D});u.forEach(g=>{Bn(this.playersByQueriedElement,g.element,[]).push(g),g.onDone(()=>function qee(e,t,r){let i=e.get(t);if(i){if(i.length){const s=i.indexOf(r);i.splice(s,1)}0==i.length&&e.delete(t)}return i}(this.playersByQueriedElement,g.element,g))}),d.forEach(g=>Yn(g,OO));const p=bs(h);return p.onDestroy(()=>{d.forEach(g=>hc(g,OO)),ri(l,r.toStyles)}),f.forEach(g=>{Bn(s,g,[]).push(p)}),p}_buildPlayer(t,r,i){return r.length>0?this.driver.animate(t.element,r,t.duration,t.delay,t.easing,i):new Lu(t.duration,t.delay)}}class Eb{constructor(t,r,i){this.namespaceId=t,this.triggerName=r,this.element=i,this._player=new Lu,this._containsRealPlayer=!1,this._queuedCallbacks=new Map,this.destroyed=!1,this.parentPlayer=null,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}setRealPlayer(t){this._containsRealPlayer||(this._player=t,this._queuedCallbacks.forEach((r,i)=>{r.forEach(s=>eb(t,i,void 0,s))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){const r=this._player;r.triggerCallback&&t.onStart(()=>r.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,r){Bn(this._queuedCallbacks,t,[]).push(r)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return!this.queued&&this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){const r=this._player;r.triggerCallback&&r.triggerCallback(t)}}function Vp(e){return e&&1===e.nodeType}function WO(e,t){const r=e.style.display;return e.style.display=t??"none",r}function ZO(e,t,r,i,s){const o=[];r.forEach(l=>o.push(WO(l)));const a=[];i.forEach((l,u)=>{const d=new Map;l.forEach(f=>{const h=t.computeStyle(u,f,s);d.set(f,h),(!h||0==h.length)&&(u[_r]=Vee,a.push(u))}),e.set(u,d)});let c=0;return r.forEach(l=>WO(l,o[c++])),a}function KO(e,t){const r=new Map;if(e.forEach(c=>r.set(c,[])),0==t.length)return r;const s=new Set(t),o=new Map;function a(c){if(!c)return 1;let l=o.get(c);if(l)return l;const u=c.parentNode;return l=r.has(u)?u:s.has(u)?1:a(u),o.set(c,l),l}return t.forEach(c=>{const l=a(c);1!==l&&r.get(l).push(c)}),r}function Yn(e,t){e.classList?.add(t)}function hc(e,t){e.classList?.remove(t)}function Zee(e,t,r){bs(r).onDone(()=>e.processLeaveNode(t))}function QO(e,t){for(let r=0;rs.add(o)):t.set(e,i),r.delete(e),!0}class ju{constructor(t,r,i,s){this._driver=r,this._normalizer=i,this._triggerCache={},this.onRemovalComplete=(o,a)=>{},this._transitionEngine=new zee(t.body,r,i,s),this._timelineEngine=new Lee(t.body,r,i),this._transitionEngine.onRemovalComplete=(o,a)=>this.onRemovalComplete(o,a)}registerTrigger(t,r,i,s,o){const a=t+"-"+s;let c=this._triggerCache[a];if(!c){const l=[],d=hb(this._driver,o,l,[]);if(l.length)throw function UX(e,t){return new M(3404,!1)}();c=function Ree(e,t,r){return new Oee(e,t,r)}(s,d,this._normalizer),this._triggerCache[a]=c}this._transitionEngine.registerTrigger(r,s,c)}register(t,r){this._transitionEngine.register(t,r)}destroy(t,r){this._transitionEngine.destroy(t,r)}onInsert(t,r,i,s){this._transitionEngine.insertNode(t,r,i,s)}onRemove(t,r,i){this._transitionEngine.removeNode(t,r,i)}disableAnimations(t,r){this._transitionEngine.markElementAsDisabled(t,r)}process(t,r,i,s){if("@"==i.charAt(0)){const[o,a]=xO(i);this._timelineEngine.command(o,r,a,s)}else this._transitionEngine.trigger(t,r,i,s)}listen(t,r,i,s,o){if("@"==i.charAt(0)){const[a,c]=xO(i);return this._timelineEngine.listen(a,r,c,o)}return this._transitionEngine.listen(t,r,i,s,o)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(t){this._transitionEngine.afterFlushAnimationsDone(t)}}class $u{static#e=this.initialStylesByElement=new WeakMap;constructor(t,r,i){this._element=t,this._startStyles=r,this._endStyles=i,this._state=0;let s=$u.initialStylesByElement.get(t);s||$u.initialStylesByElement.set(t,s=new Map),this._initialStyles=s}start(){this._state<1&&(this._startStyles&&ri(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(ri(this._element,this._initialStyles),this._endStyles&&(ri(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&($u.initialStylesByElement.delete(this._element),this._startStyles&&(ho(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(ho(this._element,this._endStyles),this._endStyles=null),ri(this._element,this._initialStyles),this._state=3)}}function Db(e){let t=null;return e.forEach((r,i)=>{(function Jee(e){return"display"===e||"position"===e})(i)&&(t=t||new Map,t.set(i,r))}),t}class JO{constructor(t,r,i,s){this.element=t,this.keyframes=r,this.options=i,this._specialStyles=s,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this._originalOnDoneFns=[],this._originalOnStartFns=[],this.time=0,this.parentPlayer=null,this.currentSnapshot=new Map,this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;const t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:new Map;const r=()=>this._onFinish();this.domPlayer.addEventListener("finish",r),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",r)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(t){const r=[];return t.forEach(i=>{r.push(Object.fromEntries(i))}),r}_triggerWebAnimation(t,r,i){return t.animate(this._convertKeyframesToObject(r),i)}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){void 0===this.domPlayer&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){const t=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,s)=>{"offset"!==s&&t.set(s,this._finished?i:fb(this.element,s))}),this.currentSnapshot=t}triggerCallback(t){const r="start"===t?this._onStartFns:this._onDoneFns;r.forEach(i=>i()),r.length=0}}class XO{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}matchesElement(t,r){return!1}containsElement(t,r){return MO(t,r)}getParentElement(t){return rb(t)}query(t,r,i){return NO(t,r,i)}computeStyle(t,r,i){return fb(t,r)}animate(t,r,i,s,o,a=[]){const l={duration:i,delay:s,fill:0==s?"both":"forwards"};o&&(l.easing=o);const u=new Map,d=a.filter(p=>p instanceof JO);(function lee(e,t){return 0===e||0===t})(i,s)&&d.forEach(p=>{p.currentSnapshot.forEach((g,m)=>u.set(m,g))});let f=function oee(e){return e.length?e[0]instanceof Map?e:e.map(t=>new Map(Object.entries(t))):[]}(r).map(p=>new Map(p));f=function uee(e,t,r){if(r.size&&t.length){let i=t[0],s=[];if(r.forEach((o,a)=>{i.has(a)||s.push(a),i.set(a,o)}),s.length)for(let o=1;oa.set(c,fb(e,c)))}}return t}(t,f,u);const h=function Yee(e,t){let r=null,i=null;return Array.isArray(t)&&t.length?(r=Db(t[0]),t.length>1&&(i=Db(t[t.length-1]))):t instanceof Map&&(r=Db(t)),r||i?new $u(e,r,i):null}(t,f);return new JO(t,f,l,h)}}const ek="@.disabled";class tk{constructor(t,r,i,s){this.namespaceId=t,this.delegate=r,this.engine=i,this._onDestroy=s,this.\u0275type=0}get data(){return this.delegate.data}destroyNode(t){this.delegate.destroyNode?.(t)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(t,r){return this.delegate.createElement(t,r)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,r){this.delegate.appendChild(t,r),this.engine.onInsert(this.namespaceId,r,t,!1)}insertBefore(t,r,i,s=!0){this.delegate.insertBefore(t,r,i),this.engine.onInsert(this.namespaceId,r,t,s)}removeChild(t,r,i){this.engine.onRemove(this.namespaceId,r,this.delegate)}selectRootElement(t,r){return this.delegate.selectRootElement(t,r)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,r,i,s){this.delegate.setAttribute(t,r,i,s)}removeAttribute(t,r,i){this.delegate.removeAttribute(t,r,i)}addClass(t,r){this.delegate.addClass(t,r)}removeClass(t,r){this.delegate.removeClass(t,r)}setStyle(t,r,i,s){this.delegate.setStyle(t,r,i,s)}removeStyle(t,r,i){this.delegate.removeStyle(t,r,i)}setProperty(t,r,i){"@"==r.charAt(0)&&r==ek?this.disableAnimations(t,!!i):this.delegate.setProperty(t,r,i)}setValue(t,r){this.delegate.setValue(t,r)}listen(t,r,i){return this.delegate.listen(t,r,i)}disableAnimations(t,r){this.engine.disableAnimations(t,r)}}class Xee extends tk{constructor(t,r,i,s,o){super(r,i,s,o),this.factory=t,this.namespaceId=r}setProperty(t,r,i){"@"==r.charAt(0)?"."==r.charAt(1)&&r==ek?this.disableAnimations(t,i=void 0===i||!!i):this.engine.process(this.namespaceId,t,r.slice(1),i):this.delegate.setProperty(t,r,i)}listen(t,r,i){if("@"==r.charAt(0)){const s=function ete(e){switch(e){case"body":return document.body;case"document":return document;case"window":return window;default:return e}}(t);let o=r.slice(1),a="";return"@"!=o.charAt(0)&&([o,a]=function tte(e){const t=e.indexOf(".");return[e.substring(0,t),e.slice(t+1)]}(o)),this.engine.listen(this.namespaceId,s,o,a,c=>{this.factory.scheduleListenerCallback(c._data||-1,i,c)})}return this.delegate.listen(t,r,i)}}class nte{constructor(t,r,i){this.delegate=t,this.engine=r,this._zone=i,this._currentId=0,this._microtaskId=1,this._animationCallbacksBuffer=[],this._rendererCache=new Map,this._cdRecurDepth=0,r.onRemovalComplete=(s,o)=>{const a=o?.parentNode(s);a&&o.removeChild(a,s)}}createRenderer(t,r){const s=this.delegate.createRenderer(t,r);if(!t||!r?.data?.animation){const u=this._rendererCache;let d=u.get(s);return d||(d=new tk("",s,this.engine,()=>u.delete(s)),u.set(s,d)),d}const o=r.id,a=r.id+"-"+this._currentId;this._currentId++,this.engine.register(a,t);const c=u=>{Array.isArray(u)?u.forEach(c):this.engine.registerTrigger(o,a,t,u.name,u)};return r.data.animation.forEach(c),new Xee(this,a,s,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(t,r,i){if(t>=0&&tr(i));const s=this._animationCallbacksBuffer;0==s.length&&queueMicrotask(()=>{this._zone.run(()=>{s.forEach(o=>{const[a,c]=o;a(c)}),this._animationCallbacksBuffer=[]})}),s.push([r,i])}end(){this._cdRecurDepth--,0==this._cdRecurDepth&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}}let rte=(()=>{class e extends ju{constructor(r,i,s){super(r,i,s,P(sf,{optional:!0}))}ngOnDestroy(){this.flush()}static#e=this.\u0275fac=function(i){return new(i||e)(G(Wt),G(sb),G(ob))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac})}return e})();const nk=[{provide:ob,useFactory:function ite(){return new LO}},{provide:ju,useClass:rte},{provide:sy,useFactory:function ste(e,t,r){return new nte(e,t,r)},deps:[Gv,ju,Ne]}],Cb=[{provide:sb,useFactory:()=>new XO},{provide:VD,useValue:"BrowserAnimations"},...nk],rk=[{provide:sb,useClass:ib},{provide:VD,useValue:"NoopAnimations"},...nk];let ote=(()=>{class e{static withConfig(r){return{ngModule:e,providers:r.disableAnimations?rk:Cb}}static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({providers:Cb,imports:[vA]})}return e})(),ik=(()=>{class e extends $n{constructor(r){super(),this.error$=r}handleError(r){/^AbortError/.test(String(r))||(r.errors&&r.errors.length?r.errors.forEach(i=>{console.error((new Date).toLocaleString(),i.message),this.error$.next(i.message)}):r.message?(console.error((new Date).toLocaleString(),r.message),this.error$.next(r.message)):(console.error((new Date).toLocaleString(),"application throw unkown error"),this.error$.next("application throw unkown error")))}static#e=this.\u0275fac=function(i){return new(i||e)(G(Q_))};static#t=this.\u0275prov=z({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),ate=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e});static#r=this.\u0275inj=Jt({providers:[Q_,ik,{provide:$n,useClass:ik}],imports:[Ea,ote]})}return e})(),cte=(()=>{class e{static#e=this.\u0275fac=function(i){return new(i||e)};static#t=this.\u0275mod=pn({type:e,bootstrap:[gX]});static#r=this.\u0275inj=Jt({imports:[mX,vA,jJ,PH,NK,yX,pX.forRoot({timeOut:1e4,positionClass:"toast-top-center",preventDuplicates:!0}),ate]})}return e})();xH().bootstrapModule(cte).catch(e=>console.error(e))}},zp=>{zp(zp.s=45)}]); \ No newline at end of file diff --git a/docs/polyfills.86aad890f66d0367.js b/docs/polyfills.86aad890f66d0367.js old mode 100755 new mode 100644 diff --git a/docs/runtime.645a1d1273ec4f99.js b/docs/runtime.645a1d1273ec4f99.js old mode 100755 new mode 100644 diff --git a/docs/styles.11670243d57fb449.css b/docs/styles.11670243d57fb449.css deleted file mode 100755 index 70b2c1c..0000000 --- a/docs/styles.11670243d57fb449.css +++ /dev/null @@ -1 +0,0 @@ -*,*:before,*:after{margin:0;padding:0;box-sizing:inherit}html{box-sizing:border-box;font-size:62.5%}body{font-family:sans-serif;font-weight:400;line-height:1.6;background-color:#fff7ee;height:100vh}.navbar{display:flex;align-items:center;height:12%;box-shadow:0 .2rem 1rem #0000001a;background-color:#fff;padding:1rem}.logo{height:20rem}.description{font-size:2.7rem;margin-left:8rem;margin-top:1rem;transform:rotate(-6deg)}.online{margin-left:auto;margin-right:1rem;font-size:2.7rem;color:#6cb5ff}.main{padding:1rem;display:flex;flex-direction:column;height:88%}.conversation{height:83%;background-color:#fff;border:1px solid #cccccc;border-top-left-radius:7px;border-top-right-radius:7px;padding:1.5rem;font-size:2rem;word-break:break-word;overflow-y:auto}.message{font-size:2rem;font-weight:700;color:#565656;margin-bottom:.7rem}.chat{margin-bottom:.7rem}.authorStranger{color:#ff0101;font-weight:700}.authorYou{color:#0101ff;font-weight:700}.form{height:17%;margin-top:1rem;display:grid;grid-template-columns:15rem 1fr 15rem;gap:1rem}.btn{height:100%;color:#121830;background-color:#fff;font-size:3rem;border:1px solid #cccccc;cursor:pointer}.btn:focus{outline:none}.btn:disabled{color:#999;cursor:default;background-color:#efefef4d}.bottomLeftRadius{border-bottom-left-radius:7px}.bottomRightRadius{border-bottom-right-radius:7px}.start:focus{outline:none}.textarea{height:100%;resize:none;font-family:inherit;font-size:2rem;border:1px solid #cccccc;padding:20px 15px}.textarea:focus{outline:none}.hide{display:none}.bold{font-weight:700}@media only screen and (max-width: 56.25em){.description{margin-left:6rem;font-size:2rem}.online{font-size:2rem}}@media only screen and (max-width: 48.125em){.online{display:none}}@media only screen and (max-width: 43.75em){.form{grid-template-columns:10rem 1fr 10rem}.btn{font-size:1.4rem}}@media only screen and (max-width: 31.25em){.conversation{height:90%}.form{height:10%;grid-template-columns:7rem 1fr 7rem}.btn{font-size:1.2rem}}@media only screen and (max-width: 32.5em){.description{display:none}}@media only screen and (max-width: 28.125em){.logo{height:12rem}}.toast-center-center{top:50%;left:50%;transform:translate(-50%,-50%)}.toast-top-center{top:0;right:0;width:100%}.toast-bottom-center{bottom:0;right:0;width:100%}.toast-top-full-width{top:0;right:0;width:100%}.toast-bottom-full-width{bottom:0;right:0;width:100%}.toast-top-left{top:12px;left:12px}.toast-top-right{top:12px;right:12px}.toast-bottom-right{right:12px;bottom:12px}.toast-bottom-left{bottom:12px;left:12px}.toast-title{font-weight:700}.toast-message{word-wrap:break-word}.toast-message a,.toast-message label{color:#fff}.toast-message a:hover{color:#ccc;text-decoration:none}.toast-close-button{position:relative;right:-.3em;top:-.3em;float:right;font-size:20px;font-weight:700;color:#fff;text-shadow:0 1px 0 #ffffff}.toast-close-button:hover,.toast-close-button:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.4}button.toast-close-button{padding:0;cursor:pointer;background:transparent;border:0}.toast-container{pointer-events:none;position:fixed;z-index:999999}.toast-container *{box-sizing:border-box}.toast-container .ngx-toastr{position:relative;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 50px;width:300px;border-radius:3px;background-position:15px center;background-repeat:no-repeat;background-size:24px;box-shadow:0 0 12px #999;color:#fff}.toast-container .ngx-toastr:hover{box-shadow:0 0 12px #000;opacity:1;cursor:pointer}.toast-info{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTI1NiA4QzExOS4wNDMgOCA4IDExOS4wODMgOCAyNTZjMCAxMzYuOTk3IDExMS4wNDMgMjQ4IDI0OCAyNDhzMjQ4LTExMS4wMDMgMjQ4LTI0OEM1MDQgMTE5LjA4MyAzOTIuOTU3IDggMjU2IDh6bTAgMTEwYzIzLjE5NiAwIDQyIDE4LjgwNCA0MiA0MnMtMTguODA0IDQyLTQyIDQyLTQyLTE4LjgwNC00Mi00MiAxOC44MDQtNDIgNDItNDJ6bTU2IDI1NGMwIDYuNjI3LTUuMzczIDEyLTEyIDEyaC04OGMtNi42MjcgMC0xMi01LjM3My0xMi0xMnYtMjRjMC02LjYyNyA1LjM3My0xMiAxMi0xMmgxMnYtNjRoLTEyYy02LjYyNyAwLTEyLTUuMzczLTEyLTEydi0yNGMwLTYuNjI3IDUuMzczLTEyIDEyLTEyaDY0YzYuNjI3IDAgMTIgNS4zNzMgMTIgMTJ2MTAwaDEyYzYuNjI3IDAgMTIgNS4zNzMgMTIgMTJ2MjR6Jy8+PC9zdmc+)}.toast-error{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTI1NiA4QzExOSA4IDggMTE5IDggMjU2czExMSAyNDggMjQ4IDI0OCAyNDgtMTExIDI0OC0yNDhTMzkzIDggMjU2IDh6bTEyMS42IDMxMy4xYzQuNyA0LjcgNC43IDEyLjMgMCAxN0wzMzggMzc3LjZjLTQuNyA0LjctMTIuMyA0LjctMTcgMEwyNTYgMzEybC02NS4xIDY1LjZjLTQuNyA0LjctMTIuMyA0LjctMTcgMEwxMzQuNCAzMzhjLTQuNy00LjctNC43LTEyLjMgMC0xN2w2NS42LTY1LTY1LjYtNjUuMWMtNC43LTQuNy00LjctMTIuMyAwLTE3bDM5LjYtMzkuNmM0LjctNC43IDEyLjMtNC43IDE3IDBsNjUgNjUuNyA2NS4xLTY1LjZjNC43LTQuNyAxMi4zLTQuNyAxNyAwbDM5LjYgMzkuNmM0LjcgNC43IDQuNyAxMi4zIDAgMTdMMzEyIDI1Nmw2NS42IDY1LjF6Jy8+PC9zdmc+)}.toast-success{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTE3My44OTggNDM5LjQwNGwtMTY2LjQtMTY2LjRjLTkuOTk3LTkuOTk3LTkuOTk3LTI2LjIwNiAwLTM2LjIwNGwzNi4yMDMtMzYuMjA0YzkuOTk3LTkuOTk4IDI2LjIwNy05Ljk5OCAzNi4yMDQgMEwxOTIgMzEyLjY5IDQzMi4wOTUgNzIuNTk2YzkuOTk3LTkuOTk3IDI2LjIwNy05Ljk5NyAzNi4yMDQgMGwzNi4yMDMgMzYuMjA0YzkuOTk3IDkuOTk3IDkuOTk3IDI2LjIwNiAwIDM2LjIwNGwtMjk0LjQgMjk0LjQwMWMtOS45OTggOS45OTctMjYuMjA3IDkuOTk3LTM2LjIwNC0uMDAxeicvPjwvc3ZnPg==)}.toast-warning{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1NzYgNTEyJyB3aWR0aD0nNTc2JyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTU2OS41MTcgNDQwLjAxM0M1ODcuOTc1IDQ3Mi4wMDcgNTY0LjgwNiA1MTIgNTI3Ljk0IDUxMkg0OC4wNTRjLTM2LjkzNyAwLTU5Ljk5OS00MC4wNTUtNDEuNTc3LTcxLjk4N0wyNDYuNDIzIDIzLjk4NWMxOC40NjctMzIuMDA5IDY0LjcyLTMxLjk1MSA4My4xNTQgMGwyMzkuOTQgNDE2LjAyOHpNMjg4IDM1NGMtMjUuNDA1IDAtNDYgMjAuNTk1LTQ2IDQ2czIwLjU5NSA0NiA0NiA0NiA0Ni0yMC41OTUgNDYtNDYtMjAuNTk1LTQ2LTQ2LTQ2em0tNDMuNjczLTE2NS4zNDZsNy40MTggMTM2Yy4zNDcgNi4zNjQgNS42MDkgMTEuMzQ2IDExLjk4MiAxMS4zNDZoNDguNTQ2YzYuMzczIDAgMTEuNjM1LTQuOTgyIDExLjk4Mi0xMS4zNDZsNy40MTgtMTM2Yy4zNzUtNi44NzQtNS4wOTgtMTIuNjU0LTExLjk4Mi0xMi42NTRoLTYzLjM4M2MtNi44ODQgMC0xMi4zNTYgNS43OC0xMS45ODEgMTIuNjU0eicvPjwvc3ZnPg==)}.toast-container.toast-top-center .ngx-toastr,.toast-container.toast-bottom-center .ngx-toastr{width:300px;margin-left:auto;margin-right:auto}.toast-container.toast-top-full-width .ngx-toastr,.toast-container.toast-bottom-full-width .ngx-toastr{width:96%;margin-left:auto;margin-right:auto}.ngx-toastr{background-color:#030303;pointer-events:auto}.toast-success{background-color:#51a351}.toast-error{background-color:#bd362f}.toast-info{background-color:#2f96b4}.toast-warning{background-color:#f89406}.toast-progress{position:absolute;left:0;bottom:0;height:4px;background-color:#000;opacity:.4}@media all and (max-width: 240px){.toast-container .ngx-toastr.div{padding:8px 8px 8px 50px;width:11em}.toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width: 241px) and (max-width: 480px){.toast-container .ngx-toastr.div{padding:8px 8px 8px 50px;width:18em}.toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width: 481px) and (max-width: 768px){.toast-container .ngx-toastr.div{padding:15px 15px 15px 50px;width:25em}} diff --git a/docs/styles.3a6a16594c23fc66.css b/docs/styles.3a6a16594c23fc66.css new file mode 100644 index 0000000..1b7d572 --- /dev/null +++ b/docs/styles.3a6a16594c23fc66.css @@ -0,0 +1 @@ +*,*:before,*:after{margin:0;padding:0;box-sizing:inherit}html{box-sizing:border-box;font-size:62.5%}body{font-family:sans-serif;font-weight:400;line-height:1.6;background-color:#fff7ee;height:100vh}.navbar{display:flex;align-items:center;height:12%;box-shadow:0 .2rem 1rem #0000001a;background-color:#fff;padding:1rem}.logo{height:20rem}.description{font-size:2.7rem;margin-left:8rem;margin-top:1rem;transform:rotate(-6deg)}.online{margin-left:auto;margin-right:1rem;font-size:2.7rem;color:#6cb5ff}.main{padding:1rem;display:flex;flex-direction:column;height:88%}.conversation{height:83%;background-color:#fff;border:1px solid #cccccc;border-top-left-radius:7px;border-top-right-radius:7px;padding:1.5rem 1.5rem 2rem;font-size:2rem;word-break:break-word;overflow-y:auto}.message{font-size:2rem;font-weight:700;color:#565656;margin-bottom:.7rem}.chat{margin-bottom:.7rem}.authorStranger{color:#ff0101;font-weight:700}.authorYou{color:#0101ff;font-weight:700}.form{height:17%;margin-top:1rem;display:grid;grid-template-columns:15rem 1fr 15rem;gap:1rem}.btn{height:100%;color:#121830;background-color:#fff;font-size:3rem;border:1px solid #cccccc;cursor:pointer}.btn:focus{outline:none}.btn:disabled{color:#999;cursor:default;background-color:#efefef4d}.bottomLeftRadius{border-bottom-left-radius:7px}.bottomRightRadius{border-bottom-right-radius:7px}.start:focus{outline:none}.textarea{height:100%;resize:none;font-family:inherit;font-size:2rem;border:1px solid #cccccc;padding:20px 15px}.textarea:focus{outline:none}.hide{display:none}.bold{font-weight:700}@media only screen and (max-width: 56.25em){.description{margin-left:6rem;font-size:2rem}.online{font-size:2rem}}@media only screen and (max-width: 48.125em){.online{display:none}}@media only screen and (max-width: 43.75em){.form{grid-template-columns:10rem 1fr 10rem}.btn{font-size:1.4rem}}@media only screen and (max-width: 31.25em){.conversation{height:90%}.form{height:10%;grid-template-columns:7rem 1fr 7rem}.btn{font-size:1.2rem}}@media only screen and (max-width: 32.5em){.description{display:none}}@media only screen and (max-width: 28.125em){.logo{height:12rem}}.toast-center-center{top:50%;left:50%;transform:translate(-50%,-50%)}.toast-top-center{top:0;right:0;width:100%}.toast-bottom-center{bottom:0;right:0;width:100%}.toast-top-full-width{top:0;right:0;width:100%}.toast-bottom-full-width{bottom:0;right:0;width:100%}.toast-top-left{top:12px;left:12px}.toast-top-right{top:12px;right:12px}.toast-bottom-right{right:12px;bottom:12px}.toast-bottom-left{bottom:12px;left:12px}.toast-title{font-weight:700}.toast-message{word-wrap:break-word}.toast-message a,.toast-message label{color:#fff}.toast-message a:hover{color:#ccc;text-decoration:none}.toast-close-button{position:relative;right:-.3em;top:-.3em;float:right;font-size:20px;font-weight:700;color:#fff;text-shadow:0 1px 0 #ffffff}.toast-close-button:hover,.toast-close-button:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.4}button.toast-close-button{padding:0;cursor:pointer;background:transparent;border:0}.toast-container{pointer-events:none;position:fixed;z-index:999999}.toast-container *{box-sizing:border-box}.toast-container .ngx-toastr{position:relative;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 50px;width:300px;border-radius:3px;background-position:15px center;background-repeat:no-repeat;background-size:24px;box-shadow:0 0 12px #999;color:#fff}.toast-container .ngx-toastr:hover{box-shadow:0 0 12px #000;opacity:1;cursor:pointer}.toast-info{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTI1NiA4QzExOS4wNDMgOCA4IDExOS4wODMgOCAyNTZjMCAxMzYuOTk3IDExMS4wNDMgMjQ4IDI0OCAyNDhzMjQ4LTExMS4wMDMgMjQ4LTI0OEM1MDQgMTE5LjA4MyAzOTIuOTU3IDggMjU2IDh6bTAgMTEwYzIzLjE5NiAwIDQyIDE4LjgwNCA0MiA0MnMtMTguODA0IDQyLTQyIDQyLTQyLTE4LjgwNC00Mi00MiAxOC44MDQtNDIgNDItNDJ6bTU2IDI1NGMwIDYuNjI3LTUuMzczIDEyLTEyIDEyaC04OGMtNi42MjcgMC0xMi01LjM3My0xMi0xMnYtMjRjMC02LjYyNyA1LjM3My0xMiAxMi0xMmgxMnYtNjRoLTEyYy02LjYyNyAwLTEyLTUuMzczLTEyLTEydi0yNGMwLTYuNjI3IDUuMzczLTEyIDEyLTEyaDY0YzYuNjI3IDAgMTIgNS4zNzMgMTIgMTJ2MTAwaDEyYzYuNjI3IDAgMTIgNS4zNzMgMTIgMTJ2MjR6Jy8+PC9zdmc+)}.toast-error{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTI1NiA4QzExOSA4IDggMTE5IDggMjU2czExMSAyNDggMjQ4IDI0OCAyNDgtMTExIDI0OC0yNDhTMzkzIDggMjU2IDh6bTEyMS42IDMxMy4xYzQuNyA0LjcgNC43IDEyLjMgMCAxN0wzMzggMzc3LjZjLTQuNyA0LjctMTIuMyA0LjctMTcgMEwyNTYgMzEybC02NS4xIDY1LjZjLTQuNyA0LjctMTIuMyA0LjctMTcgMEwxMzQuNCAzMzhjLTQuNy00LjctNC43LTEyLjMgMC0xN2w2NS42LTY1LTY1LjYtNjUuMWMtNC43LTQuNy00LjctMTIuMyAwLTE3bDM5LjYtMzkuNmM0LjctNC43IDEyLjMtNC43IDE3IDBsNjUgNjUuNyA2NS4xLTY1LjZjNC43LTQuNyAxMi4zLTQuNyAxNyAwbDM5LjYgMzkuNmM0LjcgNC43IDQuNyAxMi4zIDAgMTdMMzEyIDI1Nmw2NS42IDY1LjF6Jy8+PC9zdmc+)}.toast-success{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTE3My44OTggNDM5LjQwNGwtMTY2LjQtMTY2LjRjLTkuOTk3LTkuOTk3LTkuOTk3LTI2LjIwNiAwLTM2LjIwNGwzNi4yMDMtMzYuMjA0YzkuOTk3LTkuOTk4IDI2LjIwNy05Ljk5OCAzNi4yMDQgMEwxOTIgMzEyLjY5IDQzMi4wOTUgNzIuNTk2YzkuOTk3LTkuOTk3IDI2LjIwNy05Ljk5NyAzNi4yMDQgMGwzNi4yMDMgMzYuMjA0YzkuOTk3IDkuOTk3IDkuOTk3IDI2LjIwNiAwIDM2LjIwNGwtMjk0LjQgMjk0LjQwMWMtOS45OTggOS45OTctMjYuMjA3IDkuOTk3LTM2LjIwNC0uMDAxeicvPjwvc3ZnPg==)}.toast-warning{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1NzYgNTEyJyB3aWR0aD0nNTc2JyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTU2OS41MTcgNDQwLjAxM0M1ODcuOTc1IDQ3Mi4wMDcgNTY0LjgwNiA1MTIgNTI3Ljk0IDUxMkg0OC4wNTRjLTM2LjkzNyAwLTU5Ljk5OS00MC4wNTUtNDEuNTc3LTcxLjk4N0wyNDYuNDIzIDIzLjk4NWMxOC40NjctMzIuMDA5IDY0LjcyLTMxLjk1MSA4My4xNTQgMGwyMzkuOTQgNDE2LjAyOHpNMjg4IDM1NGMtMjUuNDA1IDAtNDYgMjAuNTk1LTQ2IDQ2czIwLjU5NSA0NiA0NiA0NiA0Ni0yMC41OTUgNDYtNDYtMjAuNTk1LTQ2LTQ2LTQ2em0tNDMuNjczLTE2NS4zNDZsNy40MTggMTM2Yy4zNDcgNi4zNjQgNS42MDkgMTEuMzQ2IDExLjk4MiAxMS4zNDZoNDguNTQ2YzYuMzczIDAgMTEuNjM1LTQuOTgyIDExLjk4Mi0xMS4zNDZsNy40MTgtMTM2Yy4zNzUtNi44NzQtNS4wOTgtMTIuNjU0LTExLjk4Mi0xMi42NTRoLTYzLjM4M2MtNi44ODQgMC0xMi4zNTYgNS43OC0xMS45ODEgMTIuNjU0eicvPjwvc3ZnPg==)}.toast-container.toast-top-center .ngx-toastr,.toast-container.toast-bottom-center .ngx-toastr{width:300px;margin-left:auto;margin-right:auto}.toast-container.toast-top-full-width .ngx-toastr,.toast-container.toast-bottom-full-width .ngx-toastr{width:96%;margin-left:auto;margin-right:auto}.ngx-toastr{background-color:#030303;pointer-events:auto}.toast-success{background-color:#51a351}.toast-error{background-color:#bd362f}.toast-info{background-color:#2f96b4}.toast-warning{background-color:#f89406}.toast-progress{position:absolute;left:0;bottom:0;height:4px;background-color:#000;opacity:.4}@media all and (max-width: 240px){.toast-container .ngx-toastr.div{padding:8px 8px 8px 50px;width:11em}.toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width: 241px) and (max-width: 480px){.toast-container .ngx-toastr.div{padding:8px 8px 8px 50px;width:18em}.toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width: 481px) and (max-width: 768px){.toast-container .ngx-toastr.div{padding:15px 15px 15px 50px;width:25em}} diff --git a/package-lock.json b/package-lock.json index eb8fa4d..f6bd65a 100755 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "omeglestr", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "omeglestr", - "version": "0.1.0", + "version": "0.1.1", "license": "Ungovernable", "dependencies": { "@angular/animations": "^17.3.12", diff --git a/package.json b/package.json index e348e2f..9a34523 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "omeglestr", - "version": "0.1.0", + "version": "0.1.1", "author": "António Conselheiro", "license": "Ungovernable", "scripts": {