diff --git a/.prettierrc b/.prettierrc index ae90b6fa2..88258b260 100644 --- a/.prettierrc +++ b/.prettierrc @@ -9,5 +9,13 @@ "tabWidth": 4, "trailingComma": "es5", "useTabs": false, - "plugins": ["prettier-plugin-tailwindcss"] + "plugins": ["prettier-plugin-tailwindcss"], + "overrides": [ + { + "files": "suites-experimental/chat-room-angular/src/**/*.ts", + "options": { + "embeddedLanguageFormatting": "off" + } + } + ] } diff --git a/resources/benchmark-runner.mjs b/resources/benchmark-runner.mjs index f443ffed9..a582087d3 100644 --- a/resources/benchmark-runner.mjs +++ b/resources/benchmark-runner.mjs @@ -201,6 +201,26 @@ class PageElement { }; } + /** + * Scroll geometry, for steps that drive a scroller to an explicit offset. + * Never animate a scroll inside a measured step: assign an offset instead. + */ + get scrollTop() { + return this.#node.scrollTop; + } + + set scrollTop(offset) { + this.#node.scrollTop = offset; + } + + get scrollHeight() { + return this.#node.scrollHeight; + } + + get clientHeight() { + return this.#node.clientHeight; + } + dispatchEvent(eventName, options = NATIVE_OPTIONS, eventType = Event) { if (eventName === "submit") // FIXME FireFox doesn't like `new Event('submit') diff --git a/suites-experimental/chat-room-angular/.gitignore b/suites-experimental/chat-room-angular/.gitignore new file mode 100644 index 000000000..2eff3117a --- /dev/null +++ b/suites-experimental/chat-room-angular/.gitignore @@ -0,0 +1,20 @@ +node_modules + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +pnpm-debug.log* + +# dist-ssr / local +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.sw? +.angular diff --git a/suites-experimental/chat-room-angular/README.md b/suites-experimental/chat-room-angular/README.md new file mode 100644 index 000000000..99ad3967f --- /dev/null +++ b/suites-experimental/chat-room-angular/README.md @@ -0,0 +1,53 @@ +## Description + +An Angular port of the [ChatRoom-React](../chat-room/README.md) workload: the same +two-pane chat app, the same deterministic fixtures, the same windowed timeline, +and the same measured steps, so the three ports can be compared directly. + +`src/data/`, `src/row-heights.js` and `src/styles.css` are copies of the React +workload's files and should be kept in sync with them. `src/types.ts` describes +the shapes `src/data/rooms.js` builds. The components are standalone, OnPush, +signal-based components that render the same DOM as the React version, row for +row and pixel for pixel. Every component uses an attribute selector +(`li[chat-message]`, `ol[chat-timeline]`, ...) so that its host element _is_ the +element the other ports render, rather than a wrapper around it. + +## What are we testing + +The same interactions as ChatRoom-React (see its README), through Angular's +change detection instead of React's reconciliation: + +- Creating and destroying a large timeline view: a one-item `@for` tracked by + room id stands in for React's `key` +- `@for` diffing as the timeline window moves, with signal inputs on every row +- An `afterRenderEffect` that measures the mounted rows after each render and + corrects the scroll position, rerunning within the same tick until the + measurements settle, in place of React's `useLayoutEffect` loop + +## How are we testing + +The suite shares its steps (`ScrollTimeline`, `SwitchRooms`, +`LoadOlderMessages`) with ChatRoom-React, see `suites-experimental/suites.mjs`. + +The app uses zone.js rather than zoneless change detection. The steps yield a +MessageChannel task between interactions and expect each update to have rendered +by then, which holds for React and Svelte. Zoneless Angular renders in a +setTimeout/requestAnimationFrame race instead, and in Firefox that regularly +lands after the yield, so consecutive interactions coalesce and the suite would +measure less work than the other ports. With zone.js, and without event +coalescing, Angular renders synchronously once the event handler returns. + +## Developer Documentation + +The app was created with the Angular CLI. It can be previewed during development +with `npm run dev`. To update the files run in the harness you have to run +`npm run build`, which regenerates the committed `dist/` directory and its +`resources.txt`. + +The repository's Prettier predates Angular's control flow syntax and would +mangle the inline templates, so `.prettierrc` turns off embedded formatting for +this workload's TypeScript files. + +The built workload can be loaded within the harness at e.g. +`http://localhost:8080/?developerMode&suites=ChatRoom-Angular`, or directly at +`http://localhost:8080/suites-experimental/chat-room-angular/dist/index.html`. diff --git a/suites-experimental/chat-room-angular/angular.json b/suites-experimental/chat-room-angular/angular.json new file mode 100644 index 000000000..0f0cbc00b --- /dev/null +++ b/suites-experimental/chat-room-angular/angular.json @@ -0,0 +1,67 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "cli": { + "analytics": false + }, + "newProjectRoot": "projects", + "projects": { + "chat-room-angular": { + "projectType": "application", + "root": "", + "sourceRoot": "src", + "architect": { + "build": { + "builder": "@angular/build:application", + "options": { + "outputPath": { + "base": "dist", + "browser": "" + }, + "index": "src/index.html", + "browser": "src/main.ts", + "polyfills": ["zone.js"], + "tsConfig": "tsconfig.json", + "styles": ["src/styles.css"] + }, + "configurations": { + "production": { + "outputHashing": "none", + "optimization": { + "scripts": true, + "styles": { + "minify": true, + "inlineCritical": false + }, + "fonts": false + }, + "sourceMap": { + "scripts": true, + "styles": false + }, + "extractLicenses": false + }, + "development": { + "optimization": false, + "extractLicenses": false, + "sourceMap": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "builder": "@angular/build:dev-server", + "configurations": { + "production": { + "buildTarget": "chat-room-angular:build:production" + }, + "development": { + "buildTarget": "chat-room-angular:build:development" + } + }, + "defaultConfiguration": "development" + } + } + } + } +} diff --git a/suites-experimental/chat-room-angular/dist/index.html b/suites-experimental/chat-room-angular/dist/index.html new file mode 100644 index 000000000..e12d1dd7b --- /dev/null +++ b/suites-experimental/chat-room-angular/dist/index.html @@ -0,0 +1,20 @@ + + + + + + ChatRoom + + + +
+ + diff --git a/suites-experimental/chat-room-angular/dist/main.js b/suites-experimental/chat-room-angular/dist/main.js new file mode 100644 index 000000000..c49eec0ea --- /dev/null +++ b/suites-experimental/chat-room-angular/dist/main.js @@ -0,0 +1,31 @@ +var Lf=Object.defineProperty,Ff=Object.defineProperties;var Pf=Object.getOwnPropertyDescriptors;var mc=Object.getOwnPropertySymbols;var jf=Object.prototype.hasOwnProperty,Vf=Object.prototype.propertyIsEnumerable;var yc=(e,t,n)=>t in e?Lf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q=(e,t)=>{for(var n in t||={})jf.call(t,n)&&yc(e,n,t[n]);if(mc)for(var n of mc(t))Vf.call(t,n)&&yc(e,n,t[n]);return e},X=(e,t)=>Ff(e,Pf(t));var zt=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{a(n.next(c))}catch(u){o(u)}},s=c=>{try{a(n.throw(c))}catch(u){o(u)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);a((n=n.apply(e,t)).next())});var Mn=[null],vr=[!1],pt=1,Bf=null,ee=Symbol("SIGNAL");function g(e){let t=Mn[0];return Mn[0]=e,t}function wr(){return Mn[0]}var Wt={version:0,lastCleanEpoch:0,dirty:!1,producers:void 0,producersTail:void 0,consumers:void 0,consumersTail:void 0,recomputing:!1,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Je(e){if(vr[0])throw new Error("");let t=Mn[0];if(t===null)return;t.consumerOnSignalRead(e);let n=t.producersTail;if(n!==void 0&&n.producer===e)return;let r,o=t.recomputing;if(o&&(r=n!==void 0?n.nextProducer:t.producers,r!==void 0&&r.producer===e)){t.producersTail=r,r.lastReadVersion=e.version,r.knownValidAtEpoch=pt;return}let i=e.consumersTail;if(i!==void 0&&i.consumer===t&&(!o||i.knownValidAtEpoch===pt))return;let s=Yt(t),a={producer:e,consumer:t,nextProducer:r,prevConsumer:void 0,knownValidAtEpoch:pt,lastReadVersion:e.version,nextConsumer:void 0};t.producersTail=a,n!==void 0?n.nextProducer=a:t.producers=a,s&&Ic(e,a)}function Dc(){pt++}function Nn(e){if(!(Yt(e)&&!e.dirty)&&!(!e.dirty&&e.lastCleanEpoch===pt)){if(!e.producerMustRecompute(e)&&!An(e)){Cr(e);return}e.producerRecomputeValue(e),Cr(e)}}function di(e){if(e.consumers===void 0)return;let t=vr[0];vr[0]=!0;try{for(let n=e.consumers;n!==void 0;n=n.nextConsumer){let r=n.consumer;r.dirty||Hf(r)}}finally{vr[0]=t}}function fi(){return Mn[0]?.consumerAllowSignalWrites!==!1}function Hf(e){e.dirty=!0,di(e),e.consumerMarkedDirty?.(e)}function Cr(e){e.dirty=!1,e.lastCleanEpoch=pt}function gt(e){return e&&vc(e),g(e)}function vc(e){if(e.producersTail?.knownValidAtEpoch===pt){let t=e.producers;for(;t!==void 0;)t.knownValidAtEpoch=null,t=t.nextProducer}e.producersTail=void 0,e.recomputing=!0}function qt(e,t){g(t),e&&Ec(e)}function Ec(e){e.recomputing=!1;let t=e.producersTail,n=t!==void 0?t.nextProducer:e.producers;if(n!==void 0){if(Yt(e))do n=pi(n);while(n!==void 0);t!==void 0?t.nextProducer=void 0:e.producers=void 0}}function An(e){for(let t=e.producers;t!==void 0;t=t.nextProducer){let n=t.producer,r=t.lastReadVersion;if(r!==n.version||(Nn(n),r!==n.version))return!0}return!1}function Zt(e){if(Yt(e)){let t=e.producers;for(;t!==void 0;)t=pi(t)}e.producers=void 0,e.producersTail=void 0,e.consumers=void 0,e.consumersTail=void 0}function Ic(e,t){let n=e.consumersTail,r=Yt(e);if(n!==void 0?(t.nextConsumer=n.nextConsumer,n.nextConsumer=t):(t.nextConsumer=void 0,e.consumers=t),t.prevConsumer=n,e.consumersTail=t,!r)for(let o=e.producers;o!==void 0;o=o.nextProducer)Ic(o.producer,o)}function pi(e){let t=e.producer,n=e.nextProducer,r=e.nextConsumer,o=e.prevConsumer;if(e.nextConsumer=void 0,e.prevConsumer=void 0,r!==void 0?r.prevConsumer=o:t.consumersTail=o,o!==void 0)o.nextConsumer=r;else if(t.consumers=r,!Yt(t)){let i=t.producers;for(;i!==void 0;)i=pi(i)}return n}function Yt(e){return e.consumerIsAlwaysLive||e.consumers!==void 0}function Tr(e){Bf?.(e)}function br(e,t){return Object.is(e,t)}function _r(e,t){let n=Object.create($f);n.computation=e,t!==void 0&&(n.equal=t);let r=()=>{if(Nn(n),Je(n),n.value===ht)throw n.error;return n.value};return r[ee]=n,Tr(n),r}var Er=Symbol("UNSET"),Ir=Symbol("COMPUTING"),ht=Symbol("ERRORED"),$f=X(q({},Wt),{value:Er,dirty:!0,error:null,equal:br,kind:"computed",producerMustRecompute(e){return e.value===Er||e.value===Ir},producerRecomputeValue(e){if(e.value===Ir)throw new Error("");let t=e.value;e.value=Ir;let n=gt(e),r,o=!1;try{r=e.computation(),g(null),o=t!==Er&&t!==ht&&r!==ht&&e.equal(t,r)}catch(i){r=ht,e.error=i}finally{qt(e,n)}if(o){e.value=t;return}e.value=r,e.version++}});function Uf(){throw new Error}var Cc=Uf;function wc(e){Cc(e)}function hi(e){Cc=e}var Gf=null;function gi(e,t){let n=Object.create(Qt);n.value=e,t!==void 0&&(n.equal=t);let r=()=>Tc(n);return r[ee]=n,Tr(n),[r,s=>mt(n,s),s=>mi(n,s)]}function Tc(e){return Je(e),e.value}function mt(e,t){fi()||wc(e),e.equal(e.value,t)||(e.value=t,zf(e))}function mi(e,t){fi()||wc(e),mt(e,t(e.value))}var Qt=X(q({},Wt),{equal:br,value:void 0,kind:"signal"});function zf(e){e.version++,Dc(),di(e),Gf?.(e)}var yi=[void 0];function Sr(){return yi[0]}function Le(e){let t=yi[0];return yi[0]=e,t}var bc=Symbol("NotFound");function Kt(e){return e===bc||e?.name==="\u0275NotFound"}function _c(e){let t=g(null);try{return e()}finally{g(t)}}function ne(e){return typeof e=="function"}function Mr(e){let n=e(r=>{Error.call(r),r.stack=new Error().stack});return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Nr=Mr(e=>function(n){e(this),this.message=n?`${n.length} errors occurred during unsubscription: +${n.map((r,o)=>`${o+1}) ${r.toString()}`).join(` + `)}`:"",this.name="UnsubscriptionError",this.errors=n});function xn(e,t){if(e){let n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Y=class e{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;let{_parentage:n}=this;if(n)if(this._parentage=null,Array.isArray(n))for(let i of n)i.remove(this);else n.remove(this);let{initialTeardown:r}=this;if(ne(r))try{r()}catch(i){t=i instanceof Nr?i.errors:[i]}let{_finalizers:o}=this;if(o){this._finalizers=null;for(let i of o)try{Sc(i)}catch(s){t=t??[],s instanceof Nr?t=[...t,...s.errors]:t.push(s)}}if(t)throw new Nr(t)}}add(t){var n;if(t&&t!==this)if(this.closed)Sc(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}}_hasParent(t){let{_parentage:n}=this;return n===t||Array.isArray(n)&&n.includes(t)}_addParent(t){let{_parentage:n}=this;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t}_removeParent(t){let{_parentage:n}=this;n===t?this._parentage=null:Array.isArray(n)&&xn(n,t)}remove(t){let{_finalizers:n}=this;n&&xn(n,t),t instanceof e&&t._removeParent(this)}};Y.EMPTY=(()=>{let e=new Y;return e.closed=!0,e})();var Di=Y.EMPTY;function Ar(e){return e instanceof Y||e&&"closed"in e&&ne(e.remove)&&ne(e.add)&&ne(e.unsubscribe)}function Sc(e){ne(e)?e():e.unsubscribe()}var Ie={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Jt={setTimeout(e,t,...n){let{delegate:r}=Jt;return r?.setTimeout?r.setTimeout(e,t,...n):setTimeout(e,t,...n)},clearTimeout(e){let{delegate:t}=Jt;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Mc(e){Jt.setTimeout(()=>{let{onUnhandledError:t}=Ie;if(t)t(e);else throw e})}function vi(){}var Nc=Ei("C",void 0,void 0);function Ac(e){return Ei("E",void 0,e)}function xc(e){return Ei("N",e,void 0)}function Ei(e,t,n){return{kind:e,value:t,error:n}}var yt=null;function Xt(e){if(Ie.useDeprecatedSynchronousErrorHandling){let t=!yt;if(t&&(yt={errorThrown:!1,error:null}),e(),t){let{errorThrown:n,error:r}=yt;if(yt=null,n)throw r}}else e()}function Rc(e){Ie.useDeprecatedSynchronousErrorHandling&&yt&&(yt.errorThrown=!0,yt.error=e)}var Dt=class extends Y{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,Ar(t)&&t.add(this)):this.destination=Qf}static create(t,n,r){return new en(t,n,r)}next(t){this.isStopped?Ci(xc(t),this):this._next(t)}error(t){this.isStopped?Ci(Ac(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?Ci(Nc,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()}}},Zf=Function.prototype.bind;function Ii(e,t){return Zf.call(e,t)}var wi=class{constructor(t){this.partialObserver=t}next(t){let{partialObserver:n}=this;if(n.next)try{n.next(t)}catch(r){xr(r)}}error(t){let{partialObserver:n}=this;if(n.error)try{n.error(t)}catch(r){xr(r)}else xr(t)}complete(){let{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(n){xr(n)}}},en=class extends Dt{constructor(t,n,r){super();let o;if(ne(t)||!t)o={next:t??void 0,error:n??void 0,complete:r??void 0};else{let i;this&&Ie.useDeprecatedNextContext?(i=Object.create(t),i.unsubscribe=()=>this.unsubscribe(),o={next:t.next&&Ii(t.next,i),error:t.error&&Ii(t.error,i),complete:t.complete&&Ii(t.complete,i)}):o=t}this.destination=new wi(o)}};function xr(e){Ie.useDeprecatedSynchronousErrorHandling?Rc(e):Mc(e)}function Yf(e){throw e}function Ci(e,t){let{onStoppedNotification:n}=Ie;n&&Jt.setTimeout(()=>n(e,t))}var Qf={closed:!0,next:vi,error:Yf,complete:vi};var Oc=typeof Symbol=="function"&&Symbol.observable||"@@observable";function kc(e){return e}function Lc(e){return e.length===0?kc:e.length===1?e[0]:function(n){return e.reduce((r,o)=>o(r),n)}}var Fe=class e{constructor(t){t&&(this._subscribe=t)}lift(t){let n=new e;return n.source=this,n.operator=t,n}subscribe(t,n,r){let o=Jf(t)?t:new en(t,n,r);return Xt(()=>{let{operator:i,source:s}=this;o.add(i?i.call(o,s):s?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(t){try{return this._subscribe(t)}catch(n){t.error(n)}}forEach(t,n){return n=Fc(n),new n((r,o)=>{let i=new en({next:s=>{try{t(s)}catch(a){o(a),i.unsubscribe()}},error:o,complete:r});this.subscribe(i)})}_subscribe(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)}[Oc](){return this}pipe(...t){return Lc(t)(this)}toPromise(t){return t=Fc(t),new t((n,r)=>{let o;this.subscribe(i=>o=i,i=>r(i),()=>n(o))})}};Fe.create=e=>new Fe(e);function Fc(e){var t;return(t=e??Ie.Promise)!==null&&t!==void 0?t:Promise}function Kf(e){return e&&ne(e.next)&&ne(e.error)&&ne(e.complete)}function Jf(e){return e&&e instanceof Dt||Kf(e)&&Ar(e)}function Xf(e){return ne(e?.lift)}function Pc(e){return t=>{if(Xf(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function jc(e,t,n,r,o){return new Ti(e,t,n,r,o)}var Ti=class extends Dt{constructor(t,n,r,o,i,s){super(t),this.onFinalize=i,this.shouldUnsubscribe=s,this._next=n?function(a){try{n(a)}catch(c){t.error(c)}}:super._next,this._error=o?function(a){try{o(a)}catch(c){t.error(c)}finally{this.unsubscribe()}}:super._error,this._complete=r?function(){try{r()}catch(a){t.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:n}=this;super.unsubscribe(),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}}};var Vc=Mr(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Ce=class extends Fe{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){let n=new Rr(this,this);return n.operator=t,n}_throwIfClosed(){if(this.closed)throw new Vc}next(t){Xt(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(t)}})}error(t){Xt(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;let{observers:n}=this;for(;n.length;)n.shift().error(t)}})}complete(){Xt(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:t}=this;for(;t.length;)t.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){let{hasError:n,isStopped:r,observers:o}=this;return n||r?Di:(this.currentObservers=null,o.push(t),new Y(()=>{this.currentObservers=null,xn(o,t)}))}_checkFinalizedStatuses(t){let{hasError:n,thrownError:r,isStopped:o}=this;n?t.error(r):o&&t.complete()}asObservable(){let t=new Fe;return t.source=this,t}};Ce.create=(e,t)=>new Rr(e,t);var Rr=class extends Ce{constructor(t,n){super(),this.destination=t,this.source=n}next(t){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.next)===null||r===void 0||r.call(n,t)}error(t){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.error)===null||r===void 0||r.call(n,t)}complete(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)}_subscribe(t){var n,r;return(r=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&r!==void 0?r:Di}};var Rn=class extends Ce{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){let n=super._subscribe(t);return!n.closed&&t.next(this._value),n}getValue(){let{hasError:t,thrownError:n,_value:r}=this;if(t)throw n;return this._throwIfClosed(),r}next(t){super.next(this._value=t)}};function bi(e,t){return Pc((n,r)=>{let o=0;n.subscribe(jc(r,i=>{r.next(e.call(t,i,o++))}))})}var $i="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss",E=class extends Error{code;constructor(t,n){super(on(t,n)),this.code=t}};function ep(e){return`NG0${Math.abs(e)}`}function on(e,t){return`${ep(e)}${t?": "+t:""}`}function R(e){for(let t in e)if(e[t]===R)return t;throw Error("")}function Pr(e){if(typeof e=="string")return e;if(Array.isArray(e))return`[${e.map(Pr).join(", ")}]`;if(e==null)return""+e;let t=e.overriddenName||e.name;if(t)return`${t}`;let n=e.toString();if(n==null)return""+n;let r=n.indexOf(` +`);return r>=0?n.slice(0,r):n}function Ui(e,t){return e?t?`${e} ${t}`:e:t||""}var tp=R({__forward_ref__:R});function sn(e){return e.__forward_ref__=sn,e}function te(e){return Gc(e)?e():e}function Gc(e){return typeof e=="function"&&Object.hasOwn(e,tp)&&e.__forward_ref__===sn}function Z(e){return{token:e.token,providedIn:e.providedIn||null,factory:e.factory,value:void 0}}function jr(e){return np(e,Vr)}function np(e,t){return Object.hasOwn(e,t)&&e[t]||null}function rp(e){let t=e?.[Vr]??null;return t||null}function Si(e){return e&&Object.hasOwn(e,kr)?e[kr]:null}var Vr=R({\u0275prov:R}),kr=R({\u0275inj:R}),T=class{_desc;ngMetadataName="InjectionToken";\u0275prov;constructor(t,n){this._desc=t,this.\u0275prov=void 0,typeof n=="number"?this.__NG_ELEMENT_ID__=n:n!==void 0&&(this.\u0275prov=Z({token:this,providedIn:n.providedIn||"root",factory:n.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function Gi(e){return e&&!!e.\u0275providers}var zi=R({\u0275cmp:R}),Wi=R({\u0275dir:R}),qi=R({\u0275pipe:R});var Mi=R({\u0275fac:R}),wt=R({__NG_ELEMENT_ID__:R}),Bc=R({__NG_ENV_ID__:R});function Tt(e){return Zi(e,"@Component"),e[zi]||null}function Br(e){return Zi(e,"@Directive"),e[Wi]||null}function zc(e){return Zi(e,"@Pipe"),e[qi]||null}function Zi(e,t){if(e==null)throw new E(-919,!1)}function Hr(e){return typeof e=="string"?e:e==null?"":String(e)}var Wc=R({ngErrorCode:R}),op=R({ngErrorMessage:R}),ip=R({ngTokenPath:R});function Yi(e,t){return qc("",-200,t)}function $r(e,t){throw new E(-201,!1)}function qc(e,t,n){let r=new E(t,e);return r[Wc]=t,r[op]=e,n&&(r[ip]=n),r}function sp(e){return e[Wc]}var Ni;function Zc(){return Ni}function se(e){let t=Ni;return Ni=e,t}function Qi(e,t,n){let r=jr(e);if(r&&r.providedIn=="root")return r.value===void 0?r.value=r.factory():r.value;if(n&8)return null;if(t!==void 0)return t;$r(e,"")}var ap={},vt=ap,cp="__NG_DI_FLAG__",Ai=class{injector;constructor(t){this.injector=t}retrieve(t,n){let r=Et(n)||0;try{return this.injector.get(t,r&8?null:vt,r)}catch(o){if(Kt(o))return o;throw o}}};function up(e,t=0){let n=Sr();if(n===void 0)throw new E(-203,!1);if(n===null)return Qi(e,void 0,t);{let r=lp(t),o=n.retrieve(e,r);if(Kt(o)){if(r.optional)return null;throw o}return o}}function A(e,t=0){return(Zc()||up)(te(e),t)}function m(e,t){return A(e,Et(t))}function Et(e){return typeof e>"u"||typeof e=="number"?e:0|(e.optional&&8)|(e.host&&1)|(e.self&&2)|(e.skipSelf&&4)}function lp(e){return{optional:!!(e&8),host:!!(e&1),self:!!(e&2),skipSelf:!!(e&4)}}function xi(e){let t=[];for(let n=0;nArray.isArray(n)?Ur(n,t):t(n))}function Ki(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function Fn(e,t){return t>=e.length-1?e.pop():e.splice(t,1)[0]}function Yc(e,t,n,r){let o=e.length;if(o==t)e.push(n,r);else if(o===1)e.push(r,e[0]),e[0]=n;else{for(o--,e.push(e[o-1],e[o]);o>t;){let i=o-2;e[o]=e[i],o--}e[t]=n,e[t+1]=r}}function Qc(e,t,n){let r=an(e,t);return r>=0?e[r|1]=n:(r=~r,Yc(e,r,t,n)),r}function Gr(e,t){let n=an(e,t);if(n>=0)return e[n|1]}function an(e,t){return fp(e,t,1)}function fp(e,t,n){let r=0,o=e.length>>n;for(;o!==r;){let i=r+(o-r>>1),s=e[i<t?o=i:r=i+1}return~(o<{n.push(s)};return Ur(t,s=>{let a=s;Lr(a,i,[],r)&&(o||=[],o.push(a))}),o!==void 0&&Jc(o,i),n}function Jc(e,t){for(let n=0;n{t(i,r)})}}function Lr(e,t,n,r){if(e=te(e),!e)return!1;let o=null,i=Si(e),s=!i&&Tt(e);if(!i&&!s){let c=e.ngModule;if(i=Si(c),i)o=c;else return!1}else{if(s&&!s.standalone)return!1;o=e}let a=r.has(o);if(s){if(a)return!1;if(r.add(o),s.dependencies){let c=typeof s.dependencies=="function"?s.dependencies():s.dependencies;for(let u of c)Lr(u,t,n,r)}}else if(i){if(i.imports!=null&&!a){r.add(o);let u;Ur(i.imports,l=>{Lr(l,t,n,r)&&(u||=[],u.push(l))}),u!==void 0&&Jc(u,t)}if(!a){let u=nn(o)||(()=>new o);t({provide:o,useFactory:u,deps:Xe},o),t({provide:Xi,useValue:o,multi:!0},o),t({provide:_t,useValue:()=>A(o),multi:!0},o)}let c=i.providers;if(c!=null&&!a){let u=e;ts(c,l=>{t(l,u)})}}else return!1;return o!==e&&e.providers!==void 0}function ts(e,t){for(let n of e)Gi(n)&&(n=n.\u0275providers),Array.isArray(n)?ts(n,t):t(n)}var pp=R({provide:String,useValue:R});function Xc(e){return e!==null&&typeof e=="object"&&pp in e}function hp(e){return!!(e&&e.useExisting)}function gp(e){return!!(e&&e.useFactory)}function It(e){return typeof e=="function"}function eu(e){return!!e.useClass}var Pn=new T(""),Or={},Hc={},_i;function jn(){return _i===void 0&&(_i=new rn),_i}var we=class{},Ct=class extends we{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(t,n,r,o){super(),this.parent=n,this.source=r,this.scopes=o,Oi(t,s=>this.processProvider(s)),this.records.set(Ji,tn(void 0,this)),o.has("environment")&&this.records.set(we,tn(void 0,this));let i=this.records.get(Pn);i!=null&&typeof i.value=="string"&&this.scopes.add(i.value),this.injectorDefTypes=new Set(this.get(Xi,Xe,{self:!0}))}retrieve(t,n){let r=Et(n)||0;try{return this.get(t,vt,r)}catch(o){if(Kt(o))return o;throw o}}destroy(){On(this),this._destroyed=!0;let t=g(null);try{for(let r of this._ngOnDestroyHooks)r.ngOnDestroy();let n=this._onDestroyHooks;this._onDestroyHooks=[];for(let r of n)r()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),g(t)}}onDestroy(t){return On(this),this._onDestroyHooks.push(t),()=>this.removeOnDestroy(t)}runInContext(t){On(this);let n=Le(this),r=se(void 0),o;try{return t()}finally{Le(n),se(r)}}get(t,n=vt,r){if(On(this),Object.hasOwn(t,Bc))return t[Bc](this);let o=Et(r),i,s=Le(this),a=se(void 0);try{if(!(o&4)){let u=this.records.get(t);if(u===void 0){let l=Ep(t)&&jr(t);l&&this.injectableDefInScope(l)?u=tn(Ri(t),Or):u=null,this.records.set(t,u)}if(u!=null)return this.hydrate(t,u,o)}let c=o&2?jn():this.parent;return n=o&8&&n===vt?null:n,c.get(t,n)}catch(c){let u=sp(c);throw u===-200||u===-201?new E(u,null):c}finally{se(a),Le(s)}}resolveInjectorInitializers(){let t=g(null),n=Le(this),r=se(void 0),o;try{let i=this.get(_t,Xe,{self:!0});for(let s of i)s()}finally{Le(n),se(r),g(t)}}toString(){return"R3Injector[...]"}processProvider(t){t=te(t);let n=It(t)?t:te(t&&t.provide),r=yp(t);if(!It(t)&&t.multi===!0){let o=this.records.get(n);o||(o=tn(void 0,Or,!0),o.factory=()=>xi(o.multi),this.records.set(n,o)),n=t,o.multi.push(t)}this.records.set(n,r)}hydrate(t,n,r){let o=g(null);try{if(n.value===Hc)throw Yi("");return n.value===Or&&(n.value=Hc,n.value=n.factory(void 0,r)),typeof n.value=="object"&&n.value&&vp(n.value)&&this._ngOnDestroyHooks.add(n.value),n.value}finally{g(o)}}injectableDefInScope(t){if(!t.providedIn)return!1;let n=te(t.providedIn);return typeof n=="string"?n==="any"||this.scopes.has(n):this.injectorDefTypes.has(n)}removeOnDestroy(t){let n=this._onDestroyHooks.indexOf(t);n!==-1&&this._onDestroyHooks.splice(n,1)}};function Ri(e){let t=jr(e),n=t!==null?t.factory:nn(e);if(n!==null)return n;if(e instanceof T)throw new E(-204,!1);if(e instanceof Function)return mp(e);throw new E(-204,!1)}function mp(e){if(e.length>0)throw new E(-204,!1);let n=rp(e);return n!==null?()=>n.factory(e):()=>new e}function yp(e){if(Xc(e))return tn(void 0,e.useValue);{let t=ns(e);return tn(t,Or)}}function ns(e,t,n){let r;if(It(e)){let o=te(e);return nn(o)||Ri(o)}else if(Xc(e))r=()=>te(e.useValue);else if(gp(e))r=()=>e.useFactory(...xi(e.deps||[]));else if(hp(e))r=(o,i)=>A(te(e.useExisting),i!==void 0&&i&8?8:void 0);else{let o=te(e&&(e.useClass||e.provide));if(Dp(e))r=()=>new o(...xi(e.deps));else return nn(o)||Ri(o)}return r}function On(e){if(e.destroyed)throw new E(-205,!1)}function tn(e,t,n=!1){return{factory:e,value:t,multi:n?[]:void 0}}function Dp(e){return!!e.deps}function vp(e){return e!==null&&typeof e=="object"&&typeof e.ngOnDestroy=="function"}function Ep(e){return typeof e=="function"||typeof e=="object"&&e.ngMetadataName==="InjectionToken"}function Oi(e,t){for(let n of e)Array.isArray(n)?Oi(n,t):n&&Gi(n)?Oi(n.\u0275providers,t):t(n)}function Wr(e,t){let n;e instanceof Ct?(On(e),n=e):n=new Ai(e);let r,o=Le(n),i=se(void 0);try{return t()}finally{Le(o),se(i)}}function tu(){return Zc()!==void 0||Sr()!=null}var be=0,y=1,v=2,U=3,he=4,re=5,cn=6,un=7,P=8,Ze=9,_e=10,F=11,ln=12,rs=13,et=14,ae=15,St=16,Mt=17,Nt=18,Vn=19,os=20,Ge=21,qr=22,dn=23,ce=24,At=25,nu=26,Bn=27,G=28,ru=1,is=6,xt=7,Hn=8,$n=9,B=10;function tt(e){return Array.isArray(e)&&typeof e[ru]=="object"}function ge(e){return Array.isArray(e)&&e[ru]===!0}function ss(e){return(e.flags&4)!==0}function nt(e){return e.componentOffset>-1}function fn(e){return(e.flags&1)===1}function rt(e){return!!e.template}function pn(e){return(e[v]&512)!==0}function Rt(e){return(e[v]&256)===256}var Zr=(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[e.ATTRIBUTE_NO_BINDING=6]="ATTRIBUTE_NO_BINDING",e})(Zr||{});var ou="svg",iu="math";function Q(e){for(;Array.isArray(e);)e=e[be];return e}function as(e,t){return Q(t[e])}function Se(e,t){return Q(t[e.index])}function Yr(e,t){return e.data[t]}function su(e,t){return e[t]}function Pe(e,t){let n=t[e];return tt(n)?n:n[be]}function Qr(e){return(e[v]&128)===128}function au(e){return ge(e[U])}function me(e,t){return t==null?null:e[t]}function cs(e){e[Mt]=0}function us(e){e[v]&1024||(e[v]|=1024,Qr(e)&&hn(e))}function cu(e,t){for(;e>0;)t=t[et],e--;return t}function Un(e){return!!(e[v]&9216||e[ce]?.dirty)}function Kr(e){e[_e].changeDetectionScheduler?.notify(8),e[v]&64&&(e[v]|=1024),Un(e)&&hn(e)}function hn(e){e[_e].changeDetectionScheduler?.notify(0);let t=ze(e);for(;t!==null&&!(t[v]&8192||(t[v]|=8192,!Qr(t)));)t=ze(t)}function Jr(e,t){if(Rt(e))throw new E(911,!1);e[Ge]===null&&(e[Ge]=[]),e[Ge].push(t)}function uu(e,t){if(e[Ge]===null)return;let n=e[Ge].indexOf(t);n!==-1&&e[Ge].splice(n,1)}function ze(e){let t=e[U];return ge(t)?t[U]:t}function lu(e){return e[un]??=[]}function du(e){return e.cleanup??=[]}var C={lFrame:_u(null),bindingsEnabled:!0,skipHydrationRootTNode:null};var ki=!1;function fu(){return C.lFrame.elementDepthCount}function pu(){C.lFrame.elementDepthCount++}function ls(){C.lFrame.elementDepthCount--}function Xr(){return C.bindingsEnabled}function hu(){return C.skipHydrationRootTNode!==null}function ds(e){return C.skipHydrationRootTNode===e}function fs(){C.skipHydrationRootTNode=null}function b(){return C.lFrame.lView}function K(){return C.lFrame.tView}function ue(e){return C.lFrame.contextLView=e,e[P]}function le(e){return C.lFrame.contextLView=null,e}function oe(){let e=ps();for(;e!==null&&e.type===64;)e=e.parent;return e}function ps(){return C.lFrame.currentTNode}function gu(){let e=C.lFrame,t=e.currentTNode;return e.isParent?t:t.parent}function gn(e,t){let n=C.lFrame;n.currentTNode=e,n.isParent=t}function hs(){return C.lFrame.isParent}function mu(){C.lFrame.isParent=!1}function yu(){return C.lFrame.contextLView}function gs(){return ki}function ms(e){let t=ki;return ki=e,t}function Du(){let e=C.lFrame,t=e.bindingRootIndex;return t===-1&&(t=e.bindingRootIndex=e.tView.bindingStartIndex),t}function vu(e){return C.lFrame.bindingIndex=e}function Ot(){return C.lFrame.bindingIndex++}function Eu(e){let t=C.lFrame,n=t.bindingIndex;return t.bindingIndex=t.bindingIndex+e,n}function Iu(){return C.lFrame.inI18n}function Cu(e,t){let n=C.lFrame;n.bindingIndex=n.bindingRootIndex=e,eo(t)}function wu(){return C.lFrame.currentDirectiveIndex}function eo(e){C.lFrame.currentDirectiveIndex=e}function Tu(e){let t=C.lFrame.currentDirectiveIndex;return t===-1?null:e[t]}function ys(e){C.lFrame.currentQueryIndex=e}function Ip(e){let t=e[y];return t.type===2?t.declTNode:t.type===1?e[re]:null}function Ds(e,t,n){if(n&4){let o=t,i=e;for(;o=o.parent,o===null&&!(n&1);)if(o=Ip(i),o===null||(i=i[et],o.type&10))break;if(o===null)return!1;t=o,e=i}let r=C.lFrame=bu();return r.currentTNode=t,r.lView=e,!0}function to(e){let t=bu(),n=e[y];C.lFrame=t,t.currentTNode=n.firstChild,t.lView=e,t.tView=n,t.contextLView=e,t.bindingIndex=n.bindingStartIndex,t.inI18n=!1}function bu(){let e=C.lFrame,t=e===null?null:e.child;return t===null?_u(e):t}function _u(e){let 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 e!==null&&(e.child=t),t}function Su(){let e=C.lFrame;return C.lFrame=e.parent,e.currentTNode=null,e.lView=null,e}var vs=Su;function no(){let e=Su();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 Mu(e){return(C.lFrame.contextLView=cu(e,C.lFrame.contextLView))[P]}function ot(){return C.lFrame.selectedIndex}function it(e){C.lFrame.selectedIndex=e}function ro(){let e=C.lFrame;return Yr(e.tView,e.selectedIndex)}function Es(){return C.lFrame.currentNamespace}var Nu=!0;function oo(){return Nu}function Gn(e){Nu=e}function Li(e,t=null,n=null,r){let o=Au(e,t,n,r);return o.resolveInjectorInitializers(),o}function Au(e,t=null,n=null,r,o=new Set){let i=[n||Xe,Kc(e)],s;return new Ct(i,t||jn(),s||null,o)}var Te=class e{static THROW_IF_NOT_FOUND=vt;static NULL=new rn;static create(t,n){if(Array.isArray(t))return Li({name:""},n,t,"");{let r=t.name??"";return Li({name:r},t.parent,t.providers,r)}}static \u0275prov=Z({token:e,providedIn:"any",factory:()=>A(Ji)});static __NG_ELEMENT_ID__=-1},ye=new T(""),We=class{static __NG_ELEMENT_ID__=Cp;static __NG_ENV_ID__=t=>t},Fi=class extends We{_lView;constructor(t){super(),this._lView=t}get destroyed(){return Rt(this._lView)}onDestroy(t){let n=this._lView;return Jr(n,t),()=>uu(n,t)}};function Cp(){return new Fi(b())}var Is=!1,xu=new T(""),kt=(()=>{class e{taskId=0;pendingTasks=new Set;destroyed=!1;pendingTask=new Rn(!1);debugTaskTracker=m(xu,{optional:!0});get hasPendingTasks(){return this.destroyed?!1:this.pendingTask.value}get hasPendingTasksObservable(){return this.destroyed?new Fe(n=>{n.next(!1),n.complete()}):this.pendingTask}add(){!this.hasPendingTasks&&!this.destroyed&&this.pendingTask.next(!0);let n=this.taskId++;return this.pendingTasks.add(n),this.debugTaskTracker?.add(n),n}has(n){return this.pendingTasks.has(n)}remove(n){this.pendingTasks.delete(n),this.debugTaskTracker?.remove(n),this.pendingTasks.size===0&&this.hasPendingTasks&&this.pendingTask.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this.hasPendingTasks&&this.pendingTask.next(!1),this.destroyed=!0,this.pendingTask.unsubscribe()}static \u0275prov=Z({token:e,providedIn:"root",factory:()=>new e})}return e})(),Pi=class extends Ce{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(t=!1){super(),this.__isAsync=t,tu()&&(this.destroyRef=m(We,{optional:!0})??void 0,this.pendingTasks=m(kt,{optional:!0})??void 0)}emit(t){let n=g(null);try{super.next(t)}finally{g(n)}}subscribe(t,n,r){let o=t,i=n||(()=>null),s=r;if(t&&typeof t=="object"){let c=t;o=c.next?.bind(c),i=c.error?.bind(c),s=c.complete?.bind(c)}this.__isAsync&&(i=this.wrapInTimeout(i),o&&(o=this.wrapInTimeout(o)),s&&(s=this.wrapInTimeout(s)));let a=super.subscribe({next:o,error:i,complete:s});return t instanceof Y&&t.add(a),a}wrapInTimeout(t){return n=>{let r=this.pendingTasks?.add();setTimeout(()=>{try{t(n)}finally{r!==void 0&&this.pendingTasks?.remove(r)}})}}},Ue=Pi;function Fr(...e){}function Cs(e){let t,n;function r(){e=Fr;try{n!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(n),t!==void 0&&clearTimeout(t)}catch(o){}}return t=setTimeout(()=>{e(),r()}),typeof requestAnimationFrame=="function"&&(n=requestAnimationFrame(()=>{e(),r()})),()=>r()}function Ru(e){return queueMicrotask(()=>e()),()=>{e=Fr}}var ws="isAngularZone",kn=ws+"_ID",wp=0,V=class e{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new Ue(!1);onMicrotaskEmpty=new Ue(!1);onStable=new Ue(!1);onError=new Ue(!1);constructor(t){let{enableLongStackTrace:n=!1,shouldCoalesceEventChangeDetection:r=!1,shouldCoalesceRunChangeDetection:o=!1,scheduleInRootZone:i=Is}=t;if(typeof Zone>"u")throw new E(908,!1);Zone.assertZonePatched();let s=this;s._nesting=0,s._outer=s._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(s._inner=s._inner.fork(new Zone.TaskTrackingZoneSpec)),n&&Zone.longStackTraceZoneSpec&&(s._inner=s._inner.fork(Zone.longStackTraceZoneSpec)),s.shouldCoalesceEventChangeDetection=!o&&r,s.shouldCoalesceRunChangeDetection=o,s.callbackScheduled=!1,s.scheduleInRootZone=i,_p(s)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(ws)===!0}static assertInAngularZone(){if(!e.isInAngularZone())throw new E(909,!1)}static assertNotInAngularZone(){if(e.isInAngularZone())throw new E(909,!1)}run(t,n,r){return this._inner.run(t,n,r)}runTask(t,n,r,o){let i=this._inner,s=i.scheduleEventTask("NgZoneEvent: "+o,t,Tp,Fr,Fr);try{return i.runTask(s,n,r)}finally{i.cancelTask(s)}}runGuarded(t,n,r){return this._inner.runGuarded(t,n,r)}runOutsideAngular(t){return this._outer.run(t)}},Tp={};function Ts(e){if(e._nesting==0&&!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 bp(e){if(e.isCheckStableRunning||e.callbackScheduled)return;e.callbackScheduled=!0;function t(){Cs(()=>{e.callbackScheduled=!1,ji(e),e.isCheckStableRunning=!0,Ts(e),e.isCheckStableRunning=!1})}e.scheduleInRootZone?Zone.root.run(()=>{t()}):e._outer.run(()=>{t()}),ji(e)}function _p(e){let t=()=>{bp(e)},n=wp++;e._inner=e._inner.fork({name:"angular",properties:{[ws]:!0,[kn]:n,[kn+n]:!0},onInvokeTask:(r,o,i,s,a,c)=>{if(Sp(c))return r.invokeTask(i,s,a,c);try{return $c(e),r.invokeTask(i,s,a,c)}finally{(e.shouldCoalesceEventChangeDetection&&s.type==="eventTask"||e.shouldCoalesceRunChangeDetection)&&t(),Uc(e)}},onInvoke:(r,o,i,s,a,c,u)=>{try{return $c(e),r.invoke(i,s,a,c,u)}finally{e.shouldCoalesceRunChangeDetection&&!e.callbackScheduled&&!Mp(c)&&t(),Uc(e)}},onHasTask:(r,o,i,s)=>{r.hasTask(i,s),o===i&&(s.change=="microTask"?(e._hasPendingMicrotasks=s.microTask,ji(e),Ts(e)):s.change=="macroTask"&&(e.hasPendingMacrotasks=s.macroTask))},onHandleError:(r,o,i,s)=>(r.handleError(i,s),e.runOutsideAngular(()=>e.onError.emit(s)),!1)})}function ji(e){e._hasPendingMicrotasks||(e.shouldCoalesceEventChangeDetection||e.shouldCoalesceRunChangeDetection)&&e.callbackScheduled===!0?e.hasPendingMicrotasks=!0:e.hasPendingMicrotasks=!1}function $c(e){e._nesting++,e.isStable&&(e.isStable=!1,e.onUnstable.emit(null))}function Uc(e){e._nesting--,Ts(e)}var Ln=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new Ue;onMicrotaskEmpty=new Ue;onStable=new Ue;onError=new Ue;run(t,n,r){return t.apply(n,r)}runGuarded(t,n,r){return t.apply(n,r)}runOutsideAngular(t){return t()}runTask(t,n,r,o){return t.apply(n,r)}};function Sp(e){return Ou(e,"__ignore_ng_zone__")}function Mp(e){return Ou(e,"__scheduler_tick__")}function Ou(e,t){return!Array.isArray(e)||e.length!==1?!1:e[0]?.data?.[t]===!0}var pe=class{_console=console;handleError(t){this._console.error("ERROR",t)}};function ku(e){return Lu(e)?e:new Vi(e)}function Lu(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.message=="string"}var Vi=class extends Error{constructor(t){super(String(t),{cause:t}),this.name="ErrorBoundaryWrappedError"}},st=new T("",{factory:()=>{let e=m(V),t=m(we),n;return r=>{e.runOutsideAngular(()=>{t.destroyed&&!n?setTimeout(()=>{throw r}):(n??=t.get(pe),n.handleError(r))})}}}),Fu={provide:_t,useValue:()=>{let e=m(pe,{optional:!0})},multi:!0};function ie(e,t){let[n,r,o]=gi(e,t?.equal),i=n,s=i[ee];return i.set=r,i.update=o,i.asReadonly=bs.bind(i),i}function bs(){let e=this[ee];if(e.readonlyFn===void 0){let t=()=>this();t[ee]=e,e.readonlyFn=t}return e.readonlyFn}var zn=new T("",{factory:()=>Np}),Np="ng";var io=new T(""),Wn=new T("",{providedIn:"platform",factory:()=>"unknown"});var so=new T("",{factory:()=>m(ye).body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});var ao=(()=>{class e{view;node;constructor(n,r){this.view=n,this.node=r}static __NG_ELEMENT_ID__=Ap}return e})();function Ap(){return new ao(b(),oe())}var qe=class{},mn=new T("",{factory:()=>!0});var co=new T(""),_s=(()=>{class e{static \u0275prov=Z({token:e,providedIn:"root",factory:()=>new Bi})}return e})(),Bi=class{dirtyEffectCount=0;queues=new Map;add(t){this.enqueue(t),this.schedule(t)}schedule(t){t.dirty&&this.dirtyEffectCount++}remove(t){let n=t.zone,r=this.queues.get(n);r.has(t)&&(r.delete(t),t.dirty&&this.dirtyEffectCount--)}enqueue(t){let n=t.zone;this.queues.has(n)||this.queues.set(n,new Set);let r=this.queues.get(n);r.has(t)||r.add(t)}flush(){for(;this.dirtyEffectCount>0;){let t=!1;for(let[n,r]of this.queues)n===null?t||=this.flushQueue(r):t||=n.run(()=>this.flushQueue(r));t||(this.dirtyEffectCount=0)}}flushQueue(t){let n=!1;for(let r of t)r.dirty&&(this.dirtyEffectCount--,n=!0,r.run());return n}},Hi=class{[ee];constructor(t){this[ee]=t}destroy(){this[ee].destroy()}};var aa=Symbol("InputSignalNode#UNSET"),ml=X(q({},Qt),{transformFn:void 0,applyValueToInputSignal(e,t){mt(e,t)}});function ca(e){return{toString:e}.toString()}var _=(function(e){return e[e.TemplateCreateStart=0]="TemplateCreateStart",e[e.TemplateCreateEnd=1]="TemplateCreateEnd",e[e.TemplateUpdateStart=2]="TemplateUpdateStart",e[e.TemplateUpdateEnd=3]="TemplateUpdateEnd",e[e.LifecycleHookStart=4]="LifecycleHookStart",e[e.LifecycleHookEnd=5]="LifecycleHookEnd",e[e.OutputStart=6]="OutputStart",e[e.OutputEnd=7]="OutputEnd",e[e.BootstrapApplicationStart=8]="BootstrapApplicationStart",e[e.BootstrapApplicationEnd=9]="BootstrapApplicationEnd",e[e.BootstrapComponentStart=10]="BootstrapComponentStart",e[e.BootstrapComponentEnd=11]="BootstrapComponentEnd",e[e.ChangeDetectionStart=12]="ChangeDetectionStart",e[e.ChangeDetectionEnd=13]="ChangeDetectionEnd",e[e.ChangeDetectionSyncStart=14]="ChangeDetectionSyncStart",e[e.ChangeDetectionSyncEnd=15]="ChangeDetectionSyncEnd",e[e.AfterRenderHooksStart=16]="AfterRenderHooksStart",e[e.AfterRenderHooksEnd=17]="AfterRenderHooksEnd",e[e.ComponentStart=18]="ComponentStart",e[e.ComponentEnd=19]="ComponentEnd",e[e.DeferBlockStateStart=20]="DeferBlockStateStart",e[e.DeferBlockStateEnd=21]="DeferBlockStateEnd",e[e.DynamicComponentStart=22]="DynamicComponentStart",e[e.DynamicComponentEnd=23]="DynamicComponentEnd",e[e.HostBindingsUpdateStart=24]="HostBindingsUpdateStart",e[e.HostBindingsUpdateEnd=25]="HostBindingsUpdateEnd",e})(_||{}),go=class{previousValue;currentValue;firstChange;constructor(t,n,r){this.previousValue=t,this.currentValue=n,this.firstChange=r}isFirstChange(){return this.firstChange}};function yl(e,t,n,r){t!==null?t.applyValueToInputSignal(t,r):e[n]=r}var Dl=null,ua=(()=>{Dl=Pu;let e=()=>Pu;return e.ngInherit=!0,e})();function Wp(){return Dl}function Pu(e){return e.type.prototype.ngOnChanges&&(e.setInput=Zp),qp}function qp(){let e=vl(this),t=e?.current;if(t){let n=e.previous;if(n===bt)e.previous=t;else for(let r in t)n[r]=t[r];e.current=null,this.ngOnChanges(t)}}function Zp(e,t,n,r,o){let i=this.declaredInputs[r],s=vl(e)||Yp(e,{previous:bt,current:null}),a=s.current||(s.current={}),c=s.previous,u=c[i];a[i]=new go(u&&u.currentValue,n,c===bt),yl(e,t,o,n)}var Fs="__ngSimpleChanges__";function vl(e){return Object.hasOwn(e,Fs)&&e[Fs]||null}function Yp(e,t){return e[Fs]=t}var ju=[];var x=function(e,t=null,n){for(let r=0;r=r)break}else t[c]<0&&(e[Mt]+=65536),(a>14>16&&(e[v]&3)===t&&(e[v]+=16384,Vu(a,i)):Vu(a,i)}var vn=-1,Ft=class{factory;name;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(t,n,r,o){this.factory=t,this.name=o,this.canSeeViewProviders=n,this.injectImpl=r}};function Jp(e){return(e.flags&8)!==0}function Xp(e){return(e.flags&16)!==0}function eh(e,t,n){let r=0;for(;rt){s=i-1;break}}}for(;i>16}function yo(e,t){let n=rh(e),r=t;for(;n>0;)r=r[et],n--;return r}var Ps=!0;function Hu(e){let t=Ps;return Ps=e,t}var oh=256,wl=oh-1,Tl=5,ih=0,je={};function sh(e,t,n){let r;typeof n=="string"?r=n.charCodeAt(0)||0:Object.hasOwn(n,wt)&&(r=n[wt]),r==null&&(r=n[wt]=ih++);let o=r&wl,i=1<>Tl)]|=i}function Do(e,t){let n=bl(e,t);if(n!==-1)return n;let r=t[y];r.firstCreatePass&&(e.injectorIndex=t.length,Ms(r.data,e),Ms(t,null),Ms(r.blueprint,null));let o=la(e,t),i=e.injectorIndex;if(Cl(o)){let s=mo(o),a=yo(o,t),c=a[y].data;for(let u=0;u<8;u++)t[i+u]=a[s+u]|c[s+u]}return t[i+8]=o,i}function Ms(e,t){e.push(0,0,0,0,0,0,0,0,t)}function bl(e,t){return e.injectorIndex===-1||e.parent&&e.parent.injectorIndex===e.injectorIndex||t[e.injectorIndex+8]===null?-1:e.injectorIndex}function la(e,t){if(e.parent&&e.parent.injectorIndex!==-1)return e.parent.injectorIndex;let n=0,r=null,o=t;for(;o!==null;){if(r=Al(o),r===null)return vn;if(n++,o=o[et],r.injectorIndex!==-1)return r.injectorIndex|n<<16}return vn}function js(e,t,n){sh(e,t,n)}function _l(e,t,n){if(n&8||e!==void 0)return e;$r(t,"NodeInjector")}function Sl(e,t,n,r){if(n&8&&r===void 0&&(r=null),(n&3)===0){let o=e[Ze],i=se(void 0);try{return o?o.get(t,r,n&8):Qi(t,r,n&8)}finally{se(i)}}return _l(r,t,n)}function Ml(e,t,n,r=0,o){if(e!==null){if(t[v]&2048&&!(r&2)){let s=dh(e,t,n,r,je);if(s!==je)return s}let i=Nl(e,t,n,r,je);if(i!==je)return i}return Sl(t,n,r,o)}function Nl(e,t,n,r,o){let i=uh(n);if(typeof i=="function"){if(!Ds(t,e,r))return r&1?_l(o,n,r):Sl(t,n,r,o);try{let s;if(s=i(r),s==null&&!(r&8))$r(n);else return s}finally{vs()}}else if(typeof i=="number"){let s=null,a=bl(e,t),c=vn,u=r&1?t[ae][re]:null;for((a===-1||r&4)&&(c=a===-1?la(e,t):t[a+8],c===vn||!Uu(r,!1)?a=-1:(s=t[y],a=mo(c),t=yo(c,t)));a!==-1;){let l=t[y];if($u(i,a,l.data)){let d=ah(a,t,n,s,r,u);if(d!==je)return d}c=t[a+8],c!==vn&&Uu(r,t[y].data[a+8]===u)&&$u(i,a,t)?(s=l,a=mo(c),t=yo(c,t)):a=-1}}return o}function ah(e,t,n,r,o,i){let s=t[y],a=s.data[e+8],c=r==null?nt(a)&&Ps:r!=s&&(a.type&3)!==0,u=o&1&&i===a,l=ch(a,s,n,c,u);return l!==null?vo(t,s,l,a,o):je}function ch(e,t,n,r,o){let i=e.providerIndexes,s=t.data,a=i&1048575,c=e.directiveStart,u=e.directiveEnd,l=i>>20,d=r?a:a+l,p=o?a+l:u;for(let f=d;f=c&&h.type===n)return f}if(o){let f=s[c];if(f&&rt(f)&&f.type===n)return c}return null}function vo(e,t,n,r,o){let i=e[n],s=t.data;if(i instanceof Ft){let a=i;if(a.resolving)throw Yi("");let c=Hu(a.canSeeViewProviders);a.resolving=!0;let u=s[n].type||s[n],l,d=a.injectImpl?se(a.injectImpl):null,p=Ds(e,r,0);try{i=e[n]=a.factory(void 0,o,s,e,r),t.firstCreatePass&&n>=r.directiveStart&&Qp(n,s[n],t)}finally{d!==null&&se(d),Hu(c),a.resolving=!1,vs()}}return i}function uh(e){if(typeof e=="string")return e.charCodeAt(0)||0;let t=Object.hasOwn(e,wt)?e[wt]:void 0;return typeof t=="number"?t>=0?t&wl:lh:t}function $u(e,t,n){let r=1<>Tl)]&r)}function Uu(e,t){return!(e&2)&&!(e&1&&t)}var at=class{_tNode;_lView;constructor(t,n){this._tNode=t,this._lView=n}get(t,n,r){return Ml(this._tNode,this._lView,t,Et(r),n)}};function lh(){return new at(oe(),b())}function dh(e,t,n,r,o){let i=e,s=t;for(;i!==null&&s!==null&&s[v]&2048&&!pn(s);){let a=Nl(i,s,n,r|2,je);if(a!==je)return a;r&=-5;let c=i.parent;if(!c){let u=s[os];if(u){let l=u.get(n,je,r);if(l!==je)return l}c=Al(s),s=s[et]}i=c}return o}function Al(e){let t=e[y],n=t.type;return n===2?t.declTNode:n===1?e[re]:null}function Vt(e){return{token:e.token,providedIn:e.autoProvided===!1?null:"root",factory:e.factory,value:void 0}}function fh(){return Ao(oe(),b())}function Ao(e,t){return new rr(Se(e,t))}var rr=(()=>{class e{nativeElement;constructor(n){this.nativeElement=n}static __NG_ELEMENT_ID__=fh}return e})();function xl(e){return(e.flags&128)===128}var da=(function(e){return e[e.OnPush=0]="OnPush",e[e.Eager=1]="Eager",e[e.Default=1]="Default",e})(da||{}),Rl=new Map,ph=0;function hh(){return ph++}function gh(e){Rl.set(e[Vn],e)}function Vs(e){Rl.delete(e[Vn])}var Gu="__ngContext__";function En(e,t){tt(t)?(e[Gu]=t[Vn],gh(t)):e[Gu]=t}function Ol(e){return Ll(e[ln])}function kl(e){return Ll(e[he])}function Ll(e){for(;e!==null&&!ge(e);)e=e[he];return e}var Bs;function fa(e){Bs=e}function Fl(){if(Bs!==void 0)return Bs;if(typeof document<"u")return document;throw new E(210,!1)}var Pl="r";var jl="di";var Vl=!1,Bl=new T("",{factory:()=>Vl});var zu=new WeakMap;function mh(e,t){if(e==null||typeof e!="object")return;let n=zu.get(e);n||(n=new WeakSet,zu.set(e,n)),n.add(t)}var yh=(e,t,n,r)=>{};function Dh(e,t,n,r){yh(e,t,n,r)}function pa(e){return(e.flags&32)===32}var vh=()=>null;function Hl(e,t,n=!1){return vh(e,t,n)}function $l(e,t){let n=e.contentQueries;if(n!==null){let r=g(null);try{for(let o=0;o|^->||--!>|)/g,wh="\u200B$1\u200B";function Th(e){return e.replace(Ih,t=>t.replace(Ch,wh))}function bh(e,t){return e.createText(t)}function _h(e,t,n){e.setValue(t,n)}function Sh(e,t){return e.createComment(Th(t))}function Wl(e,t,n){return e.createElement(t,n)}function Lt(e,t,n,r,o){e.insertBefore(t,n,r,o)}function ql(e,t,n){e.appendChild(t,n)}function Wu(e,t,n,r,o){r!==null?Lt(e,t,n,r,o):ql(e,t,n)}function Zl(e,t,n,r){e.removeChild(null,t,n,r)}function Mh(e,t,n){e.setAttribute(t,"style",n)}function Nh(e,t,n){n===""?e.removeAttribute(t,"class"):e.setAttribute(t,"class",n)}function Yl(e,t,n){let{mergedAttrs:r,classes:o,styles:i}=n;r!==null&&eh(e,t,r),o!==null&&Nh(e,t,o),i!==null&&Mh(e,t,i)}function xo(e){let t=Ah();return t?t.sanitize(Zr.URL,e)||"":Ul(e,"URL")?Yn(e):zl(Hr(e))}function Ah(){let e=b();return e&&e[_e].sanitizer}function xh(e,t,n){let r=e.length;for(;;){let o=e.indexOf(t,n);if(o===-1)return o;if(o===0||e.charCodeAt(o-1)<=32){let i=t.length;if(o+i===r||e.charCodeAt(o+i)<=32)return o}n=o+1}}var Ql="ng-template";function Rh(e,t,n,r){let o=0;if(r){for(;o-1){let i;for(;++oi?d="":d=o[l+1].toLowerCase(),r&2&&u!==d){if(Me(r))return!1;s=!0}}}}return Me(r)||s}function Me(e){return(e&1)===0}function Lh(e,t,n,r){if(t===null)return-1;let o=0;if(r||!n){let i=!1;for(;o-1)for(n++;n0?'="'+a+'"':"")+"]"}else r&8?o+="."+s:r&4&&(o+=" "+s);else o!==""&&!Me(s)&&(t+=qu(i,o),o=""),r=s,i=i||!Me(r);n++}return o!==""&&(t+=qu(i,o)),t}function Bh(e){return e.map(Vh).join(",")}function Hh(e){let t=[],n=[],r=1,o=2;for(;r=0;a--){let{el:c,declarationView:u}=r[a],l=c.parentNode;c===t?(r.splice(a,1),yn.add(c),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}}))):i&&c===i?(r.splice(a,1),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}})),c.parentNode?.removeChild(c)):l&&o&&l!==o&&(s===null||u===null||s===u)&&(r.splice(a,1),c.dispatchEvent(new CustomEvent("animationend",{detail:{cancel:!0}})),c.parentNode?.removeChild(c))}}function Gh(e,t,n){let r=Kl(n),o=$s.get(e);o?o.some(i=>i.el===t)||o.push({el:t,declarationView:r}):$s.set(e,[{el:t,declarationView:r}])}var Ro=(function(e){return e[e.CHANGE_DETECTION=0]="CHANGE_DETECTION",e[e.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",e})(Ro||{}),Ye=new T(""),Zu=new Set;function Bt(e){Zu.has(e)||(Zu.add(e),performance?.mark?.("mark_feature_usage",{detail:{feature:e}}))}var Da=(()=>{class e{impl=null;execute(){this.impl?.execute()}static \u0275prov=Z({token:e,providedIn:"root",factory:()=>new e})}return e})(),va=[0,1,2,3],Jl=(()=>{class e{ngZone=m(V);scheduler=m(qe);errorHandler=m(pe,{optional:!0});sequences=new Set;deferredRegistrations=new Set;executing=!1;constructor(){m(Ye,{optional:!0})}execute(){let n=this.sequences.size>0;n&&x(_.AfterRenderHooksStart),this.executing=!0;for(let r of va)for(let o of this.sequences)if(!(o.erroredOrDestroyed||!o.hooks[r]))try{o.pipelinedValue=this.ngZone.runOutsideAngular(()=>this.maybeTrace(()=>{let i=o.hooks[r];return i(o.pipelinedValue)},o.snapshot))}catch(i){o.erroredOrDestroyed=!0,this.errorHandler?.handleError(i)}this.executing=!1;for(let r of this.sequences)r.afterRun(),r.once&&(this.sequences.delete(r),r.destroy());for(let r of this.deferredRegistrations)this.sequences.add(r);this.deferredRegistrations.size>0&&this.scheduler.notify(7),this.deferredRegistrations.clear(),n&&x(_.AfterRenderHooksEnd)}register(n){let{view:r}=n;r!==void 0?((r[At]??=[]).push(n),hn(r),r[v]|=8192):this.addSequence(n)}addSequence(n){this.executing?this.deferredRegistrations.add(n):this.sequences.add(n),this.scheduler.notify(7)}unregister(n){this.executing&&this.sequences.has(n)?(n.erroredOrDestroyed=!0,n.pipelinedValue=void 0,n.once=!0):(this.sequences.delete(n),this.deferredRegistrations.delete(n))}maybeTrace(n,r){return r?r.run(Ro.AFTER_NEXT_RENDER,n):n()}static \u0275prov=Z({token:e,providedIn:"root",factory:()=>new e})}return e})(),Io=class{impl;hooks;view;once;snapshot;erroredOrDestroyed=!1;pipelinedValue=void 0;unregisterOnDestroy;constructor(t,n,r,o,i,s=null){this.impl=t,this.hooks=n,this.view=r,this.once=o,this.snapshot=s,this.unregisterOnDestroy=i?.onDestroy(()=>this.destroy())}afterRun(){this.erroredOrDestroyed=!1,this.pipelinedValue=void 0,this.snapshot?.dispose(),this.snapshot=null}destroy(){this.impl.unregister(this),this.unregisterOnDestroy?.();let t=this.view?.[At];t&&(this.view[At]=t.filter(n=>n!==this))}};var Us=null,Xl=null;function Yu(e,t,n,r){Us?.maybeQueueEnterAnimation(e,t,n,r)}function Qu(e,t,n,r){Us===null?r(!1):Us.runLeaveAnimationsWithCallback(e,t,n,r)}function zh(e){Xl?.initViewDetachAnimations(e)}function Wh(e){Xl?.clearViewDetachAnimations(e)}function Dn(e,t,n,r,o,i,s,a){if(o!=null){let c,u=!1;ge(o)?c=o:tt(o)&&(u=!0,o=o[be]);let l=Q(o);e===0&&r!==null?(Yu(a,r,i,n),s==null?ql(t,r,l):Lt(t,r,l,s||null,!0)):e===1&&r!==null?(Lt(t,r,l,s||null,!0),Uh(i,l,a),yn.has(l)||Yu(a,r,i,n)):e===2?(a?.[nu]?.leave?.has(i.index)&&Gh(i,l,a),yn.delete(l),Qu(a,i,n,d=>{if(yn.has(l)){yn.delete(l);return}Zl(t,l,u,d)})):e===3&&(yn.delete(l),Qu(a,i,n,()=>{t.destroyNode(l)})),c!=null&&ig(t,e,n,c,i,r,s)}}function qh(e,t){ed(e,t),t[be]=null,t[re]=null}function Zh(e,t,n,r,o,i){r[be]=o,r[re]=t,ko(e,r,n,1,o,i)}function ed(e,t){t[_e].changeDetectionScheduler?.notify(9),ko(e,t,t[F],2,null,null)}function Yh(e){let t=e[ln];if(!t)return Ns(e[y],e);for(;t;){let n=null;if(tt(t))n=t[ln];else{let r=t[B];r&&(n=r)}if(!n){for(;t&&!t[he]&&t!==e;)tt(t)&&Ns(t[y],t),t=t[U];t===null&&(t=e),tt(t)&&Ns(t[y],t),n=t&&t[he]}t=n}}function Ea(e,t){let n=e[$n],r=n.indexOf(t);n.splice(r,1)}function Oo(e,t){if(Rt(t))return;let n=t[F];n.destroyNode&&ko(e,t,n,3,null,null),Yh(t)}function Ns(e,t){if(Rt(t))return;let n=g(null);try{t[v]&=-129,t[v]|=256,t[ce]&&Zt(t[ce]),Kh(e,t),Qh(e,t),t[y].type===1&&t[F].destroy();let r=t[St];if(r!==null&&ge(t[U])){r!==t[U]&&Ea(r,t);let o=t[Nt];o!==null&&o.detachView(e)}Vs(t)}finally{g(n)}}function Qh(e,t){let n=e.cleanup,r=t[un];if(n!==null)for(let s=0;s=0?r[a]():r[-a].unsubscribe(),s+=2}else{let a=r[n[s+1]];n[s].call(a)}r!==null&&(t[un]=null);let o=t[Ge];if(o!==null){t[Ge]=null;for(let s=0;sG&&od(e,t,G,!1);let a=s?_.TemplateUpdateStart:_.TemplateCreateStart;x(a,o,n),n(r,o)}finally{it(i);let a=s?_.TemplateUpdateEnd:_.TemplateCreateEnd;x(a,o,n)}}function Fo(e,t,n){mg(e,t,n),(n.flags&64)===64&&yg(e,t,n)}function or(e,t,n=Se){let r=t.localNames;if(r!==null){let o=t.index+1;for(let i=0;inull;function pg(e){return e==="class"?"className":e==="for"?"htmlFor":e==="formaction"?"formAction":e==="innerHtml"?"innerHTML":e==="readonly"?"readOnly":e==="tabindex"?"tabIndex":e}function hg(e,t,n,r,o,i){let s=t[y];if(Na(e,s,t,n,r)){nt(e)&&gg(t,e.index);return}e.type&3&&(n=pg(n)),sd(e,t,n,r,o,i)}function sd(e,t,n,r,o,i){if(e.type&3){let s=Se(e,t);r=i!=null?i(r,e.value||"",n):r,r=ad(n,s,r),o.setProperty(s,n,r)}else e.type&12}function ad(e,t,n){return e==="src"&&(t.tagName==="IMG"||t.tagName==="VIDEO")?n==null?"":Yn(n):n}function gg(e,t){let n=Pe(t,e);n[v]&16||(n[v]|=64)}function mg(e,t,n){let r=n.directiveStart,o=n.directiveEnd;nt(n)&&ug(t,n,e.data[r+n.componentOffset]),e.firstCreatePass||Do(n,t);let i=n.initialInputs;for(let s=r;s{hn(e.lView)},consumerOnSignalRead(){this.lView[ce]=this}});function Ag(e){let t=e[ce]??Object.create(xg);return t.lView=e,t}var xg=X(q({},Wt),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:e=>{let t=ze(e.lView);for(;t&&!dd(t[y]);)t=ze(t);t&&us(t)},consumerOnSignalRead(){this.lView[ce]=this}});function dd(e){return e.type!==2}function fd(e){if(e[dn]===null)return;let t=!0;for(;t;){let n=!1;for(let r of e[dn])if(r.dirty&&(n=!0,r.zone===null||Zone.current===r.zone?r.run():r.zone.run(()=>r.run()),e[dn]===null))return;t=n&&!!(e[v]&8192)}}var Rg=100;function pd(e,t=0){let r=e[_e].rendererFactory,o=!1;o||r.begin?.();try{Og(e,t)}finally{o||r.end?.()}}function Og(e,t){let n=gs();try{ms(!0),Ws(e,t);let r=0;for(;Un(e);){if(r===Rg)throw new E(103,!1);r++,Ws(e,1)}}finally{ms(n)}}function kg(e,t,n,r){if(Rt(t))return;let o=t[v],i=!1,s=!1;to(t);let a=!0,c=null,u=null;i||(dd(e)?(u=_g(t),c=gt(u)):wr()===null?(a=!1,u=Ag(t),c=gt(u)):t[ce]&&(Zt(t[ce]),t[ce]=null));try{cs(t),vu(e.bindingStartIndex),n!==null&&id(e,t,n,2,r);let l=(o&3)===3;if(!i)if(l){let f=e.preOrderCheckHooks;f!==null&&lo(t,f,null)}else{let f=e.preOrderHooks;f!==null&&fo(t,f,0,null),Ss(t,0)}if(s||Lg(t),fd(t),gd(t,0),e.contentQueries!==null&&$l(e,t),!i)if(l){let f=e.contentCheckHooks;f!==null&&lo(t,f)}else{let f=e.contentHooks;f!==null&&fo(t,f,1),Ss(t,1)}Pg(e,t);let d=e.components;d!==null&&yd(t,d,0);let p=e.viewQuery;if(p!==null&&Hs(2,p,r),!i)if(l){let f=e.viewCheckHooks;f!==null&&lo(t,f)}else{let f=e.viewHooks;f!==null&&fo(t,f,2),Ss(t,2)}if(e.firstUpdatePass===!0&&(e.firstUpdatePass=!1),t[qr]){for(let f of t[qr])f();t[qr]=null}i||(ud(t),t[v]&=-73)}catch(l){hd(t,l,i)}finally{u!==null&&(qt(u,c),a&&Mg(u)),no()}}function hd(e,t,n){let r=!1,o=t,i=e,s=g(null);try{for(;i!==null;){if(ge(i)){i=i[U];continue}let a=i[Bn];if(a)try{let c=e[ae][P],u=c?.constructor,l={declarationInstance:c,declarationType:u,caughtBy:a},d=g(null);try{a(ku(o),l)}finally{g(d)}r=!0;break}catch(c){o=c}i=i[U]}}finally{g(s)}if(!r)throw n||hn(e),o}function gd(e,t){for(let n=Ol(e);n!==null;n=kl(n))for(let r=B;r0&&(e[n-1][he]=r[he]);let i=Fn(e,B+t);qh(r[y],r);let s=i[Nt];s!==null&&s.detachView(i[y]),r[U]=null,r[he]=null,r[v]&=-129}return r}function jg(e,t,n,r){let o=B+r,i=n.length;r>0&&(n[o-1][he]=t),r-1&&(Jn(t,r),Fn(n,r))}this._attachedToViewContainer=!1}Oo(this._lView[y],this._lView)}onDestroy(t){Jr(this._lView,t)}markForCheck(){xa(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[v]&=-129}reattach(){Kr(this._lView),this._lView[v]|=128}detectChanges(){this._lView[v]|=1024,pd(this._lView)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new E(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let t=pn(this._lView),n=this._lView[St];n!==null&&!t&&Ea(n,this._lView),ed(this._lView[y],this._lView)}attachToAppRef(t){if(this._attachedToViewContainer)throw new E(902,!1);this._appRef=t;let n=pn(this._lView),r=this._lView[St];r!==null&&!n&&Id(r,this._lView),Kr(this._lView)}};var Ra=(()=>{class e{_declarationLView;_declarationTContainer;elementRef;static __NG_ELEMENT_ID__=Vg;constructor(n,r,o){this._declarationLView=n,this._declarationTContainer=r,this.elementRef=o}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(n,r){return this.createEmbeddedViewImpl(n,r)}createEmbeddedViewImpl(n,r,o){let i=Po(this._declarationLView,this._declarationTContainer,n,{embeddedViewInjector:r,dehydratedView:o});return new In(i)}}return e})();function Vg(){return Cd(oe(),b())}function Cd(e,t){return e.type&4?new Ra(t,e,Ao(e,t)):null}function ir(e,t,n,r,o){let i=e.data[t];if(i===null)i=Bg(e,t,n,r,o),Iu()&&(i.flags|=32);else if(i.type&64){i.type=n,i.value=r,i.attrs=o;let s=gu();i.injectorIndex=s===null?-1:s.injectorIndex}return gn(i,!0),i}function Bg(e,t,n,r,o){let i=ps(),s=hs(),a=s?i:i&&i.parent,c=e.data[t]=$g(e,a,n,t,r,o);return Hg(e,c,i,s),c}function Hg(e,t,n,r){e.firstChild===null&&(e.firstChild=t),n!==null&&(r?n.child==null&&t.parent!==null&&(n.child=t):n.next===null&&(n.next=t,t.prev=n))}function $g(e,t,n,r,o,i){let s=t?t.injectorIndex:-1,a=0;return hu()&&(a|=128),{type:n,index:r,insertBeforeIndex:null,injectorIndex:s,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,controlDirectiveIndex:-1,customControlIndex:-1,propertyBindings:null,flags:a,providerIndexes:0,value:o,namespace:Es(),attrs:i,mergedAttrs:null,localNames:null,initialInputs:null,inputs:null,hostDirectiveInputs:null,outputs:null,hostDirectiveOutputs:null,directiveToIndex:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:t,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}function Ug(e){let t=e[is]??[],r=e[U][F],o=[];for(let i of t)i.data[jl]!==void 0?o.push(i):Gg(i,r);e[is]=o}function Gg(e,t){let n=0,r=e.firstChild;if(r){let o=e.data[Pl];for(;nnull,Wg=()=>null;function qs(e,t){return zg(e,t)}function wd(e,t,n){return Wg(e,t,n)}var Td=class{},Pt=class{};var bd=(()=>{class e{static \u0275prov=Z({token:e,providedIn:"root",factory:()=>null})}return e})();function _d(e){return e.debugInfo?.className||e.type.name||null}var po={},Co=class{injector;parentInjector;constructor(t,n){this.injector=t,this.parentInjector=n}get(t,n,r){let o=this.injector.get(t,po,r);return o!==po||n===po?o:this.parentInjector.get(t,n,r)}};function qg(e,t,n){return e[t]=n}function ct(e,t,n){if(n===Be)return!1;let r=e[t];return Object.is(r,n)?!1:(e[t]=n,!0)}function ho(e,t,n){return function r(o){let i=r.__ngNativeEl__;i!==void 0&&mh(o,i);let s=nt(e)?Pe(e.index,t):t;xa(s,5);let a=t[P],c=Ju(t,a,n,o),u=r.__ngNextListenerFn__;for(;u;)c=Ju(t,a,u,o)&&c,u=u.__ngNextListenerFn__;return c}}function Ju(e,t,n,r){let o=g(null);try{return x(_.OutputStart,t,n),n(r)!==!1}catch(i){return Cg(e,i),!1}finally{x(_.OutputEnd,t,n),g(o)}}function Sd(e,t,n,r,o,i,s,a){let c=fn(e),u=!1,l=null;if(!r&&c&&(l=Yg(t,n,i,e.index)),l!==null){let d=l.__ngLastListenerFn__||l;d.__ngNextListenerFn__=s,l.__ngLastListenerFn__=s,u=!0}else{let d=Se(e,n),p=r?r(d):d;Dh(n,p,i,a),r||(a.__ngNativeEl__=d);let f=o.listen(p,i,a);if(!Zg(i)){let h=r?L=>r(Q(L[e.index])):e.index;Md(h,t,n,i,a,f,!1)}}return u}function Zg(e){return e.startsWith("animation")||e.startsWith("transition")}function Yg(e,t,n,r){let o=e.cleanup;if(o!=null)for(let i=0;ic?a[c]:null}typeof s=="string"&&(i+=2)}return null}function Md(e,t,n,r,o,i,s){let a=t.firstCreatePass?du(t):null,c=lu(n),u=c.length;c.push(o,i),a&&a.push(r,e,u,(u+1)*(s?-1:1))}function Xu(e,t,n,r,o,i){let s=t[n],a=t[y],u=a.data[n].outputs[r],d=s[u].subscribe(i);Md(e.index,a,t,o,i,d,!0)}var Zs=Symbol("BINDING");var Ht=new T("");function wo(e,t,n){let r=n?e.styles:null,o=n?e.classes:null,i=0;if(t!==null)for(let s=0;s0&&(n.directiveToIndex=new Map);for(let p=0;p0;){let n=e[--t];if(typeof n=="number"&&n<0)return n}return 0}function rm(e,t,n){if(n){if(t.exportAs)for(let r=0;r{let[n,r,o]=e[t],i={propName:n,templateName:t,isSignal:(r&Lo.SignalBased)!==0};return o&&(i.transform=o),i})}function cm(e){return Object.keys(e).map(t=>({propName:e[t],templateName:t}))}function um(e,t,n){let r=t instanceof we?t:t?.injector;return r&&e.getStandaloneInjector!==null&&(r=e.getStandaloneInjector(r)||r),r?new Co(n,r):n}function lm(e){let t=e.get(Pt,null);if(t===null)throw new E(407,!1);let n=e.get(bd,null),r=e.get(qe,null),o=e.get(Ye,null,{optional:!0});return{rendererFactory:t,sanitizer:n,changeDetectionScheduler:r,ngReflect:!1,tracingService:o}}function dm(e,t,n){let r=Rd(e);return Wl(t,r,r==="svg"?ou:r==="math"?iu:n)}function fm(e){if((e&&"localName"in e&&typeof e.localName=="string"?e.localName:e?.tagName)?.toLowerCase()==="script")throw new E(905,!1)}function Rd(e){return(e.selectors[0][0]||"div").toLowerCase()}var Xn=class{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=am(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=cm(this.componentDef.outputs),this.cachedOutputs}constructor(t,n){this.componentDef=t,this.ngModule=n,this.componentType=t.type,this.selector=Bh(t.selectors),this.ngContentSelectors=t.ngContentSelectors??[],this.isBoundToModule=!!n}create(t,n,r,o,i,s,a,c){x(_.DynamicComponentStart);let u=g(null);try{let l=this.componentDef,d=um(l,o||this.ngModule,t),p=lm(d),f=p.tracingService;return f&&f.componentCreate?f.componentCreate(_d(l),()=>this.createComponentRef(p,d,n,r,i,s,a,c)):this.createComponentRef(p,d,n,r,i,s,a,c)}finally{g(u)}}createComponentRef(t,n,r,o,i,s,a,c){let u=this.componentDef,l=pm(o,u,s,i,c),d=t.rendererFactory.createRenderer(null,u),p=o?lg(d,o,u.encapsulation,n):dm(u,d,a??null);fm(p);let f=n.get(Ht,null),h=hm(p,()=>n.get(ye,null)??Fl());f&&f.addHost(h);let L=s?.some(rl)||i?.some(j=>typeof j!="function"&&j.bindings.some(rl)),N=Ta(null,l,null,512|nd(u),null,null,t,d,n,null,Hl(p,n,!0));f&&xd&&h instanceof ShadowRoot&&Jr(N,()=>{f.removeHost(h)}),N[G]=p,to(N);let W=null;try{let j=Oa(G,N,2,"#host",()=>l.directiveRegistry,!0,0);Yl(d,p,j),En(p,N),Fo(l,N,j),ha(l,j,N),ka(l,j),r!==void 0&&mm(j,this.ngContentSelectors,r),W=Pe(j.index,N),N[P]=W[P],Aa(l,N,null)}catch(j){throw W!==null&&Vs(W),Vs(N),j}finally{x(_.DynamicComponentEnd),no()}return new To(this.componentType,N,!!L)}};function pm(e,t,n,r,o){let i=e?["ng-version","22.2.4"]:Hh(t.selectors[0]),s=null,a=null,c=0;if(n)for(let d of n)c+=d[Zs].requiredVars,d.create&&(d.targetIdx=0,(s??=[]).push(d)),d.update&&(d.targetIdx=0,(a??=[]).push(d));if(r)for(let d=0;d{if(n&1&&e)for(let r of e)r.create();if(n&2&&t)for(let r of t)r.update()}}function rl(e){let t=e[Zs].kind;return t==="input"||t==="twoWay"}var To=class extends Td{_rootLView;_hasInputBindings;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(t,n,r){super(),this._rootLView=n,this._hasInputBindings=r,this._tNode=Yr(n[y],G),this.location=Ao(this._tNode,n),this.instance=Pe(this._tNode.index,n)[P],this.hostView=this.changeDetectorRef=new In(n,void 0),this.componentType=t}setInput(t,n){this._hasInputBindings;let r=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(t)&&Object.is(this.previousInputValues.get(t),n))return;let o=this._rootLView,i=Na(r,o[y],o,t,n);this.previousInputValues.set(t,n);let s=Pe(r.index,o);xa(s,1)}get injector(){return new at(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(t){this.hostView.onDestroy(t)}};function mm(e,t,n){let r=e.projection=[];for(let o=0;o{class e{static __NG_ELEMENT_ID__=ym}return e})();function ym(){let e=oe();return Dm(e,b())}var Ys=class e extends Vo{_lContainer;_hostTNode;_hostLView;constructor(t,n,r){super(),this._lContainer=t,this._hostTNode=n,this._hostLView=r}get element(){return Ao(this._hostTNode,this._hostLView)}get injector(){return new at(this._hostTNode,this._hostLView)}get parentInjector(){let t=la(this._hostTNode,this._hostLView);if(Cl(t)){let n=yo(t,this._hostLView),r=mo(t),o=n[y].data[r+8];return new at(o,n)}else return new at(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(t){let n=ol(this._lContainer);return n!==null&&n[t]||null}get length(){return this._lContainer.length-B}createEmbeddedView(t,n,r){let o,i,s;typeof r=="number"?o=r:r!=null&&(o=r.index,i=r.injector,s=r.onError);let a=qs(this._lContainer,t.ssrId),c=t.createEmbeddedViewImpl(n||{},i,a);return s&&(c._lView[Bn]=s),this.insertImpl(c,o,Qn(this._hostTNode,a)),c}createComponent(t,n,r,o,i,s,a){let c,u,l=n||{};c=l.index,r=l.injector,o=l.projectableNodes,i=l.environmentInjector||l.ngModuleRef,s=l.directives,a=l.bindings,u=l.onError;let d=new Xn(Tt(t)),p=r||this.parentInjector;if(!i&&d.ngModule==null){let j=this.parentInjector.get(we,null);j&&(i=j)}let f=Tt(d.componentType??{}),h=qs(this._lContainer,f?.id??null),L=h?.firstChild??null,N=d.create(p,o,L,i,s,a,this._getHostElementNamespace());return u&&(N.hostView._lView[Bn]=u),this.insertImpl(N.hostView,c,Qn(this._hostTNode,h)),N}_getHostElementNamespace(){if(this._hostTNode.type&2){let t=this._hostTNode.parent??this._hostLView[re];return t!==null&&t.type&2&&typeof t.value=="string"&&t.value.toLowerCase()==="foreignobject"?null:t?.namespace??null}return this._hostTNode.namespace}insert(t,n){return this.insertImpl(t,n,!0)}insertImpl(t,n,r){let o=t._lView;if(au(o)){let a=this.indexOf(t);if(a!==-1)this.detach(a);else{let c=o[U],u=new e(c,c[re],c[U]);u.detach(u.indexOf(t))}}let i=this._adjustIndex(n),s=this._lContainer;return jo(s,o,i,r),t.attachToViewContainerRef(),Ki(As(s),i,t),t}move(t,n){return this.insert(t,n)}indexOf(t){let n=ol(this._lContainer);return n!==null?n.indexOf(t):-1}remove(t){let n=this._adjustIndex(t,-1),r=Jn(this._lContainer,n);r&&(Fn(As(this._lContainer),n),Oo(r[y],r))}detach(t){let n=this._adjustIndex(t,-1),r=Jn(this._lContainer,n);return r&&Fn(As(this._lContainer),n)!=null?new In(r):null}_adjustIndex(t,n=0){return t??this.length+n}};function ol(e){return e[Hn]}function As(e){return e[Hn]||(e[Hn]=[])}function Dm(e,t){let n,r=t[e.index];return ge(r)?n=r:(n=Dd(r,t,null,e),t[e.index]=n,ba(t,n)),Em(n,t,e,r),new Ys(n,e,t)}function vm(e,t){let n=e[F],r=n.createComment(""),o=Se(t,e),i=n.parentNode(o);return Lt(n,i,r,n.nextSibling(o),!1),r}var Em=wm,Im=()=>!1;function Cm(e,t,n){return Im(e,t,n)}function wm(e,t,n,r){if(e[xt])return;let o;n.type&8?o=Q(r):o=vm(t,n),e[xt]=o}function Bo(e){return!!e&&typeof e.then=="function"}function La(e){return!!e&&typeof e.subscribe=="function"}var er=class{};var tr=class extends er{injector;instance=null;constructor(t){super();let n=new Ct([...t.providers,{provide:er,useValue:this}],t.parent||jn(),t.debugName,new Set(["environment"]));this.injector=n,t.runEnvironmentInitializers&&n.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(t){this.injector.onDestroy(t)}};function Od(e,t,n=null){return new tr({providers:e,parent:t,debugName:n,runEnvironmentInitializers:!0}).injector}var Tm=(()=>{class e{_injector;cachedInjectors=new Map;constructor(n){this._injector=n}getOrCreateStandaloneInjector(n){if(!n.standalone)return null;if(!this.cachedInjectors.has(n)){let r=es(!1,n.type),o=r.length>0?Od([r],this._injector,""):null;this.cachedInjectors.set(n,o)}return this.cachedInjectors.get(n)}ngOnDestroy(){try{for(let n of this.cachedInjectors.values())n!==null&&n.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=Z({token:e,providedIn:"environment",factory:()=>new e(A(we))})}return e})();function J(e){return ca(()=>{let t=kd(e),n=X(q({},t),{decls:e.decls,vars:e.vars,template:e.template,consts:e.consts||null,ngContentSelectors:e.ngContentSelectors,onPush:e.changeDetection!==da.Eager,directiveDefs:null,pipeDefs:null,dependencies:t.standalone&&e.dependencies||null,getStandaloneInjector:t.standalone?o=>o.get(Tm).getOrCreateStandaloneInjector(n):null,getExternalStyles:null,signals:e.signals??!1,data:e.data||{},encapsulation:e.encapsulation||Ne.Emulated,styles:e.styles||Xe,_:null,schemas:e.schemas||null,tView:null,id:""});t.standalone&&Bt("NgStandalone"),Ld(n);let r=e.dependencies;return n.directiveDefs=il(r,bm),n.pipeDefs=il(r,zc),n.id=Mm(n),n})}function bm(e){return Tt(e)||Br(e)}function _m(e,t){if(e==null)return bt;let n={};for(let r in e)if(Object.hasOwn(e,r)){let o=e[r],i,s,a,c;Array.isArray(o)?(a=o[0],i=o[1],s=o[2]??i,c=o[3]||null):(i=o,s=o,a=Lo.None,c=null),n[i]=[r,a,c],t[i]=s}return n}function Sm(e){if(e==null)return bt;let t={};for(let n in e)Object.hasOwn(e,n)&&(t[e[n]]=n);return t}function Fa(e){return ca(()=>{let t=kd(e);return Ld(t),t})}function kd(e){let t={};return{type:e.type,providersResolver:null,viewProvidersResolver:null,factory:null,hostBindings:e.hostBindings||null,hostVars:e.hostVars||0,hostAttrs:e.hostAttrs||null,contentQueries:e.contentQueries||null,declaredInputs:t,inputConfig:e.inputs||bt,exportAs:e.exportAs||null,standalone:e.standalone??!0,signals:e.signals===!0,selectors:e.selectors||Xe,viewQuery:e.viewQuery||null,features:e.features||null,setInput:null,resolveHostDirectives:null,hostDirectives:null,controlDef:null,signalFormsInputPresence:null,inputs:_m(e.inputs,t),outputs:Sm(e.outputs),debugInfo:null}}function Ld(e){e.features?.forEach(t=>t(e))}function il(e,t){return e?()=>{let n=typeof e=="function"?e():e,r=[];for(let o of n){let i=t(o);i!==null&&r.push(i)}return r}:null}function Mm(e){let t=0,n=typeof e.consts=="function"?"":e.consts,r=[e.selectors,e.ngContentSelectors,e.hostVars,e.hostAttrs,n,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];for(let i of r.join("|"))t=Math.imul(31,t)+i.charCodeAt(0)<<0;return t+=2147483648,"c"+t}var Fd=new T("");var Pa=(()=>{class e{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((n,r)=>{this.resolve=n,this.reject=r});appInits=m(Fd,{optional:!0})??[];injector=m(Te);constructor(){}runInitializers(){if(this.initialized)return;let n=[];for(let o of this.appInits){let i=Wr(this.injector,o);if(Bo(i))n.push(i);else if(La(i)){let s=new Promise((a,c)=>{i.subscribe({complete:a,error:c})});n.push(s)}}let r=()=>{this.done=!0,this.resolve()};Promise.all(n).then(()=>{r()}).catch(o=>{this.reject(o)}),n.length===0&&r(),this.initialized=!0}static \u0275fac=function(r){return new(r||e)};static \u0275prov=Vt({token:e,factory:e.\u0275fac})}return e})();function Pd(e,t,n,r,o,i,s,a){if(n.firstCreatePass){e.mergedAttrs=No(e.mergedAttrs,e.attrs);let l=e.tView=wa(2,e,o,i,s,n.directiveRegistry,n.pipeRegistry,null,n.schemas,n.consts,null);n.queries!==null&&(n.queries.template(n,e),l.queries=n.queries.embeddedTView(e))}a&&(e.flags|=a),gn(e,!1);let c=Am(n,t,e,r);oo()&&Ia(n,t,c,e),En(c,t);let u=Dd(c,t,c,e);t[r+G]=u,ba(t,u),Cm(u,e,t)}function Nm(e,t,n,r,o,i,s,a,c,u,l){let d=n+G,p;return t.firstCreatePass?(p=ir(t,d,4,s||null,a||null),Xr()&&Nd(t,e,p,me(t.consts,u),_a),El(t,p)):p=t.data[d],Pd(p,e,t,n,r,o,i,c),fn(p)&&Fo(t,e,p),u!=null&&or(e,p,l),p}function bo(e,t,n,r,o,i,s,a,c,u,l){let d=n+G,p;if(t.firstCreatePass){if(p=ir(t,d,4,s||null,a||null),u!=null){let f=me(t.consts,u);p.localNames=[];for(let h=0;h{let t="";throw new E(-600,t)})}var Rm=10;var sr=(()=>{class e{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=m(st);afterRenderManager=m(Da);zonelessEnabled=m(mn);rootEffectScheduler=m(_s);dirtyFlags=0;tracingSnapshot=null;allTestViews=new Set;autoDetectTestViews=new Set;includeAllTestViews=!1;afterTick=new Ce;get allViews(){return[...(this.includeAllTestViews?this.allTestViews:this.autoDetectTestViews).keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];internalPendingTask=m(kt);get isStable(){return this.internalPendingTask.hasPendingTasksObservable.pipe(bi(n=>!n))}constructor(){m(Ye,{optional:!0})}whenStable(){let n;return new Promise(r=>{n=this.isStable.subscribe({next:o=>{o&&r()}})}).finally(()=>{n.unsubscribe()})}_injector=m(we);_rendererFactory=null;get injector(){return this._injector}bootstrap(n,r){return this.bootstrapImpl(n,r)}bootstrapImpl(n,r,o=Te.NULL){return this._injector.get(V).run(()=>{if(x(_.BootstrapComponentStart),!this._injector.get(Pa).done){let W="";throw new E(405,W)}let a=Tt(n),c=this._injector.get(er),u=new Xn(a,c);this.componentTypes.push(n);let{hostElement:l,directives:d,bindings:p}=Om(r),f=l||u.selector,h=u.create(o,[],f,c.injector,d,p),L=h.location.nativeElement,N=h.injector.get(ja,null);return N?.registerApplication(L),h.onDestroy(()=>{this.detachView(h.hostView),Zn(this.components,h),N?.unregisterApplication(L)}),this._loadComponent(h),x(_.BootstrapComponentEnd,h),h})}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){x(_.ChangeDetectionStart),this.tracingSnapshot!==null?this.tracingSnapshot.run(Ro.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw x(_.ChangeDetectionEnd),new E(101,!1);let n=g(null);try{this._runningTick=!0,this.synchronize()}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,g(n),this.afterTick.next(),x(_.ChangeDetectionEnd)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(Pt,null,{optional:!0}));let n=0;for(;this.dirtyFlags!==0&&n++Un(n))){this.dirtyFlags|=2;return}else this.dirtyFlags&=-8}attachView(n){let r=n;this._views.push(r),r.attachToAppRef(this)}detachView(n){let r=n;Zn(this._views,r),r.detachFromAppRef()}_loadComponent(n){this.attachView(n.hostView);try{this.tick()}catch(o){this.internalErrorHandler(o)}this.components.push(n),this._injector.get(jd,[]).forEach(o=>o(n))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(n=>n()),this._views.slice().forEach(n=>n.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(n){return this._destroyListeners.push(n),()=>Zn(this._destroyListeners,n)}destroy(){if(this._destroyed)throw new E(406,!1);let n=this._injector;n.destroy&&!n.destroyed&&n.destroy()}get viewCount(){return this._views.length}static \u0275fac=function(r){return new(r||e)};static \u0275prov=Vt({token:e,factory:e.\u0275fac})}return e})();function Om(e){return e===void 0||typeof e=="string"||e instanceof Element?{hostElement:e}:e}function Zn(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function He(e,t,n,r){let o=b(),i=Ot();if(ct(o,i,t)){let s=K(),a=ro();vg(a,o,e,t,n,r)}return He}var Qs=class{destroy(t){}updateValue(t,n){}swap(t,n){let r=Math.min(t,n),o=Math.max(t,n),i=this.detach(o);if(o-r>1){let s=this.detach(r);this.attach(r,i),this.attach(o,s)}else this.attach(r,i)}move(t,n){this.attach(n,this.detach(t))}};function xs(e,t,n,r,o){return e===n&&Object.is(t,r)?1:Object.is(o(e,t),o(n,r))?-1:0}function km(e,t,n,r){let o,i,s=0,a=e.length-1,c=void 0;if(Array.isArray(t)){g(r);let u=t.length-1;for(g(null);s<=a&&s<=u;){let l=e.at(s),d=t[s],p=xs(s,l,s,d,n);if(p!==0){p<0&&e.updateValue(s,d),s++;continue}let f=e.at(a),h=t[u],L=xs(a,f,u,h,n);if(L!==0){L<0&&e.updateValue(a,h),a--,u--;continue}let N=n(s,l),W=n(a,f),j=n(s,d);if(Object.is(j,W)){let li=n(u,h);Object.is(li,N)?(e.swap(s,a),e.updateValue(a,h),u--,a--):e.move(a,s),e.updateValue(s,d),s++;continue}if(o??=new _o,i??=al(e,s,a,n),Ks(e,o,s,j))e.updateValue(s,d),s++,a++;else if(i.has(j))o.set(N,e.detach(s)),a--;else{let li=e.create(s,t[s]);e.attach(s,li),s++,a++}}for(;s<=u;)sl(e,o,n,s,t[s]),s++}else if(t!=null){g(r);let u=t[Symbol.iterator]();g(null);let l=u.next();for(;!l.done&&s<=a;){let d=e.at(s),p=l.value,f=xs(s,d,s,p,n);if(f!==0)f<0&&e.updateValue(s,p),s++,l=u.next();else{o??=new _o,i??=al(e,s,a,n);let h=n(s,p);if(Ks(e,o,s,h))e.updateValue(s,p),s++,a++,l=u.next();else if(!i.has(h))e.attach(s,e.create(s,p)),s++,a++,l=u.next();else{let L=n(s,d);o.set(L,e.detach(s)),a--}}}for(;!l.done;)sl(e,o,n,e.length,l.value),l=u.next()}for(;s<=a;)e.destroy(e.detach(a--));o?.forEach(u=>{e.destroy(u)})}function Ks(e,t,n,r){return t!==void 0&&t.has(r)?(e.attach(n,t.get(r)),t.delete(r),!0):!1}function sl(e,t,n,r,o){if(Ks(e,t,r,n(r,o)))e.updateValue(r,o);else{let i=e.create(r,o);e.attach(r,i)}}function al(e,t,n,r){let o=new Set;for(let i=t;i<=n;i++)o.add(r(i,e.at(i)));return o}var _o=class{kvMap=new Map;_vMap=void 0;has(t){return this.kvMap.has(t)}delete(t){if(!this.has(t))return!1;let n=this.kvMap.get(t);return this._vMap!==void 0&&this._vMap.has(n)?(this.kvMap.set(t,this._vMap.get(n)),this._vMap.delete(n)):this.kvMap.delete(t),!0}get(t){return this.kvMap.get(t)}set(t,n){if(this.kvMap.has(t)){let r=this.kvMap.get(t);this._vMap===void 0&&(this._vMap=new Map);let o=this._vMap;for(;o.has(r);)r=o.get(r);o.set(r,n)}else this.kvMap.set(t,n)}forEach(t){for(let[n,r]of this.kvMap)if(t(r,n),this._vMap!==void 0){let o=this._vMap;for(;o.has(r);)r=o.get(r),t(r,n)}}};function Ae(e,t,n,r,o,i,s,a){Bt("NgControlFlow");let c=b(),u=K(),l=me(u.consts,i);return bo(c,u,e,t,n,r,o,l,256,s,a),Va}function Va(e,t,n,r,o,i,s,a){return Bt("NgControlFlow"),Lm(e,t,n,r,o,i,s,a),Va}function Lm(e,t,n,r,o,i,s,a){let c=b(),u=K(),l=me(u.consts,i);bo(c,u,e,t,n,r,o,l,512,s,a)}function xe(e,t){Bt("NgControlFlow");let n=b(),r=Ot(),o=n[r]!==Be?n[r]:-1,i=o!==-1?So(n,G+o):void 0,s=0;if(ct(n,r,e)){let a=g(null);try{if(i!==void 0&&Ed(i,s),e!==-1){let c=G+e,u=So(n,c),l=ta(n[y],c),d=wd(u,l,n),p=Po(n,l,t,{dehydratedView:d});jo(u,p,s,Qn(l,d))}}finally{g(a)}}else if(i!==void 0){let a=vd(i,s);a!==void 0&&(a[P]=t)}}var Js=class{lContainer;$implicit;$index;constructor(t,n,r){this.lContainer=t,this.$implicit=n,this.$index=r}get $count(){return this.lContainer.length-B}};function ar(e){return e}var Xs=class{hasEmptyBlock;trackByFn;liveCollection;constructor(t,n,r){this.hasEmptyBlock=t,this.trackByFn=n,this.liveCollection=r}};function de(e,t,n,r,o,i,s,a,c,u,l,d,p){Bt("NgControlFlow");let f=b(),h=K(),L=c!==void 0,N=b(),W=a?s.bind(N[ae][P]):s,j=new Xs(L,W);N[G+e]=j,bo(f,h,e+1,t,n,r,o,me(h.consts,i),256),L&&bo(f,h,e+2,c,u,l,d,me(h.consts,p),512)}var ea=class extends Qs{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(t,n,r){super(),this.lContainer=t,this.hostLView=n,this.templateTNode=r}get length(){return this.lContainer.length-B}at(t){return this.getLView(t)[P].$implicit}attach(t,n){let r=n[cn];this.needsIndexUpdate||=t!==this.length,jo(this.lContainer,n,t,Qn(this.templateTNode,r)),Fm(this.lContainer,t)}detach(t){return this.needsIndexUpdate||=t!==this.length-1,Pm(this.lContainer,t),jm(this.lContainer,t)}create(t,n){let r=qs(this.lContainer,this.templateTNode.tView.ssrId);return Po(this.hostLView,this.templateTNode,new Js(this.lContainer,n,t),{dehydratedView:r})}destroy(t){Oo(t[y],t)}updateValue(t,n){this.getLView(t)[P].$implicit=n}reset(){this.needsIndexUpdate=!1}updateIndexes(){if(this.needsIndexUpdate)for(let t=0;t(ul(e,t,o,a,r),I))}}return ul(e,t,o,a,r),I}function ul(e,t,n,r,o){if(Sa(r,n,e,t,Bd),fn(r)){let i=n[y];Fo(i,n,r),ha(i,r,n)}o!=null&&or(n,r)}function w(){let e=K(),t=oe(),n=Ma(t);return e.firstCreatePass&&ka(e,n),ds(n)&&fs(),ls(),n.classesWithoutHost!=null&&Jp(n)&&cl(e,n,b(),n.classesWithoutHost,!0),n.stylesWithoutHost!=null&&Xp(n)&&cl(e,n,b(),n.stylesWithoutHost,!1),w}function De(e,t,n,r){return I(e,t,n,r),w(),De}function ve(e,t,n,r){let o=b(),i=o[y],s=e+G,a=i.firstCreatePass?im(s,i,2,t,n,r):i.data[s];return Sa(a,o,e,t,Bd),r!=null&&or(o,a),ve}function Ee(){let e=oe(),t=Ma(e);return ds(t)&&fs(),ls(),Ee}var Bd=(e,t,n,r,o)=>(Gn(!0),Wl(t[F],r,Es()));function cr(e,t,n){let r=b(),o=r[y],i=e+G,s=o.firstCreatePass?Oa(i,r,8,"ng-container",_a,Xr(),t,n):o.data[i];if(Sa(s,r,e,"ng-container",Bm),fn(s)){let a=r[y];Fo(a,r,s),ha(a,s,r)}return n!=null&&or(r,s),cr}function ur(){let e=K(),t=oe(),n=Ma(t);return e.firstCreatePass&&ka(e,n),ur}function Tn(e,t,n){return cr(e,t,n),ur(),Tn}var Bm=(e,t,n,r,o)=>(Gn(!0),Sh(t[F],""));function Re(){return b()}function Ut(e,t,n){let r=b(),o=Ot();if(ct(r,o,t)){let i=K(),s=ro();sd(s,r,e,t,r[F],n)}return Ut}var lr="en-US";var Hm=lr;function Hd(e){typeof e=="string"&&(Hm=e.toLowerCase().replace(/_/g,"-"))}function z(e,t,n){let r=b(),o=K(),i=oe();return $m(o,r,r[F],i,e,t,n),z}function Ho(e,t,n){let r=b(),o=K(),i=oe();return(i.type&3||n)&&Sd(i,o,r,n,r[F],e,t,ho(i,r,t)),Ho}function $m(e,t,n,r,o,i,s){let a=!0,c=null;if((r.type&3||s)&&(c??=ho(r,t,i),Sd(r,e,t,s,n,o,i,c)&&(a=!1)),a){let u=r.outputs?.[o],l=r.hostDirectiveOutputs?.[o];if(l&&l.length)for(let d=0;d>17&32767}function Um(e){return(e&2)==2}function Gm(e,t){return e&131071|t<<17}function na(e){return e|2}function Cn(e){return(e&131068)>>2}function Rs(e,t){return e&-131069|t<<2}function zm(e){return(e&1)===1}function ra(e){return e|1}function Wm(e,t,n,r,o,i){let s=i?t.classBindings:t.styleBindings,a=jt(s),c=Cn(s);e[r]=n;let u=!1,l;if(Array.isArray(n)){let d=n;l=d[1],(l===null||an(d,l)>0)&&(u=!0)}else l=n;if(o)if(c!==0){let p=jt(e[a+1]);e[r+1]=uo(p,a),p!==0&&(e[p+1]=Rs(e[p+1],r)),e[a+1]=Gm(e[a+1],r)}else e[r+1]=uo(a,0),a!==0&&(e[a+1]=Rs(e[a+1],r)),a=r;else e[r+1]=uo(c,0),a===0?a=r:e[c+1]=Rs(e[c+1],r),c=r;u&&(e[r+1]=na(e[r+1])),ll(e,l,r,!0),ll(e,l,r,!1),qm(t,l,e,r,i),s=uo(a,c),i?t.classBindings=s:t.styleBindings=s}function qm(e,t,n,r,o){let i=o?e.residualClasses:e.residualStyles;i!=null&&typeof t=="string"&&an(i,t)>=0&&(n[r+1]=ra(n[r+1]))}function ll(e,t,n,r){let o=e[n+1],i=t===null,s=r?jt(o):Cn(o),a=!1;for(;s!==0&&(a===!1||i);){let c=e[s],u=e[s+1];Zm(c,t)&&(a=!0,e[s+1]=r?ra(u):na(u)),s=r?jt(u):Cn(u)}a&&(e[n+1]=r?na(o):ra(o))}function Zm(e,t){return e===null||t==null||(Array.isArray(e)?e[1]:e)===t?!0:Array.isArray(e)&&typeof t=="string"?an(e,t)>=0:!1}function Ke(e,t,n){return $d(e,t,n,!1),Ke}function ut(e,t){return $d(e,t,null,!0),ut}function $d(e,t,n,r){let o=b(),i=K(),s=Eu(2);if(i.firstUpdatePass&&Qm(i,e,s,r),t!==Be&&ct(o,s,t)){let a=i.data[ot()];ty(i,a,o,o[F],e,o[s+1]=ny(t,n),r,s)}}function Ym(e,t){return t>=e.expandoStartIndex}function Qm(e,t,n,r){let o=e.data;if(o[n+1]===null){let i=o[ot()],s=Ym(e,n);ry(i,r)&&t===null&&!s&&(t=!1),t=Km(o,i,t,r),Wm(o,i,t,n,s,r)}}function Km(e,t,n,r){let o=Tu(e),i=r?t.residualClasses:t.residualStyles;if(o===null)(r?t.classBindings:t.styleBindings)===0&&(n=Os(null,e,t,n,r),n=nr(n,t.attrs,r),i=null);else{let s=t.directiveStylingLast;if(s===-1||e[s]!==o)if(n=Os(o,e,t,n,r),i===null){let c=Jm(e,t,r);c!==void 0&&Array.isArray(c)&&(c=Os(null,e,t,c[1],r),c=nr(c,t.attrs,r),Xm(e,t,r,c))}else i=ey(e,t,r)}return i!==void 0&&(r?t.residualClasses=i:t.residualStyles=i),n}function Jm(e,t,n){let r=n?t.classBindings:t.styleBindings;if(Cn(r)!==0)return e[jt(r)]}function Xm(e,t,n,r){let o=n?t.classBindings:t.styleBindings;e[jt(o)]=r}function ey(e,t,n){let r,o=t.directiveEnd;for(let i=1+t.directiveStylingLast;i0;){let c=e[o],u=Array.isArray(c),l=u?c[1]:c,d=l===null,p=n[o+1];p===Be&&(p=d?Xe:void 0);let f=d?Gr(p,r):l===r?p:void 0;if(u&&!Mo(f)&&(f=Gr(c,r)),Mo(f)&&(a=f,s))return a;let h=e[o+1];o=s?jt(h):Cn(h)}if(t!==null){let c=i?t.residualClasses:t.residualStyles;c!=null&&(a=Gr(c,r))}return a}function Mo(e){return e!==void 0}function ny(e,t){return e==null||e===""||(typeof t=="string"?e=Yn(e)+t:typeof e=="object"&&(e=Pr(Yn(e)))),e}function ry(e,t){return(e.flags&(t?8:16))!==0}function M(e,t=""){let n=b(),r=K(),o=e+G,i=r.firstCreatePass?ir(r,o,1,t,null):r.data[o],s=oy(r,n,i,t);n[o]=s,oo()&&Ia(r,n,s,i),gn(i,!1)}var oy=(e,t,n,r)=>(Gn(!0),bh(t[F],r));function iy(e,t,n,r=""){return ct(e,Ot(),n)?t+Hr(n)+r:Be}function O(e){return bn("",e),O}function bn(e,t,n){let r=b(),o=iy(r,e,t,n);return o!==Be&&sy(r,ot(),o),bn}function sy(e,t,n){let r=as(t,e);_h(e[F],r,n)}function fl(e,t,n){let r=K();r.firstCreatePass&&Ud(t,r.data,r.blueprint,rt(e),n)}function Ud(e,t,n,r,o){if(e=te(e),Array.isArray(e))for(let i=0;i>20;if(It(e)||!e.multi){let f=new Ft(u,o,wn,null),h=Ls(c,t,o?l:l+p,d);h===-1?(js(Do(a,s),i,c),ks(i,e,t.length),t.push(c),a.directiveStart++,a.directiveEnd++,o&&(a.providerIndexes+=1048576),n.push(f),s.push(f)):(n[h]=f,s[h]=f)}else{let f=Ls(c,t,l+p,d),h=Ls(c,t,l,l+p),L=f>=0&&n[f],N=h>=0&&n[h];if(o&&!N||!o&&!L){js(Do(a,s),i,c);let W=uy(o?cy:ay,n.length,o,r,u,e);!o&&N&&(n[h].providerFactory=W),ks(i,e,t.length,0),t.push(c),a.directiveStart++,a.directiveEnd++,o&&(a.providerIndexes+=1048576),n.push(W),s.push(W)}else{let W=Gd(n[o?h:f],u,!o&&r);ks(i,e,f>-1?f:h,W)}!o&&r&&N&&n[h].componentProviders++}}}function ks(e,t,n,r){let o=It(t),i=eu(t);if(o||i){let c=(i?te(t.useClass):t).prototype.ngOnDestroy;if(c){let u=e.destroyHooks||(e.destroyHooks=[]);if(!o&&t.multi){let l=u.indexOf(n);l===-1?u.push(n,[r,c]):u[l+1].push(r,c)}else u.push(n,c)}}}function Gd(e,t,n){return n&&e.componentProviders++,e.multi.push(t)-1}function Ls(e,t,n,r){for(let o=n;o{n.providersResolver=(r,o)=>fl(r,o?o(e):e,!1),t&&(n.viewProvidersResolver=(r,o)=>fl(r,o?o(t):t,!0))}}function Gt(e,t,n){return dy(b(),Du(),e,t,n)}function ly(e,t){let n=e[t];return n===Be?void 0:n}function dy(e,t,n,r,o,i){let s=t+n;return ct(e,s,o)?qg(e,s+1,i?r.call(i,o):r(o)):ly(e,s+1)}function Ha(e,t){return Cd(e,t)}var zd=(()=>{class e{applicationErrorHandler=m(st);appRef=m(sr);taskService=m(kt);ngZone=m(V);zonelessEnabled=m(mn);tracing=m(Ye,{optional:!0});zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new Y;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(kn):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(m(co,{optional:!0})??!1);cancelScheduledCallback=null;useMicrotaskScheduler=!1;runningTick=!1;pendingRenderTaskId=null;constructor(){this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{let n=this.taskService.add();if(!this.runningTick&&(this.cleanup(),!this.zonelessEnabled||this.appRef.includeAllTestViews)){this.taskService.remove(n);return}this.switchToMicrotaskScheduler(),this.taskService.remove(n)})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()}))}switchToMicrotaskScheduler(){this.ngZone.runOutsideAngular(()=>{let n=this.taskService.add();this.useMicrotaskScheduler=!0,queueMicrotask(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(n)})})}notify(n){if(!this.zonelessEnabled&&n===5)return;switch(n){case 0:case 2:{this.appRef.dirtyFlags|=2;break}case 3:case 4:case 5:case 1:{this.appRef.dirtyFlags|=4;break}case 6:{this.appRef.dirtyFlags|=2;break}case 12:{this.appRef.dirtyFlags|=16;break}case 13:{this.appRef.dirtyFlags|=2;break}case 11:break;default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick())return;let r=this.useMicrotaskScheduler?Ru:Cs;this.pendingRenderTaskId=this.taskService.add(),this.scheduleInRootZone?this.cancelScheduledCallback=Zone.root.run(()=>r(()=>this.tick())):this.cancelScheduledCallback=this.ngZone.runOutsideAngular(()=>r(()=>this.tick()))}shouldScheduleTick(){return!(this.appRef.destroyed||this.pendingRenderTaskId!==null||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(kn+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(this.appRef.dirtyFlags===0){this.cleanup();return}!this.zonelessEnabled&&this.appRef.dirtyFlags&7&&(this.appRef.dirtyFlags|=1);let n=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(r){this.applicationErrorHandler(r)}finally{this.taskService.remove(n),this.cleanup()}}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,this.pendingRenderTaskId!==null){let n=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(n)}}static \u0275fac=function(r){return new(r||e)};static \u0275prov=Vt({token:e,factory:e.\u0275fac})}return e})();function Wd(){return[{provide:qe,useExisting:zd},{provide:V,useClass:Ln},{provide:mn,useValue:!0}]}function fy(){return typeof $localize<"u"&&$localize.locale||lr}var $o=new T("",{factory:()=>m($o,{optional:!0,skipSelf:!0})||fy()});var Uo=class{destroyed=!1;listeners=null;errorHandler=m(pe,{optional:!0});isEmitting=!1;hasNullListeners=!1;destroyRef=m(We);constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(t){if(this.destroyed)throw new E(953,!1);return(this.listeners??=[]).push(t),{unsubscribe:()=>{let n=this.listeners?this.listeners.indexOf(t):-1;n>-1&&(this.isEmitting?(this.hasNullListeners=!0,this.listeners[n]=null):this.listeners.splice(n,1))}}}emit(t){if(this.destroyed){console.warn(on(953,!1));return}if(this.listeners===null)return;this.isEmitting=!0;let n=g(null);try{for(let r of this.listeners)try{r!==null&&r(t)}catch(o){this.errorHandler?.handleError(o)}}finally{this.hasNullListeners&&(this.hasNullListeners=!1,this.listeners&&hy(this.listeners)),g(n),this.isEmitting=!1}}};function hy(e){let t=e.length-1;for(;t>-1;)e[t]===null&&e.splice(t,1),t--}function Oe(e,t){return _r(e,t?.equal)}function Go(e){return _c(e)}var qd=class e extends Error{_brand;constructor(t){super(t)}static IDLE=new e("IDLE");static LOADING=new e("LOADING")};function Qd(e,t){let n=Object.create(ml);n.value=e,n.transformFn=t?.transform;function r(){if(Je(n),n.value===aa){let o=null;throw new E(-950,o)}return n.value}return r[ee]=n,r}function _n(e){return new Uo}function Zd(e,t){return Qd(e,t)}function Ay(e){return Qd(aa,e)}var $=(Zd.required=Ay,Zd);var xy=1e4;var LN=xy-1e3;var Ry=(()=>{class e{zone=m(V);changeDetectionScheduler=m(qe);applicationRef=m(sr);applicationErrorHandler=m(st);_onMicrotaskEmptySubscription;initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.changeDetectionScheduler.runningTick||this.applicationRef._runningTick||this.zone.run(()=>{try{this.applicationRef.dirtyFlags|=1,this.applicationRef._tick()}catch(n){this.applicationErrorHandler(n)}})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static \u0275fac=function(r){return new(r||e)};static \u0275prov=Vt({token:e,factory:e.\u0275fac})}return e})(),Oy=new T("",{factory:()=>!1});function ky({ngZoneFactory:e,scheduleInRootZone:t}){return e??=()=>new V(X(q({},Jd()),{scheduleInRootZone:t})),[{provide:mn,useValue:!1},{provide:V,useFactory:e},{provide:_t,multi:!0,useFactory:()=>{let n=m(Ry,{optional:!0});return()=>n.initialize()}},{provide:_t,multi:!0,useFactory:()=>{let n=m(Ly);return()=>{n.initialize()}}},{provide:co,useValue:t??Is}]}function Kd(e){let t=e?.scheduleInRootZone,n=ky({ngZoneFactory:()=>{let r=Jd(e);return r.scheduleInRootZone=t,r.shouldCoalesceEventChangeDetection&&Bt("NgZone_CoalesceEvent"),new V(r)},scheduleInRootZone:t});return zr([{provide:Oy,useValue:!0},n])}function Jd(e){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:e?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:e?.runCoalescing??!1}}var Ly=(()=>{class e{subscription=new Y;initialized=!1;zone=m(V);pendingTasks=m(kt);initialize(){if(this.initialized)return;this.initialized=!0;let n=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(n=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{V.assertNotInAngularZone(),queueMicrotask(()=>{n!==null&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(n),n=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{V.assertInAngularZone(),n??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(r){return new(r||e)};static \u0275prov=Vt({token:e,factory:e.\u0275fac})}return e})();var Ua=new T(""),Fy=new T("");function dr(e){return!e.moduleRef}function Py(e){let t=dr(e)?e.r3Injector:e.moduleRef.injector,n=t.get(V);return n.run(()=>{dr(e)?e.r3Injector.resolveInjectorInitializers():e.moduleRef.resolveInjectorInitializers();let r=t.get(st),o;if(n.runOutsideAngular(()=>{o=n.onError.subscribe({next:r})}),dr(e)){let i=()=>t.destroy(),s=e.platformInjector.get(Ua);s.add(i),t.onDestroy(()=>{o.unsubscribe(),s.delete(i)})}else{let i=()=>e.moduleRef.destroy(),s=e.platformInjector.get(Ua);s.add(i),e.moduleRef.onDestroy(()=>{Zn(e.allPlatformModules,e.moduleRef),o.unsubscribe(),s.delete(i)})}return Vy(r,n,()=>{let i=t.get(kt),s=i.add(),a=t.get(Pa);return a.runInitializers(),a.donePromise.then(()=>{let c=t.get($o,lr);if(Hd(c||lr),!t.get(Fy,!0))return dr(e)?t.get(sr):(e.allPlatformModules.push(e.moduleRef),e.moduleRef);if(dr(e)){let l=t.get(sr);return e.rootComponent!==void 0&&l.bootstrap(e.rootComponent),l}else return jy?.(e.moduleRef,e.allPlatformModules),e.moduleRef}).finally(()=>{i.remove(s)})})})}var jy;function Vy(e,t,n){try{let r=n();return Bo(r)?r.catch(o=>{throw t.runOutsideAngular(()=>e(o)),o}):r}catch(r){throw t.runOutsideAngular(()=>e(r)),r}}var zo=null;function By(e=[],t){return Te.create({name:t,providers:[{provide:Pn,useValue:"platform"},{provide:Ua,useValue:new Set([()=>zo=null])},...e]})}function Hy(e=[]){if(zo)return zo;let t=By(e);return zo=t,Vd(),$y(t),t}function $y(e){let t=e.get(io,null);Wr(e,()=>{t?.forEach(n=>n())})}function Xd(e){let{rootComponent:t,appProviders:n,platformProviders:r,platformRef:o}=e;x(_.BootstrapApplicationStart);try{let i=o?.injector??Hy(r),s=[Wd(),Fu,...n||[]],a=new tr({providers:s,parent:i,debugName:"",runEnvironmentInitializers:!1});return Py({r3Injector:a.injector,platformInjector:i,rootComponent:t})}catch(i){return Promise.reject(i)}finally{x(_.BootstrapApplicationEnd)}}var $a=Symbol("NOT_SET"),ef=new Set,Uy=X(q({},Qt),{kind:"afterRenderEffectPhase",consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,value:$a,cleanup:null,consumerMarkedDirty(){if(this.sequence.impl.executing){if(this.sequence.lastPhase===null||this.sequence.lastPhase(Je(l),l.value),l.signal[ee]=l,l.registerCleanupFn=d=>(l.cleanup??=new Set).add(d),this.nodes[c]=l,this.hooks[c]=d=>l.phaseFn(d)}}afterRun(){super.afterRun(),this.lastPhase=null}destroy(){if(this.onDestroyFns!==null)for(let t of this.onDestroyFns)t();super.destroy();for(let t of this.nodes)if(t)try{for(let n of t.cleanup??ef)n()}finally{Zt(t)}}};function tf(e,t){let n=t?.injector??m(Te),r=n.get(qe),o=n.get(Da),i=n.get(Ye,null,{optional:!0});o.impl??=n.get(Jl);let s=e;typeof s=="function"&&(s={mixedReadWrite:e});let a=n.get(ao,null,{optional:!0}),c=new Ga(o.impl,[s.earlyRead,s.write,s.mixedReadWrite,s.read],a?.view,r,n,i?.snapshot(null),void 0);return o.impl.register(c),c}var nf=null;function pr(){return nf}function Wa(e){nf??=e}var fr=class{};var qa=(()=>{class e{_viewContainerRef;_viewRef=null;ngTemplateOutletContext=null;ngTemplateOutlet=null;ngTemplateOutletInjector=null;injector=m(Te);constructor(n){this._viewContainerRef=n}ngOnChanges(n){if(this._shouldRecreateView(n)){let r=this._viewContainerRef;if(this._viewRef&&r.remove(r.indexOf(this._viewRef)),!this.ngTemplateOutlet){this._viewRef=null;return}let o=this._createContextForwardProxy();this._viewRef=r.createEmbeddedView(this.ngTemplateOutlet,o,{injector:this._getInjector()})}}_getInjector(){return this.ngTemplateOutletInjector==="outlet"?this.injector:this.ngTemplateOutletInjector??void 0}_shouldRecreateView(n){return!!n.ngTemplateOutlet||!!n.ngTemplateOutletInjector}_createContextForwardProxy(){return new Proxy({},{set:(n,r,o)=>this.ngTemplateOutletContext?Reflect.set(this.ngTemplateOutletContext,r,o):!1,get:(n,r,o)=>{if(this.ngTemplateOutletContext)return Reflect.get(this.ngTemplateOutletContext,r,o)}})}static \u0275fac=function(r){return new(r||e)(wn(Vo))};static \u0275dir=Fa({type:e,selectors:[["","ngTemplateOutlet",""]],inputs:{ngTemplateOutletContext:"ngTemplateOutletContext",ngTemplateOutlet:"ngTemplateOutlet",ngTemplateOutletInjector:"ngTemplateOutletInjector"},features:[ua]})}return e})();function Za(e,t){t=encodeURIComponent(t);for(let n of e.split(";")){let r=n.indexOf("="),[o,i]=r==-1?[n,""]:[n.slice(0,r),n.slice(r+1)];if(o.trim()!==t)continue;let s=i;try{s=decodeURIComponent(i)}catch(a){}return s.length>1&&s[0]==='"'&&s[s.length-1]==='"'&&(s=s.slice(1,-1)),s}return null}var rf="browser";var hr=class{_doc;constructor(t){this._doc=t}manager},Wo=(()=>{class e extends hr{constructor(n){super(n)}supports(n){return!0}addEventListener(n,r,o,i){return n.addEventListener(r,o,i),()=>this.removeEventListener(n,r,o,i)}removeEventListener(n,r,o,i){return n.removeEventListener(r,o,i)}static \u0275fac=function(r){return new(r||e)(A(ye))};static \u0275prov=Z({token:e,factory:e.\u0275fac})}return e})(),Yo=new T(""),Ja=(()=>{class e{_zone;_plugins;_eventNameToPlugin=new Map;constructor(n,r){this._zone=r,n.forEach(s=>{s.manager=this});let o=n.filter(s=>!(s instanceof Wo));this._plugins=o.slice().reverse();let i=n.find(s=>s instanceof Wo);i&&this._plugins.push(i)}addEventListener(n,r,o,i){return this._findPluginFor(r).addEventListener(n,r,o,i)}getZone(){return this._zone}_findPluginFor(n){let r=this._eventNameToPlugin.get(n);if(r)return r;if(r=this._plugins.find(i=>i.supports(n)),!r)throw new E(-5101,!1);return this._eventNameToPlugin.set(n,r),r}static \u0275fac=function(r){return new(r||e)(A(Yo),A(V))};static \u0275prov=Z({token:e,factory:e.\u0275fac})}return e})(),Ya="ng-app-id";function of(e){for(let t of e)t.remove()}function sf(e,t){let n=t.createElement("style");return n.textContent=e,n}function Wy(e,t,n,r){let o=e.head?.querySelectorAll(`style[${Ya}="${t}"],link[${Ya}="${t}"]`);if(!o||o.length===0)return!1;for(let i of o)i.removeAttribute(Ya),i instanceof HTMLLinkElement?r.set(i.href.slice(i.href.lastIndexOf("/")+1),{usage:0,elements:[i]}):i.textContent&&n.set(i.textContent,{usage:0,elements:[i]});return!0}function Ka(e,t){let n=t.createElement("link");return n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n}var Xa=(()=>{class e{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(n,r,o,i={}){this.doc=n,this.appId=r,this.nonce=o,Wy(n,r,this.inline,this.external)&&this.hosts.add(n.head)}addStyles(n,r){for(let o of n)this.addUsage(o,this.inline,sf);r?.forEach(o=>this.addUsage(o,this.external,Ka))}removeStyles(n,r){for(let o of n)this.removeUsage(o,this.inline);r?.forEach(o=>this.removeUsage(o,this.external))}addUsage(n,r,o){let i=r.get(n);i?i.usage++:r.set(n,{usage:1,elements:[...this.hosts].map(s=>this.addElement(s,o(n,this.doc)))})}removeUsage(n,r){let o=r.get(n);o&&(o.usage--,o.usage<=0&&(of(o.elements),r.delete(n)))}ngOnDestroy(){for(let[,{elements:n}]of[...this.inline,...this.external])of(n);this.hosts.clear()}addHost(n){if(!this.hosts.has(n)){this.hosts.add(n);for(let[r,{elements:o}]of this.inline)o.push(this.addElement(n,sf(r,this.doc)));for(let[r,{elements:o}]of this.external)o.push(this.addElement(n,Ka(r,this.doc)))}}removeHost(n){this.hosts.delete(n);for(let r of[...this.inline.values(),...this.external.values()]){let o=[];for(let i of r.elements)i.parentNode===n?i.remove():o.push(i);r.elements=o}}addElement(n,r){return this.nonce&&r.setAttribute("nonce",this.nonce),n.appendChild(r)}static \u0275fac=function(r){return new(r||e)(A(ye),A(zn),A(so,8),A(Wn))};static \u0275prov=Z({token:e,factory:e.\u0275fac})}return e})(),Qa={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},ec=/%COMP%/g;var cf="%COMP%",qy=`_nghost-${cf}`,Zy=`_ngcontent-${cf}`,Yy=!0,Qy=new T("",{factory:()=>Yy}),Ky=new T("");function Jy(e){return Zy.replace(ec,e)}function Xy(e){return qy.replace(ec,e)}function uf(e,t){return t.map(n=>n.replace(ec,e))}var tc=(()=>{class e{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;cssVarNamespace;constructor(n,r,o,i,s,a,c=null,u=null,l=null){this.eventManager=n,this.sharedStylesHost=r,this.appId=o,this.removeStylesOnCompDestroy=i,this.doc=s,this.ngZone=a,this.nonce=c,this.tracingService=u,this.cssVarNamespace=l??"",this.defaultRenderer=new gr(n,s,a,this.tracingService,this.cssVarNamespace)}createRenderer(n,r){if(!n||!r)return this.defaultRenderer;let o=this.getOrCreateRenderer(n,r);return o instanceof Zo?o.applyToHost(n):o instanceof mr&&o.applyStyles(),o}getOrCreateRenderer(n,r){let o=this.rendererByCompId,i=o.get(r.id);if(!i){let s=this.doc,a=this.ngZone,c=this.eventManager,u=this.sharedStylesHost,l=this.removeStylesOnCompDestroy,d=this.tracingService;switch(r.encapsulation){case Ne.Emulated:i=new Zo(c,u,r,this.appId,l,s,a,d,this.cssVarNamespace);break;case Ne.ShadowDom:return new qo(c,n,r,s,a,this.nonce,d,this.cssVarNamespace,u);case Ne.ExperimentalIsolatedShadowDom:return new qo(c,n,r,s,a,this.nonce,d,this.cssVarNamespace);default:i=new mr(c,u,r,l,s,a,d,this.cssVarNamespace);break}o.set(r.id,i)}return i}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(n){this.rendererByCompId.delete(n)}static \u0275fac=function(r){return new(r||e)(A(Ja),A(Ht),A(zn),A(Qy),A(ye),A(V),A(so),A(Ye,8),A(Ky,8))};static \u0275prov=Z({token:e,factory:e.\u0275fac})}return e})(),gr=class{eventManager;doc;ngZone;tracingService;cssVarNamespace;data=Object.create(null);throwOnSyntheticProps=!0;constructor(t,n,r,o,i=""){this.eventManager=t,this.doc=n,this.ngZone=r,this.tracingService=o,this.cssVarNamespace=i}destroy(){}destroyNode=null;createElement(t,n){return n?this.doc.createElementNS(Qa[n]||n,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,n){(af(t)?t.content:t).appendChild(n)}insertBefore(t,n,r){if(t){let o=af(t)?t.content:t;if(r!=null&&r.parentNode!==o)throw new E(-5106,!1);o.insertBefore(n,r)}}removeChild(t,n){n.remove()}selectRootElement(t,n){let r=typeof t=="string"?this.doc.querySelector(t):t;if(!r)throw new E(-5104,!1);return n||(r.textContent=""),r}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,n,r,o){if(o){n=o+":"+n;let i=Qa[o];i?t.setAttributeNS(i,n,r):t.setAttribute(n,r)}else t.setAttribute(n,r)}removeAttribute(t,n,r){if(r){let o=Qa[r];o?t.removeAttributeNS(o,n):t.removeAttribute(`${r}:${n}`)}else t.removeAttribute(n)}addClass(t,n){t.classList.add(n)}removeClass(t,n){t.classList.remove(n)}setStyle(t,n,r,o){let i=n.startsWith("--");i&&(n=n.replace("%NS%",this.cssVarNamespace)),i||o&(Ve.DashCase|Ve.Important)?t.style.setProperty(n,r,o&Ve.Important?"important":""):t.style[n]=r}removeStyle(t,n,r){let o=n.startsWith("--");o&&(n=n.replace("%NS%",this.cssVarNamespace)),o||r&Ve.DashCase?t.style.removeProperty(n):t.style[n]=""}setProperty(t,n,r){t!=null&&(t[n]=r)}setValue(t,n){t.nodeValue=n}listen(t,n,r,o){if(typeof t=="string"&&(t=pr().getGlobalEventTarget(this.doc,t),!t))throw new E(-5102,!1);let i=this.decoratePreventDefault(r);return this.tracingService?.wrapEventListener&&(i=this.tracingService.wrapEventListener(t,n,i)),this.eventManager.addEventListener(t,n,i,o)}decoratePreventDefault(t){return n=>{if(n==="__ngUnwrap__")return t;t(n)===!1&&n.preventDefault()}}};function af(e){return e.tagName==="TEMPLATE"&&e.content!==void 0}var qo=class extends gr{hostEl;sharedStylesHost;shadowRoot;constructor(t,n,r,o,i,s,a,c,u){super(t,o,i,a,c),this.hostEl=n,this.sharedStylesHost=u,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost&&this.sharedStylesHost.addHost(this.shadowRoot);let l=r.styles;l=uf(r.id,l).map(p=>p.replace(/%NS%/g,c));for(let p of l){let f=document.createElement("style");s&&f.setAttribute("nonce",s),f.textContent=p,this.shadowRoot.appendChild(f)}let d=r.getExternalStyles?.();if(d)for(let p of d){let f=Ka(p,o);s&&f.setAttribute("nonce",s),this.shadowRoot.appendChild(f)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,n){return super.appendChild(this.nodeOrShadowRoot(t),n)}insertBefore(t,n,r){return super.insertBefore(this.nodeOrShadowRoot(t),n,r)}removeChild(t,n){return super.removeChild(null,n)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost&&this.sharedStylesHost.removeHost(this.shadowRoot)}},mr=class extends gr{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(t,n,r,o,i,s,a,c,u){super(t,i,s,a,c),this.sharedStylesHost=n,this.removeStylesOnCompDestroy=o;let l=r.styles,d=u?uf(u,l):l;this.styles=d.map(p=>p.replace(/%NS%/g,c)),this.styleUrls=r.getExternalStyles?.(u)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&ya.size===0&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},Zo=class extends mr{contentAttr;hostAttr;constructor(t,n,r,o,i,s,a,c,u){let l=o+"-"+r.id;super(t,n,r,i,s,a,c,u,l),this.contentAttr=Jy(l),this.hostAttr=Xy(l)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,n){let r=super.createElement(t,n);return super.setAttribute(r,this.contentAttr,""),r}};var Qo=class e extends fr{supportsDOMEvents=!0;static makeCurrent(){Wa(new e)}onAndCancel(t,n,r,o){return t.addEventListener(n,r,o),()=>{t.removeEventListener(n,r,o)}}dispatchEvent(t,n){t.dispatchEvent(n)}remove(t){t.remove()}createElement(t,n){return n=n||this.getDefaultDocument(),n.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,n){return n==="window"?window:n==="document"?t:n==="body"?t.body:null}getBaseHref(t){let n=eD();return n==null?null:tD(n)}resetBaseElement(){yr=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return Za(document.cookie,t)}},yr=null;function eD(){return yr=yr||document.head.querySelector("base"),yr?yr.getAttribute("href"):null}function tD(e){return new URL(e,document.baseURI).pathname}var lf=["alt","control","meta","shift"],nD={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},rD={alt:e=>e.altKey,control:e=>e.ctrlKey,meta:e=>e.metaKey,shift:e=>e.shiftKey},df=(()=>{class e extends hr{constructor(n){super(n)}supports(n){return e.parseEventName(n)!=null}addEventListener(n,r,o,i){let s=e.parseEventName(r),a=e.eventCallback(s.fullKey,o,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>pr().onAndCancel(n,s.domEventName,a,i))}static parseEventName(n){let r=n.toLowerCase().split("."),o=r.shift();if(r.length===0||!(o==="keydown"||o==="keyup"))return null;let i=e._normalizeKey(r.pop()),s="",a=r.indexOf("code");if(a>-1&&(r.splice(a,1),s="code."),lf.forEach(u=>{let l=r.indexOf(u);l>-1&&(r.splice(l,1),s+=u+".")}),s+=i,r.length!=0||i.length===0)return null;let c={};return c.domEventName=o,c.fullKey=s,c}static matchEventFullKeyCode(n,r){let o=nD[n.key]||n.key,i="";return r.indexOf("code.")>-1&&(o=n.code,i="code."),o==null||!o?!1:(o=o.toLowerCase(),o===" "?o="space":o==="."&&(o="dot"),lf.forEach(s=>{if(s!==o){let a=rD[s];a(n)&&(i+=s+".")}}),i+=o,i===r)}static eventCallback(n,r,o){return i=>{e.matchEventFullKeyCode(i,n)&&o.runGuarded(()=>r(i))}}static _normalizeKey(n){return n==="esc"?"escape":n}static \u0275fac=function(r){return new(r||e)(A(ye))};static \u0275prov=Z({token:e,factory:e.\u0275fac})}return e})();function nc(e,t,n){return zt(this,null,function*(){let r=q({rootComponent:e},oD(t,n));return Xd(r)})}function oD(e,t){return{platformRef:t?.platformRef,appProviders:[...uD,...e?.providers??[]],platformProviders:cD}}function iD(){Qo.makeCurrent()}function sD(){return new pe}function aD(){return fa(document),document}var cD=[{provide:Wn,useValue:rf},{provide:io,useValue:iD,multi:!0},{provide:ye,useFactory:aD}];var uD=[{provide:Pn,useValue:"root"},{provide:pe,useFactory:sD},{provide:Yo,useClass:Wo,multi:!0},{provide:Yo,useClass:df,multi:!0},tc,{provide:Ht,useClass:Xa},{provide:Xa,useExisting:Ht},Ja,{provide:Pt,useExisting:tc},[]];var Ko=class e{roomName=$.required();send=_n();draft=ie("");placeholder=Oe(()=>`Message #${this.roomName().toLowerCase().replace(/ /g,"-")}`);submit(t){t.preventDefault();let n=this.draft().trim();n&&(this.send.emit(n),this.draft.set(""))}handleKeyDown(t){t.key==="Enter"&&!t.shiftKey&&this.submit(t)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=J({type:e,selectors:[["form","chat-composer",""]],hostAttrs:[1,"composer"],hostBindings:function(n,r){n&1&&z("submit",function(i){return r.submit(i)})},inputs:{roomName:[1,"roomName"]},outputs:{send:"send"},decls:4,vars:4,consts:[["input",""],["id","composer-input","type","text","autocomplete","off",1,"composer-input",3,"input","keydown","placeholder","value"],["id","composer-send","type","submit",1,"composer-send",3,"disabled"]],template:function(n,r){if(n&1){let o=Re();ve(0,"input",1,0),Ho("input",function(){ue(o);let s=Qe(1);return le(r.draft.set(s.value))})("keydown",function(s){return r.handleKeyDown(s)}),Ee(),ve(2,"button",2),M(3,"Send"),Ee()}n&2&&(Ut("placeholder",r.placeholder())("value",r.draft()),He("aria-label","Message "+r.roomName()),D(2),Ut("disabled",r.draft().trim().length===0))},encapsulation:2})};var ff=[["#3b82f6","#bfdbfe"],["#a855f7","#f0d9ff"],["#10b981","#b7f5da"],["#ef4444","#ffd5d5"],["#f59e0b","#ffeab0"],["#06b6d4","#b8f2fb"],["#6366f1","#d5daff"],["#84cc16","#e3fab3"]];function lD(e,t,n){let r=t,o=n;switch(e){case 0:return``;case 1:return``;case 2:{let i=[.35,.62,.45,.8,.55];return i.map((s,a)=>{let c=r*.9/i.length-6;return``}).join("")}default:return``}}var pf=new Map;function rc(e,t,n,r){let o=e%ff.length,i=t%4,s=`${o}-${i}-${n}x${r}`,a=pf.get(s);if(a)return a;let[c,u]=ff[o],l=`g${o}${i}`,d=`${lD(i,n,r)}`,p=`data:image/svg+xml,${encodeURIComponent(d)}`;return pf.set(s,p),p}var If=40,Dr=1500,ac=8,dD=56,Jo=["General","Random","Announcements","Engineering","Design","Product","Support","Off Topic","Releases","Incidents","Frontend","Backend","Infra","Mobile","Performance","Security","Docs","Hiring","Watercooler","Standup"],dt=["Ada Lovelace","Alan Turing","Grace Hopper","Linus Pauling","Marie Curie","Nikola Tesla","Rosalind Franklin","Carl Sagan","Katherine Johnson","Tim Berners-Lee"],Sn=["#368bd6","#ac3ba8","#03b381","#e64f7a","#ff812d","#2dc2c5","#5c56f5","#74d12c"],uc=Sn.length,oc=["the","benchmark","switching","between","rooms","should","feel","instant","even","when","the","timeline","is","long","and","full","of","rich","messages","with","avatars","and","timestamps","rendering","performance","matters","a","lot","here","lets","measure","it","carefully","and","compare","across","browsers","over","time"],ei=["\u{1F600}","\u{1F602}","\u{1F389}","\u{1F525}","\u2764\uFE0F","\u{1F64F}","\u{1F440}","\u{1F680}","\u{1F605}","\u{1F914}","\u{1F4AF}","\u2728","\u{1F64C}\u{1F3FD}","\u{1F44D}\u{1F3FB}","\u{1F60D}","\u{1F973}","\u{1F62D}","\u{1F92F}","\u{1F44F}","\u{1F4AA}\u{1F3FE}","\u{1F9E0}","\u2615","\u{1F41B}","\u{1F4C8}","\u{1F469}\u200D\u{1F4BB}","\u{1F9D1}\u200D\u{1F680}","\u{1F468}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F466}","\u{1F3F3}\uFE0F\u200D\u{1F308}","\u{1F937}\u200D\u2640\uFE0F","\u{1F64B}\u200D\u2642\uFE0F","\u{1FAE0}","\u{1FAF6}"],hf=["\u{1F44D}","\u2764\uFE0F","\u{1F602}","\u{1F389}","\u{1F525}","\u2705","\u{1F440}","\u{1F64F}","\u{1F4AF}","\u{1F680}","\u{1F605}","\u{1F92F}"],fD=dt.map(e=>e.split(" ")[0].toLowerCase()),Cf=["scrollTop","scrollHeight","flushSync","requestAnimationFrame","IntersectionObserver","overflow-anchor","content-visibility","useLayoutEffect","getBoundingClientRect","will-change","ResizeObserver","queueMicrotask","clientHeight","offsetHeight"],pD=["the trace","last night's run","this regression","the profile","the spec text","my notes","the dashboard","that comparison"],wf=["traces/2f9c","runs/nightly","profiles/hot-path","spec/scroll-anchoring","notes/timeline","dashboards/perf","reports/42","compare/main"],hD=[{site:"example.com",title:"Scroll anchoring, and why feeds jump",description:"How browsers pin a scroll position while content is inserted above the viewport, and where it gives up."},{site:"perf.example.com",title:"Nightly run 482 vs 481",description:"Geomean moved 1.8% on the chat suites. Row measurement dominates the profile."},{site:"docs.example.com",title:"Windowing a variable-height list",description:"Estimate, measure, cache, correct. The four steps every hand-rolled virtualizer ends up with."},{site:"bugs.example.com",title:"Timeline jumps when the panel opens",description:"Narrowing the scroller re-wraps every row, so the cached heights are all stale at once."}],gD=["can we get a number on how bad the jank is before we start moving code around","the window only recycles about twenty rows, so the mount cost should be flat","every row height changes when the panel opens, which invalidates the cache","please do not use smooth scrolling anywhere inside a timed step","prepending history without pinning the anchor makes the viewport jump"],ic=["estimate the row height first, then correct after measuring","cache measured heights per message id","keep the mounted window small and bounded","assign scroll offsets explicitly instead of animating","recycle rows rather than remounting them","break the group when a reply quote is present","re-measure only the rows the resize actually touched"],mD=[{lang:"js",lines:["const scroller = scrollerRef.current;","scroller.scrollTop = scroller.scrollHeight;"]},{lang:"js",lines:["requestAnimationFrame(() => {"," for (const row of mounted)"," heights.set(row.id, row.offsetHeight);","});"]},{lang:"css",lines:[".timeline {"," overflow-anchor: none;"," content-visibility: auto;","}"]},{lang:"sh",lines:["npm run build","node debugging/e2e-chatroom.mjs --browser chrome"]},{lang:"json",lines:["{",' "iterationCount": 10,',' "suites": ["ChatRoom-React"]',"}"]},{lang:"js",lines:["for (const row of rows) {"," if (!heights.has(row.id))"," heights.set(row.id, estimate);","}"]},{lang:"diff",lines:['- scroller.scrollTo({ top, behavior: "smooth" });',"+ scroller.scrollTop = top;"]},{lang:"js",lines:["export function anchorToBottom(node) {"," node.scrollTop = node.scrollHeight;","}"]}];function k(e,t){let n=Math.imul(e+1,2654435761)^Math.imul(t+1,40503);return n^=n>>>15,n=Math.imul(n,2246822519),n^=n>>>13,n=Math.imul(n,3266489917),n^=n>>>16,n>>>0}function $e(e,t,n){return e[k(t,n)%e.length]}function lc(e){return e.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}function Tf(e){let t=Jo[e%Jo.length];return e{if(!n.length)return;let s=r?" ":"",a=i?" ":"";t.push({type:"text",text:`${s}${n.join(" ")}${a}`}),n=[],r=!1};for(let i of e){if(typeof i=="string"){n.push(i);continue}o(!0),t.push(i),r=!0}return o(!1),t}function DD(e,t,n){if(n===0)return{type:"code",text:$e(Cf,e,t+11)};if(n===1)return{type:"link",text:$e(pD,e,t+12),href:`https://example.com/${$e(wf,e,t+13)}`};if(n===2)return{type:"mention",name:$e(fD,e,t+14)};let r=k(e,t+15)%If;return{type:"room",name:yD(r),roomId:`room-${r}`}}function Xo(e,t){let n=6+k(e,t)%22,r=k(e,t+1)%oc.length,o=[],i=!1;for(let l=0;l0&&lString(o).padStart(2,"0");return`${r(t)}:${r(n)}`}var dc=1440,fc=[];for(let e=0;e[e,t%uc])),RD=new Map(dt.map(e=>[e,lc(e)]));function OD(e,t){let n=[],r=0;for(;n.length0&&k(i,201)%100<18){let u=k(i,203)%4===0?1+k(i,204)%Math.min(o,400):1+k(i,202)%6,l=r[Math.max(0,o-u)];c={id:l.id,sender:l.sender,excerpt:ND(l.blocks)}}r.push({id:`room-${e}-msg-${o}`,sender:s,senderInitials:RD.get(s),colorIndex:xD.get(s),time:fc[i%dc],dayIndex:n[o],blocks:a,replyTo:c,grouped:o>0&&t[o-1]===s&&!c,reactions:Af[i%Nf]})}return r}var LD=12;function FD(){let e=[];for(let t=0;t0,reactions:[]}}var ti=Rf,kf=Of;var ni=class e{index=$.required();room=$.required();selected=$.required();avatarColors=Sn;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=J({type:e,selectors:[["button","chat-room-list-item",""]],hostAttrs:["type","button",1,"room-list-item"],hostVars:3,hostBindings:function(n,r){n&2&&(Ut("id","room-list-item-"+r.index()),ut("room-list-item-selected",r.selected()))},inputs:{index:[1,"index"],room:[1,"room"],selected:[1,"selected"]},decls:7,vars:5,consts:[[1,"avatar"],[1,"room-list-item-text"],[1,"room-list-item-name"],[1,"room-list-item-preview"]],template:function(n,r){n&1&&(ve(0,"span",0),M(1),Ee(),ve(2,"span",1)(3,"span",2),M(4),Ee(),ve(5,"span",3),M(6),Ee()()),n&2&&(Ke("background-color",r.avatarColors[r.room().colorIndex]),D(),O(r.room().initials),D(3),O(r.room().name),D(2),O(r.room().lastMessage))},encapsulation:2})};var PD=(e,t)=>t.id;function jD(e,t){if(e&1){let n=Re();I(0,"button",1),z("click",function(){let o=ue(n).$implicit,i=S();return le(i.roomSelected.emit(o.id))}),w()}if(e&2){let n=t.$implicit,r=t.$index,o=S();H("index",r)("room",n)("selected",n.id===o.selectedRoomId())}}var ri=class e{rooms=$.required();selectedRoomId=$.required();roomSelected=_n();static \u0275fac=function(n){return new(n||e)};static \u0275cmp=J({type:e,selectors:[["nav","chat-room-list",""]],hostAttrs:["aria-label","Rooms",1,"room-list"],inputs:{rooms:[1,"rooms"],selectedRoomId:[1,"selectedRoomId"]},outputs:{roomSelected:"roomSelected"},decls:2,vars:0,consts:[["chat-room-list-item","",3,"index","room","selected"],["chat-room-list-item","",3,"click","index","room","selected"]],template:function(n,r){n&1&&de(0,jD,1,3,"button",0,PD),n&2&&fe(r.rooms())},dependencies:[ni],encapsulation:2})};var ft=class{};var oi=class{#s;#e;#o;#n;#r;#t;constructor(t,n,r){this.#s=r,this.#e=t,this.#r=n,this.#o=new Float64Array(t).fill(-1),this.#n=new Float64Array(t+1),this.#t=n}get count(){return this.#e}get first(){return this.#r}extendTo(t){t>=this.#r||(this.#r=t,this.#t=t)}grow(t){if(t<=this.#e)return;let n=new Float64Array(t);n.set(this.#o),n.fill(-1,this.#e);let r=new Float64Array(t+1);r.set(this.#n),this.#t=Math.min(this.#t,this.#e),this.#o=n,this.#n=r,this.#e=t}heightAt(t){let n=this.#o[t];return n===-1?this.#s:n}measure(t,n){return this.#o[t]===n?!1:(this.#o[t]=n,t>1;n[i]<=t?r=i:o=i-1}return Math.max(this.#r,r)}#i(){if(this.#t>this.#e)return;let t=this.#n;t[this.#r]=0;for(let n=this.#t;n({$implicit:e});function VD(e,t){if(e&1&&(I(0,"code",1),M(1),w()),e&2){let n=S().$implicit;D(),O(n.text)}}function BD(e,t){if(e&1&&(I(0,"a",5),z("click",function(r){return r.preventDefault()}),M(1),w()),e&2){let n=S().$implicit;H("href",n.href,xo),D(),O(n.text)}}function HD(e,t){if(e&1&&(I(0,"span",3),M(1),w()),e&2){let n=S().$implicit;D(),bn("@",n.name)}}function $D(e,t){if(e&1){let n=Re();I(0,"button",6),z("click",function(){ue(n);let o=S().$implicit,i=S(2);return le(i.actions.selectRoom(o.roomId))}),M(1),w()}if(e&2){let n=S().$implicit;D(),bn("#",n.name)}}function UD(e,t){if(e&1&&(cr(0),M(1),ur()),e&2){let n=S().$implicit;D(),O(n.text)}}function GD(e,t){if(e&1&&Ae(0,VD,2,1,"code",1)(1,BD,2,2,"a",2)(2,HD,2,1,"span",3)(3,$D,2,1,"button",4)(4,UD,2,1,"ng-container"),e&2){let n,r=t.$implicit;xe((n=r.type)==="code"?0:n==="link"?1:n==="mention"?2:n==="room"?3:4)}}function zD(e,t){if(e&1&&de(0,GD,5,1,null,null,ar),e&2){let n=t.$implicit;fe(n)}}function WD(e,t){if(e&1&&(I(0,"pre",7)(1,"code"),M(2),w()()),e&2){let n=S().$implicit;He("data-lang",n.lang),D(2),O(n.lines.join(` +`))}}function qD(e,t){e&1&&Tn(0)}function ZD(e,t){if(e&1&&(I(0,"blockquote",8),$t(1,qD,1,0,"ng-container",13),w()),e&2){let n=S().$implicit;S();let r=Qe(1);D(),H("ngTemplateOutlet",r)("ngTemplateOutletContext",Gt(2,hc,n.spans))}}function YD(e,t){if(e&1&&De(0,"img",9),e&2){let n=S().$implicit;H("src",n.src)("width",n.width)("height",n.height)("alt",n.alt)}}function QD(e,t){if(e&1&&(I(0,"a",14),z("click",function(r){return r.preventDefault()}),De(1,"img",15),I(2,"span",16)(3,"span",17),M(4),w(),I(5,"span",18),M(6),w(),I(7,"span",19),M(8),w()()()),e&2){let n=S().$implicit;H("href",n.href,xo),D(),H("src",n.thumbSrc)("width",n.thumbWidth)("height",n.thumbHeight),D(3),O(n.site),D(2),O(n.title),D(2),O(n.description)}}function KD(e,t){e&1&&Tn(0)}function JD(e,t){if(e&1&&(I(0,"li"),$t(1,KD,1,0,"ng-container",13),w()),e&2){let n=t.$implicit;S(3);let r=Qe(1);D(),H("ngTemplateOutlet",r)("ngTemplateOutletContext",Gt(2,hc,n))}}function XD(e,t){if(e&1&&(I(0,"ul",11),de(1,JD,2,4,"li",null,ar),w()),e&2){let n=S().$implicit;D(),fe(n.items)}}function ev(e,t){e&1&&Tn(0)}function tv(e,t){if(e&1&&(I(0,"p",12),$t(1,ev,1,0,"ng-container",13),w()),e&2){let n=S().$implicit;S();let r=Qe(1);D(),H("ngTemplateOutlet",r)("ngTemplateOutletContext",Gt(2,hc,n.spans))}}function nv(e,t){if(e&1&&Ae(0,WD,3,2,"pre",7)(1,ZD,2,4,"blockquote",8)(2,YD,1,4,"img",9)(3,QD,9,7,"a",10)(4,XD,3,0,"ul",11)(5,tv,2,4,"p",12),e&2){let n,r=t.$implicit;xe((n=r.type)==="code"?0:n==="quote"?1:n==="image"?2:n==="unfurl"?3:n==="list"?4:5)}}var si=class e{blocks=$.required();actions=m(ft);static \u0275fac=function(n){return new(n||e)};static \u0275cmp=J({type:e,selectors:[["div","chat-rich-text",""]],inputs:{blocks:[1,"blocks"]},decls:4,vars:0,consts:[["spans",""],[1,"rich-code"],[1,"rich-link",3,"href"],[1,"rich-pill","rich-pill-mention"],["type","button",1,"rich-pill","rich-pill-room"],[1,"rich-link",3,"click","href"],["type","button",1,"rich-pill","rich-pill-room",3,"click"],[1,"rich-code-block"],[1,"rich-quote"],["decoding","sync",1,"rich-image",3,"src","width","height","alt"],[1,"rich-unfurl",3,"href"],[1,"rich-list"],[1,"rich-paragraph"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"rich-unfurl",3,"click","href"],["alt","","decoding","sync",1,"rich-unfurl-thumb",3,"src","width","height"],[1,"rich-unfurl-body"],[1,"rich-unfurl-site"],[1,"rich-unfurl-title"],[1,"rich-unfurl-description"]],template:function(n,r){n&1&&($t(0,zD,2,0,"ng-template",null,0,Ha),de(2,nv,6,1,null,null,ar)),n&2&&(D(2),fe(r.blocks()))},dependencies:[qa],encapsulation:2})};var rv=(e,t)=>t.emoji;function ov(e,t){if(e&1&&(I(0,"div",0)(1,"span",10),M(2),w()()),e&2){let n=S();D(2),O(n.dateLabel())}}function iv(e,t){e&1&&(I(0,"div",1)(1,"span",11),M(2,"New"),w()())}function sv(e,t){if(e&1&&(I(0,"span",3),M(1),w()),e&2){let n=S();D(),O(n.message().time)}}function av(e,t){if(e&1&&(I(0,"span",12),M(1),w()),e&2){let n=S();Ke("background-color",n.avatarColors[n.message().colorIndex]),D(),O(n.message().senderInitials)}}function cv(e,t){if(e&1){let n=Re();I(0,"button",13),z("click",function(){let o=ue(n),i=S();return le(i.actions.jumpToMessage(o.id))}),I(1,"span",14),M(2),w(),I(3,"span",15),M(4),w()()}if(e&2){let n=t;D(2),O(n.sender),D(2),O(n.excerpt)}}function uv(e,t){if(e&1&&(I(0,"div",7)(1,"span",16),M(2),w(),I(3,"span",17),M(4),w()()),e&2){let n=S();D(2),O(n.message().sender),D(2),O(n.message().time)}}function lv(e,t){if(e&1&&De(0,"button",18),e&2){let n=t.$implicit;H("reaction",n)}}function dv(e,t){if(e&1&&(I(0,"div",9),de(1,lv,1,1,"button",18,rv),w()),e&2){let n=S();D(),fe(n.message().reactions)}}var ai=class e{index=$.required();message=$.required();highlighted=$.required();dateLabel=$.required();unreadBelow=$.required();actions=m(ft);avatarColors=Sn;static \u0275fac=function(n){return new(n||e)};static \u0275cmp=J({type:e,selectors:[["li","chat-message",""]],hostAttrs:[1,"timeline-message"],hostVars:6,hostBindings:function(n,r){n&2&&(He("data-message-id",r.message().id)("data-index",r.index()),ut("timeline-message-grouped",r.message().grouped)("timeline-message-highlighted",r.highlighted()))},inputs:{index:[1,"index"],message:[1,"message"],highlighted:[1,"highlighted"],dateLabel:[1,"dateLabel"],unreadBelow:[1,"unreadBelow"]},decls:10,vars:7,consts:[[1,"timeline-date-separator"],["aria-label","Unread messages",1,"timeline-unread-divider"],[1,"timeline-message-row"],[1,"timeline-message-gutter"],[1,"avatar",3,"background-color"],[1,"timeline-message-body"],["type","button",1,"timeline-message-reply"],[1,"timeline-message-meta"],["chat-rich-text","",1,"timeline-message-text",3,"blocks"],[1,"timeline-message-reactions"],[1,"timeline-date-separator-label"],[1,"timeline-unread-divider-label"],[1,"avatar"],["type","button",1,"timeline-message-reply",3,"click"],[1,"timeline-message-reply-sender"],[1,"timeline-message-reply-excerpt"],[1,"timeline-message-sender"],[1,"timeline-message-time"],["chat-reaction","",3,"reaction"]],template:function(n,r){if(n&1&&(Ae(0,ov,3,1,"div",0),Ae(1,iv,3,0,"div",1),I(2,"div",2),Ae(3,sv,2,1,"span",3)(4,av,2,3,"span",4),I(5,"div",5),Ae(6,cv,5,2,"button",6),Ae(7,uv,5,2,"div",7),De(8,"div",8),Ae(9,dv,3,0,"div",9),w()()),n&2){let o;xe(r.dateLabel()!==null?0:-1),D(),xe(r.unreadBelow()?1:-1),D(2),xe(r.message().grouped?3:4),D(3),xe((o=r.message().replyTo)?6:-1,o),D(),xe(r.message().grouped?-1:7),D(),H("blocks",r.message().blocks),D(),xe(r.message().reactions.length>0?9:-1)}},dependencies:[ii,si],encapsulation:2})};var fv=(e,t)=>t.message.id;function pv(e,t){if(e&1&&De(0,"li",1),e&2){let n=t.$implicit,r=S();H("index",n.index)("message",n.message)("highlighted",n.message.id===r.highlightedId())("dateLabel",n.dateLabel)("unreadBelow",n.unreadBelow)}}var gc=4,hv=100,gv=4,mv=300,yv=120,ci=class e{room=$.required();roomSelected=_n();scroller=m(rr).nativeElement;highlightedId=ie(null);sent=ie([]);messages=Oe(()=>{let t=this.sent();return t.length?[...this.room().messages,...t]:this.room().messages});heights=Oe(()=>{let t=this.room().messages.length;return new oi(t,Math.max(0,t-mv),hv)});heightsVersion=ie(0);indexById=Oe(()=>{let t=this.messages(),n=null;return r=>(n===null&&(n=new Map(t.map((o,i)=>[o.id,i]))),n.get(r))});range=ie({start:0,end:0},{equal:(t,n)=>t.start===n.start&&t.end===n.end});pinnedToBottom=!0;jumpTarget=null;anchor=null;rows=Oe(()=>{let t=this.messages(),{start:n,end:r}=this.range(),o=this.room().readUpToIndex,i=t[t.length-1].dayIndex,s=[];for(let a=n;a0?t[a-1]:null,l=u===null||u.dayIndex!==c.dayIndex;s.push({index:a,message:c,dateLabel:l?pc(c.dayIndex,i):null,unreadBelow:a===o+1})}return s});spacers=Oe(()=>{this.heightsVersion();let t=this.heights(),{start:n,end:r}=this.range();return{top:t.offsetAt(n),bottom:t.totalHeight-t.offsetAt(r)}});constructor(){tf(()=>{this.rows(),this.spacers(),this.highlightedId(),Go(()=>this.settle())})}selectRoom(t){this.roomSelected.emit(t)}jumpToMessage(t){let n=this.indexById()(t);if(n===void 0)return;let r=this.heights();this.highlightedId.set(t),this.pinnedToBottom=!1,this.jumpTarget=n,no+1)),this.scroller.scrollTop=this.centeredOffset(n,this.scroller.clientHeight),this.range.set(this.rangeFor(this.scroller.scrollTop,this.scroller.clientHeight))}send(t){this.pinnedToBottom=!0,this.jumpTarget=null,this.sent.update(n=>[...n,kf(this.room(),n.length,t)]),this.heights().grow(this.messages().length),this.heightsVersion.update(n=>n+1)}handleScroll(){let t=this.scroller,n=this.heights();if(this.pinnedToBottom=t.scrollHeight-(t.scrollTop+t.clientHeight)<=gv,n.first>0&&t.scrollTopr+1);return}this.range.set(this.rangeFor(t.scrollTop,t.clientHeight))}settle(){let t=this.scroller,n=this.heights(),r=t.clientHeight,o=this.anchor,i=o??this.captureAnchor(t.scrollTop),s=!1;for(let a of t.querySelectorAll(".timeline-message"))n.measure(Number(a.dataset.index),a.getBoundingClientRect().height)&&(s=!0);if(s){this.anchor=i,this.heightsVersion.update(a=>a+1);return}this.anchor=null,this.jumpTarget!==null?(t.scrollTop=this.centeredOffset(this.jumpTarget,r),this.jumpTarget=null):this.pinnedToBottom?t.scrollTop=t.scrollHeight:o&&(t.scrollTop=n.offsetAt(o.index)+o.offset),this.range.set(this.rangeFor(t.scrollTop,r))}rangeFor(t,n){let r=this.heights(),o=r.indexAt(t),i=t+n,s=o;for(;s+1e)}])],decls:4,vars:4,consts:[["aria-hidden","true",1,"timeline-spacer"],["chat-message","",3,"index","message","highlighted","dateLabel","unreadBelow"]],template:function(n,r){n&1&&(De(0,"li",0),de(1,pv,1,5,"li",1,fv),De(3,"li",0)),n&2&&(Ke("height",r.spacers().top,"px"),D(),fe(r.rows()),D(2),Ke("height",r.spacers().bottom,"px"))},dependencies:[ai],encapsulation:2})};var Dv=e=>[e],vv=(e,t)=>t.id;function Ev(e,t){if(e&1){let n=Re();I(0,"ol",6,0),z("roomSelected",function(o){ue(n);let i=S();return le(i.select(o))}),w(),I(2,"form",7),z("send",function(o){ue(n);let i=Qe(1);return le(i.send(o))}),w()}if(e&2){let n=t.$implicit;H("room",n),D(2),H("roomName",n.name)}}var ui=class e{rooms=ti;selectedRoomId=ie(ti[0].id);selectedRoom=Oe(()=>ti.find(t=>t.id===this.selectedRoomId()));select(t){this.selectedRoomId.set(t)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=J({type:e,selectors:[["div","chat-app",""]],hostAttrs:[1,"app"],decls:9,vars:6,consts:[["timeline",""],["chat-room-list","",3,"roomSelected","rooms","selectedRoomId"],[1,"room"],[1,"room-header"],["id","room-header-name",1,"room-header-name"],[1,"room-header-topic"],["chat-timeline","",3,"roomSelected","room"],["chat-composer","",3,"send","roomName"]],template:function(n,r){n&1&&(I(0,"nav",1),z("roomSelected",function(i){return r.select(i)}),w(),I(1,"main",2)(2,"header",3)(3,"h1",4),M(4),w(),I(5,"p",5),M(6),w()(),de(7,Ev,3,2,null,null,vv),w()),n&2&&(H("rooms",r.rooms)("selectedRoomId",r.selectedRoomId()),D(4),O(r.selectedRoom().name),D(2),O(r.selectedRoom().topic),D(),fe(Gt(4,Dv,r.selectedRoom())))},dependencies:[Ko,ri,ci],encapsulation:2})};nc(ui,{providers:[Kd()]}).catch(e=>console.error(e)); +/*! Bundled license information: + +@angular/core/fesm2022/_effect-chunk.mjs: +@angular/core/fesm2022/_not_found-chunk.mjs: +@angular/core/fesm2022/primitives-di.mjs: +@angular/core/fesm2022/_untracked-chunk.mjs: +@angular/core/fesm2022/primitives-signals.mjs: +@angular/core/fesm2022/_pending_tasks-chunk.mjs: +@angular/core/fesm2022/_debug_node-chunk.mjs: +@angular/core/fesm2022/_resource-chunk.mjs: +@angular/core/fesm2022/core.mjs: +@angular/common/fesm2022/_platform_location-chunk.mjs: +@angular/common/fesm2022/_common_module-chunk.mjs: +@angular/common/fesm2022/_xhr-chunk.mjs: +@angular/common/fesm2022/common.mjs: +@angular/platform-browser/fesm2022/_dom_renderer-chunk.mjs: +@angular/platform-browser/fesm2022/_browser-chunk.mjs: +@angular/platform-browser/fesm2022/platform-browser.mjs: + (** + * @license Angular v22.2.4 + * (c) 2010-2026 Google LLC. https://angular.dev/ + * License: MIT + *) +*/ +//# debugId=ed51910e-9cb1-5788-a015-9c114d78cc74 +//# sourceMappingURL=main.js.map diff --git a/suites-experimental/chat-room-angular/dist/main.js.map b/suites-experimental/chat-room-angular/dist/main.js.map new file mode 100644 index 000000000..5130505ab --- /dev/null +++ b/suites-experimental/chat-room-angular/dist/main.js.map @@ -0,0 +1 @@ +{"x_google_ignoreList":[6,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"version":3,"sources":["../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/signals/src/graph.ts","../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/signals/src/equality.ts","../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/signals/src/computed.ts","../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/signals/src/errors.ts","../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/signals/src/signal.ts","../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/signals/src/effect.ts","node_modules/@angular/core/fesm2022/_not_found-chunk.mjs","../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/signals/src/linked_signal.ts","../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/signals/src/untracked.ts","node_modules/rxjs/dist/esm/internal/util/isFunction.js","node_modules/rxjs/dist/esm/internal/util/createErrorClass.js","node_modules/rxjs/dist/esm/internal/util/UnsubscriptionError.js","node_modules/rxjs/dist/esm/internal/util/arrRemove.js","node_modules/rxjs/dist/esm/internal/Subscription.js","node_modules/rxjs/dist/esm/internal/config.js","node_modules/rxjs/dist/esm/internal/scheduler/timeoutProvider.js","node_modules/rxjs/dist/esm/internal/util/reportUnhandledError.js","node_modules/rxjs/dist/esm/internal/util/noop.js","node_modules/rxjs/dist/esm/internal/NotificationFactories.js","node_modules/rxjs/dist/esm/internal/util/errorContext.js","node_modules/rxjs/dist/esm/internal/Subscriber.js","node_modules/rxjs/dist/esm/internal/symbol/observable.js","node_modules/rxjs/dist/esm/internal/util/identity.js","node_modules/rxjs/dist/esm/internal/util/pipe.js","node_modules/rxjs/dist/esm/internal/Observable.js","node_modules/rxjs/dist/esm/internal/util/lift.js","node_modules/rxjs/dist/esm/internal/operators/OperatorSubscriber.js","node_modules/rxjs/dist/esm/internal/util/ObjectUnsubscribedError.js","node_modules/rxjs/dist/esm/internal/Subject.js","node_modules/rxjs/dist/esm/internal/BehaviorSubject.js","node_modules/rxjs/dist/esm/internal/operators/map.js","node_modules/@angular/core/fesm2022/_pending_tasks-chunk.mjs","node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs","node_modules/@angular/core/fesm2022/_resource-chunk.mjs","node_modules/@angular/core/fesm2022/core.mjs","node_modules/@angular/common/fesm2022/_platform_location-chunk.mjs","node_modules/@angular/common/fesm2022/_common_module-chunk.mjs","node_modules/@angular/common/fesm2022/_xhr-chunk.mjs","node_modules/@angular/common/fesm2022/common.mjs","node_modules/@angular/platform-browser/fesm2022/_dom_renderer-chunk.mjs","node_modules/@angular/platform-browser/fesm2022/_browser-chunk.mjs","src/components/composer.ts","src/data/graphics.js","src/data/rooms.js","src/data.ts","src/components/room-list-item.ts","src/components/room-list.ts","src/actions.ts","src/row-heights.js","src/components/reaction.ts","src/components/rich-text.ts","src/components/message.ts","src/components/timeline.ts","src/app.ts","src/main.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n// Required as the signals library is in a separate package, so we need to explicitly ensure the\n// global `ngDevMode` type is defined.\ndeclare const ngDevMode: boolean | undefined;\n\n/**\n * The currently active consumer `ReactiveNode`, if running code in a reactive context.\n *\n * Change this via `setActiveConsumer`.\n *\n * Safari 16-17 have a JIT bug where assigning to a module-level let/var can\n * sometimes fail to write the value. We wrap in an array to keep a constant\n * variable with a mutable internal value.\n */\nconst activeConsumer: [ReactiveNode | null] = [null];\nconst inNotificationPhase: [boolean] = [false];\n\nexport type Version = number & {__brand: 'Version'};\n\n/**\n * Global epoch counter. Incremented whenever a source signal is set.\n */\nlet epoch: Version = 1 as Version;\n\nexport type ReactiveHookFn = (node: ReactiveNode) => void;\n\n/**\n * If set, called after a producer `ReactiveNode` is created.\n */\nlet postProducerCreatedFn: ReactiveHookFn | null = null;\n\n/**\n * Symbol used to tell `Signal`s apart from other functions.\n *\n * This can be used to auto-unwrap signals in various cases, or to auto-wrap non-signal values.\n */\nexport const SIGNAL: unique symbol = /* @__PURE__ */ Symbol('SIGNAL');\n\nexport function setActiveConsumer(consumer: ReactiveNode | null): ReactiveNode | null {\n const prev = activeConsumer[0];\n activeConsumer[0] = consumer;\n return prev;\n}\n\nexport function getActiveConsumer(): ReactiveNode | null {\n return activeConsumer[0];\n}\n\nexport function isInNotificationPhase(): boolean {\n return inNotificationPhase[0];\n}\n\nexport interface Reactive {\n [SIGNAL]: ReactiveNode;\n}\n\nexport function isReactive(value: unknown): value is Reactive {\n return (value as Partial)[SIGNAL] !== undefined;\n}\n\nexport const REACTIVE_NODE: ReactiveNode = {\n version: 0 as Version,\n lastCleanEpoch: 0 as Version,\n dirty: false,\n producers: undefined,\n producersTail: undefined,\n consumers: undefined,\n consumersTail: undefined,\n recomputing: false,\n consumerAllowSignalWrites: false,\n consumerIsAlwaysLive: false,\n kind: 'unknown',\n producerMustRecompute: () => false,\n producerRecomputeValue: () => {},\n consumerMarkedDirty: () => {},\n consumerOnSignalRead: () => {},\n};\n\ninterface ReactiveLink {\n producer: ReactiveNode;\n consumer: ReactiveNode;\n\n /**\n * Stores the epoch that holds when this link was observed, allowing subsequent observations of the same producer to\n * realize that there's an existing link, avoiding the creation of a new, redundant link. A value of `null` indicates\n * that the link cannot be assumed to be valid based on the epoch counter.\n */\n knownValidAtEpoch: Version | null;\n lastReadVersion: number;\n prevConsumer: ReactiveLink | undefined;\n nextConsumer: ReactiveLink | undefined;\n nextProducer: ReactiveLink | undefined;\n}\n\nexport type ReactiveNodeKind =\n | 'signal'\n | 'computed'\n | 'effect'\n | 'template'\n | 'linkedSignal'\n | 'afterRenderEffectPhase'\n | 'childSignalProp' // Represents a signal passed as a prop to a child component in a CoW app\n | 'unknown';\n\n/**\n * A producer and/or consumer which participates in the reactive graph.\n *\n * Producer `ReactiveNode`s which are accessed when a consumer `ReactiveNode` is the\n * `activeConsumer` are tracked as dependencies of that consumer.\n *\n * Certain consumers are also tracked as \"live\" consumers and create edges in the other direction,\n * from producer to consumer. These edges are used to propagate change notifications when a\n * producer's value is updated.\n *\n * A `ReactiveNode` may be both a producer and consumer.\n */\nexport interface ReactiveNode {\n /**\n * Version of the value that this node produces.\n *\n * This is incremented whenever a new value is produced by this node which is not equal to the\n * previous value (by whatever definition of equality is in use).\n */\n version: Version;\n\n /**\n * Epoch at which this node is verified to be clean.\n *\n * This allows skipping of some polling operations in the case where no signals have been set\n * since this node was last read.\n */\n lastCleanEpoch: Version;\n\n /**\n * Whether this node (in its consumer capacity) is dirty.\n *\n * Only live consumers become dirty, when receiving a change notification from a dependency\n * producer.\n */\n dirty: boolean;\n\n /**\n * Whether this node is currently rebuilding its producer list.\n */\n recomputing: boolean;\n\n /**\n * Producers which are dependencies of this consumer.\n */\n producers: ReactiveLink | undefined;\n\n /**\n * Points to the last linked list node in the `producers` linked list.\n *\n * When this node is recomputing, this is used to track the producers that we have accessed so far.\n */\n producersTail: ReactiveLink | undefined;\n\n /**\n * Linked list of consumers of this producer that are \"live\" (they require push notifications).\n *\n * The length of this list is effectively our reference count for this node.\n */\n consumers: ReactiveLink | undefined;\n consumersTail: ReactiveLink | undefined;\n\n /**\n * Whether writes to signals are allowed when this consumer is the `activeConsumer`.\n *\n * This is used to enforce guardrails such as preventing writes to writable signals in the\n * computation function of computed signals, which is supposed to be pure.\n */\n consumerAllowSignalWrites: boolean;\n\n readonly consumerIsAlwaysLive: boolean;\n\n /**\n * Tracks whether producers need to recompute their value independently of the reactive graph (for\n * example, if no initial value has been computed).\n */\n producerMustRecompute(node: unknown): boolean;\n producerRecomputeValue(node: unknown): void;\n consumerMarkedDirty(node: unknown): void;\n\n /**\n * Called when a signal is read within this consumer.\n */\n consumerOnSignalRead(node: unknown): void;\n\n /**\n * A debug name for the reactive node. Used in Angular DevTools to identify the node.\n */\n debugName?: string;\n\n /**\n * Kind of node. Example: 'signal', 'computed', 'input', 'effect'.\n *\n * ReactiveNode has this as 'unknown' by default, but derived node types should override this to\n * make available the kind of signal that particular instance of a ReactiveNode represents.\n *\n * Used in Angular DevTools to identify the kind of signal.\n */\n kind: ReactiveNodeKind;\n}\n\n/**\n * Called by implementations when a producer's signal is read.\n */\nexport function producerAccessed(node: ReactiveNode): void {\n if (inNotificationPhase[0]) {\n throw new Error(\n typeof ngDevMode !== 'undefined' && ngDevMode\n ? `Assertion error: signal read during notification phase`\n : '',\n );\n }\n\n const consumer = activeConsumer[0];\n if (consumer === null) {\n // Accessed outside of a reactive context, so nothing to record.\n return;\n }\n\n consumer.consumerOnSignalRead(node);\n\n const prevProducerLink = consumer.producersTail;\n\n // If the last producer we accessed is the same as the current one, we can skip adding a new\n // link\n if (prevProducerLink !== undefined && prevProducerLink.producer === node) {\n return;\n }\n\n let nextProducerLink: ReactiveLink | undefined = undefined;\n const isRecomputing = consumer.recomputing;\n if (isRecomputing) {\n // If we're incrementally rebuilding the producers list, we want to check if the next producer\n // in the list is the same as the one we're trying to add.\n\n // If the previous producer is defined, then the next producer is just the one that follows it.\n // Otherwise, we should check the head of the producers list (the first node that we accessed the last time this consumer was run).\n nextProducerLink =\n prevProducerLink !== undefined ? prevProducerLink.nextProducer : consumer.producers;\n if (nextProducerLink !== undefined && nextProducerLink.producer === node) {\n // If the next producer is the same as the one we're trying to add, we can just update the\n // last read version, update the tail of the producers list of this rerun, and return.\n consumer.producersTail = nextProducerLink;\n nextProducerLink.lastReadVersion = node.version;\n nextProducerLink.knownValidAtEpoch = epoch;\n return;\n }\n }\n\n const prevConsumerLink = node.consumersTail;\n\n // If the producer we're accessing already has a link to this consumer, we can skip adding a new\n // link. This can short circuit the creation of a new link in the case where the consumer reads alternating ReactiveNodes\n if (\n prevConsumerLink !== undefined &&\n prevConsumerLink.consumer === consumer &&\n (!isRecomputing || prevConsumerLink.knownValidAtEpoch === epoch)\n ) {\n return;\n }\n\n // If we got here, it means that we need to create a new link between the producer and the consumer.\n const isLive = consumerIsLive(consumer);\n const newLink: ReactiveLink = {\n producer: node,\n consumer: consumer,\n // instead of eagerly destroying the previous link, we delay until we've finished recomputing\n // the producers list, so that we can destroy all of the old links at once.\n nextProducer: nextProducerLink,\n // Don't set prevConsumer here โ€” it's only meaningful when the link is part of\n // the producer's consumer list. producerAddLiveConsumer sets it correctly when\n // the link is actually inserted. Setting it eagerly would create a dangling\n // reference into the consumer list that prevents GC of removed entries.\n prevConsumer: undefined,\n knownValidAtEpoch: epoch,\n lastReadVersion: node.version,\n nextConsumer: undefined,\n };\n consumer.producersTail = newLink;\n if (prevProducerLink !== undefined) {\n prevProducerLink.nextProducer = newLink;\n } else {\n consumer.producers = newLink;\n }\n\n if (isLive) {\n producerAddLiveConsumer(node, newLink);\n }\n}\n\n/**\n * Increment the global epoch counter.\n *\n * Called by source producers (that is, not computeds) whenever their values change.\n */\nexport function producerIncrementEpoch(): void {\n epoch++;\n}\n\n/**\n * Ensure this producer's `version` is up-to-date.\n */\nexport function producerUpdateValueVersion(node: ReactiveNode): void {\n if (consumerIsLive(node) && !node.dirty) {\n // A live consumer will be marked dirty by producers, so a clean state means that its version\n // is guaranteed to be up-to-date.\n return;\n }\n\n if (!node.dirty && node.lastCleanEpoch === epoch) {\n // Even non-live consumers can skip polling if they previously found themselves to be clean at\n // the current epoch, since their dependencies could not possibly have changed (such a change\n // would've increased the epoch).\n return;\n }\n\n if (!node.producerMustRecompute(node) && !consumerPollProducersForChange(node)) {\n // None of our producers report a change since the last time they were read, so no\n // recomputation of our value is necessary, and we can consider ourselves clean.\n producerMarkClean(node);\n return;\n }\n\n node.producerRecomputeValue(node);\n\n // After recomputing the value, we're no longer dirty.\n producerMarkClean(node);\n}\n\n/**\n * Propagate a dirty notification to live consumers of this producer.\n */\nexport function producerNotifyConsumers(node: ReactiveNode): void {\n if (node.consumers === undefined) {\n return;\n }\n\n // Prevent signal reads when we're updating the graph\n const prev = inNotificationPhase[0];\n inNotificationPhase[0] = true;\n try {\n for (\n let link: ReactiveLink | undefined = node.consumers;\n link !== undefined;\n link = link.nextConsumer\n ) {\n const consumer = link.consumer;\n if (!consumer.dirty) {\n consumerMarkDirty(consumer);\n }\n }\n } finally {\n inNotificationPhase[0] = prev;\n }\n}\n\n/**\n * Whether this `ReactiveNode` in its producer capacity is currently allowed to initiate updates,\n * based on the current consumer context.\n */\nexport function producerUpdatesAllowed(): boolean {\n return activeConsumer[0]?.consumerAllowSignalWrites !== false;\n}\n\nexport function consumerMarkDirty(node: ReactiveNode): void {\n node.dirty = true;\n producerNotifyConsumers(node);\n node.consumerMarkedDirty?.(node);\n}\n\nexport function producerMarkClean(node: ReactiveNode): void {\n node.dirty = false;\n node.lastCleanEpoch = epoch;\n}\n\n/**\n * Prepare this consumer to run a computation in its reactive context and set\n * it as the active consumer.\n *\n * Must be called by subclasses which represent reactive computations, before those computations\n * begin.\n */\nexport function consumerBeforeComputation(node: ReactiveNode | null): ReactiveNode | null {\n if (node) resetConsumerBeforeComputation(node);\n\n return setActiveConsumer(node);\n}\n\n/**\n * Prepare this consumer to run a computation in its reactive context.\n *\n * We expose this mainly for code where we manually batch effects into a single\n * consumer. In those cases we may wish to \"reopen\" a consumer multiple times\n * in initial render before finalizing it. Most code should just call\n * `consumerBeforeComputation` instead of calling this directly.\n */\nexport function resetConsumerBeforeComputation(node: ReactiveNode): void {\n // Clear link validity state before running a computation, such that links that were captured in a prior computation\n // (which may have happened in the same epoch) are not mistakenly considered valid. This is only necessary if any of\n // the links has `knownValidAtEpoch` equal to the current epoch, for which the producer that was accessed last is used\n // as proxy: any earlier producers cannot exceed its epoch.\n if (node.producersTail?.knownValidAtEpoch === epoch) {\n let producer = node.producers;\n while (producer !== undefined) {\n producer.knownValidAtEpoch = null;\n producer = producer.nextProducer;\n }\n }\n\n node.producersTail = undefined;\n node.recomputing = true;\n}\n\n/**\n * Finalize this consumer's state and set previous consumer as the active consumer after a\n * reactive computation has run.\n *\n * Must be called by subclasses which represent reactive computations, after those computations\n * have finished.\n */\nexport function consumerAfterComputation(\n node: ReactiveNode | null,\n prevConsumer: ReactiveNode | null,\n): void {\n setActiveConsumer(prevConsumer);\n\n if (node) finalizeConsumerAfterComputation(node);\n}\n\n/**\n * Finalize this consumer's state after a reactive computation has run.\n *\n * We expose this mainly for code where we manually batch effects into a single\n * consumer. In those cases we may wish to \"reopen\" a consumer multiple times\n * in initial render before finalizing it. Most code should just call\n * `consumerAfterComputation` instead of calling this directly.\n */\nexport function finalizeConsumerAfterComputation(node: ReactiveNode): void {\n node.recomputing = false;\n\n // We've finished incrementally rebuilding the producers list, now if there are any producers\n // that are after producersTail, they are stale and should be removed.\n const producersTail = node.producersTail as ReactiveLink | undefined;\n let toRemove = producersTail !== undefined ? producersTail.nextProducer : node.producers;\n if (toRemove !== undefined) {\n if (consumerIsLive(node)) {\n // For each stale link, we first unlink it from the producers list of consumers\n do {\n toRemove = producerRemoveLiveConsumerLink(toRemove);\n } while (toRemove !== undefined);\n }\n\n // Now, we can truncate the producers list to remove all stale links.\n if (producersTail !== undefined) {\n producersTail.nextProducer = undefined;\n } else {\n node.producers = undefined;\n }\n }\n}\n\n/**\n * Determine whether this consumer has any dependencies which have changed since the last time\n * they were read.\n */\nexport function consumerPollProducersForChange(node: ReactiveNode): boolean {\n // Poll producers for change.\n for (let link = node.producers; link !== undefined; link = link.nextProducer) {\n const producer = link.producer;\n const seenVersion = link.lastReadVersion;\n\n // First check the versions. A mismatch means that the producer's value is known to have\n // changed since the last time we read it.\n if (seenVersion !== producer.version) {\n return true;\n }\n\n // The producer's version is the same as the last time we read it, but it might itself be\n // stale. Force the producer to recompute its version (calculating a new value if necessary).\n producerUpdateValueVersion(producer);\n\n // Now when we do this check, `producer.version` is guaranteed to be up to date, so if the\n // versions still match then it has not changed since the last time we read it.\n if (seenVersion !== producer.version) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Disconnect this consumer from the graph.\n */\nexport function consumerDestroy(node: ReactiveNode): void {\n if (consumerIsLive(node)) {\n // Drop all connections from the graph to this node.\n let link = node.producers;\n while (link !== undefined) {\n link = producerRemoveLiveConsumerLink(link);\n }\n }\n\n // Truncate all the linked lists to drop all connection from this node to the graph.\n node.producers = undefined;\n node.producersTail = undefined;\n node.consumers = undefined;\n node.consumersTail = undefined;\n}\n\n/**\n * Add `consumer` as a live consumer of this node.\n *\n * Note that this operation is potentially transitive. If this node becomes live, then it becomes\n * a live consumer of all of its current producers.\n */\nfunction producerAddLiveConsumer(node: ReactiveNode, link: ReactiveLink): void {\n const consumersTail = node.consumersTail;\n const wasLive = consumerIsLive(node);\n if (consumersTail !== undefined) {\n link.nextConsumer = consumersTail.nextConsumer;\n consumersTail.nextConsumer = link;\n } else {\n link.nextConsumer = undefined;\n node.consumers = link;\n }\n link.prevConsumer = consumersTail;\n node.consumersTail = link;\n if (!wasLive) {\n for (\n let link: ReactiveLink | undefined = node.producers;\n link !== undefined;\n link = link.nextProducer\n ) {\n producerAddLiveConsumer(link.producer, link);\n }\n }\n}\n\nfunction producerRemoveLiveConsumerLink(link: ReactiveLink): ReactiveLink | undefined {\n const producer = link.producer;\n const nextProducer = link.nextProducer;\n const nextConsumer = link.nextConsumer;\n const prevConsumer = link.prevConsumer;\n link.nextConsumer = undefined;\n link.prevConsumer = undefined;\n if (nextConsumer !== undefined) {\n nextConsumer.prevConsumer = prevConsumer;\n } else {\n producer.consumersTail = prevConsumer;\n }\n if (prevConsumer !== undefined) {\n prevConsumer.nextConsumer = nextConsumer;\n } else {\n producer.consumers = nextConsumer;\n if (!consumerIsLive(producer)) {\n let producerLink = producer.producers;\n while (producerLink !== undefined) {\n producerLink = producerRemoveLiveConsumerLink(producerLink);\n }\n }\n }\n return nextProducer;\n}\n\nfunction consumerIsLive(node: ReactiveNode): boolean {\n return node.consumerIsAlwaysLive || node.consumers !== undefined;\n}\n\nexport function runPostProducerCreatedFn(node: ReactiveNode): void {\n postProducerCreatedFn?.(node);\n}\n\nexport function setPostProducerCreatedFn(fn: ReactiveHookFn | null): ReactiveHookFn | null {\n const prev = postProducerCreatedFn;\n postProducerCreatedFn = fn;\n return prev;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * A comparison function which can determine if two values are equal.\n */\nexport type ValueEqualityFn = (a: T, b: T) => boolean;\n\n/**\n * The default equality function used for `signal` and `computed`, which uses referential equality.\n */\nexport function defaultEquals(a: T, b: T) {\n return Object.is(a, b);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {defaultEquals, ValueEqualityFn} from './equality';\nimport {\n consumerAfterComputation,\n consumerBeforeComputation,\n producerAccessed,\n producerUpdateValueVersion,\n REACTIVE_NODE,\n ReactiveNode,\n runPostProducerCreatedFn,\n setActiveConsumer,\n SIGNAL,\n} from './graph';\n\n// Required as the signals library is in a separate package, so we need to explicitly ensure the\n// global `ngDevMode` type is defined.\ndeclare const ngDevMode: boolean | undefined;\n\n/**\n * A computation, which derives a value from a declarative reactive expression.\n *\n * `Computed`s are both producers and consumers of reactivity.\n */\nexport interface ComputedNode extends ReactiveNode {\n /**\n * Current value of the computation, or one of the sentinel values above (`UNSET`, `COMPUTING`,\n * `ERROR`).\n */\n value: T;\n\n /**\n * If `value` is `ERRORED`, the error caught from the last computation attempt which will\n * be re-thrown.\n */\n error: unknown;\n\n /**\n * The computation function which will produce a new value.\n */\n computation: () => T;\n\n equal: ValueEqualityFn;\n}\n\nexport type ComputedGetter = (() => T) & {\n [SIGNAL]: ComputedNode;\n};\n\n/**\n * Create a computed signal which derives a reactive value from an expression.\n */\nexport function createComputed(\n computation: () => T,\n equal?: ValueEqualityFn,\n): ComputedGetter {\n const node: ComputedNode = Object.create(COMPUTED_NODE);\n node.computation = computation;\n\n if (equal !== undefined) {\n node.equal = equal;\n }\n\n const computed = () => {\n // Check if the value needs updating before returning it.\n producerUpdateValueVersion(node);\n\n // Record that someone looked at this signal.\n producerAccessed(node);\n\n if (node.value === ERRORED) {\n throw node.error;\n }\n\n return node.value;\n };\n\n (computed as ComputedGetter)[SIGNAL] = node;\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n computed.toString = () =>\n `[Computed${node.debugName ? ' (' + node.debugName + ')' : ''}: ${String(node.value)}]`;\n }\n\n runPostProducerCreatedFn(node);\n\n return computed as unknown as ComputedGetter;\n}\n\n/**\n * A dedicated symbol used before a computed value has been calculated for the first time.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nexport const UNSET: any = /* @__PURE__ */ Symbol('UNSET');\n\n/**\n * A dedicated symbol used in place of a computed signal value to indicate that a given computation\n * is in progress. Used to detect cycles in computation chains.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nexport const COMPUTING: any = /* @__PURE__ */ Symbol('COMPUTING');\n\n/**\n * A dedicated symbol used in place of a computed signal value to indicate that a given computation\n * failed. The thrown error is cached until the computation gets dirty again.\n * Explicitly typed as `any` so we can use it as signal's value.\n */\nexport const ERRORED: any = /* @__PURE__ */ Symbol('ERRORED');\n\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\nconst COMPUTED_NODE: Omit, 'computation'> = /* @__PURE__ */ (() => {\n return {\n ...REACTIVE_NODE,\n value: UNSET,\n dirty: true,\n error: null,\n equal: defaultEquals,\n kind: 'computed',\n\n producerMustRecompute(node: ComputedNode): boolean {\n // Force a recomputation if there's no current value, or if the current value is in the\n // process of being calculated (which should throw an error).\n return node.value === UNSET || node.value === COMPUTING;\n },\n\n producerRecomputeValue(node: ComputedNode): void {\n if (node.value === COMPUTING) {\n // Our computation somehow led to a cyclic read of itself.\n throw new Error(\n typeof ngDevMode !== 'undefined' && ngDevMode ? 'Detected cycle in computations.' : '',\n );\n }\n\n const oldValue = node.value;\n node.value = COMPUTING;\n\n const prevConsumer = consumerBeforeComputation(node);\n let newValue: unknown;\n let wasEqual = false;\n try {\n newValue = node.computation();\n // We want to mark this node as errored if calling `equal` throws; however, we don't want\n // to track any reactive reads inside `equal`.\n setActiveConsumer(null);\n wasEqual =\n oldValue !== UNSET &&\n oldValue !== ERRORED &&\n newValue !== ERRORED &&\n node.equal(oldValue, newValue);\n } catch (err) {\n newValue = ERRORED;\n node.error = err;\n } finally {\n consumerAfterComputation(node, prevConsumer);\n }\n\n if (wasEqual) {\n // No change to `valueVersion` - old and new values are\n // semantically equivalent.\n node.value = oldValue;\n return;\n }\n\n node.value = newValue;\n node.version++;\n },\n };\n})();\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport type {SignalNode} from './signal';\n\nfunction defaultThrowError(): never {\n throw new Error();\n}\n\nlet throwInvalidWriteToSignalErrorFn: (node: SignalNode) => never = defaultThrowError;\n\nexport function throwInvalidWriteToSignalError(node: SignalNode) {\n throwInvalidWriteToSignalErrorFn(node);\n}\n\nexport function setThrowInvalidWriteToSignalError(fn: (node: SignalNode) => never): void {\n throwInvalidWriteToSignalErrorFn = fn;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {defaultEquals, ValueEqualityFn} from './equality';\nimport {throwInvalidWriteToSignalError} from './errors';\nimport {\n producerAccessed,\n producerIncrementEpoch,\n producerNotifyConsumers,\n producerUpdatesAllowed,\n REACTIVE_NODE,\n ReactiveNode,\n ReactiveHookFn,\n runPostProducerCreatedFn,\n SIGNAL,\n} from './graph';\n\n// Required as the signals library is in a separate package, so we need to explicitly ensure the\n// global `ngDevMode` type is defined.\ndeclare const ngDevMode: boolean | undefined;\n\n/**\n * If set, called after `WritableSignal`s are updated.\n *\n * This hook can be used to achieve various effects, such as running effects synchronously as part\n * of setting a signal.\n */\nlet postSignalSetFn: ReactiveHookFn | null = null;\n\nexport interface SignalNode extends ReactiveNode {\n value: T;\n equal: ValueEqualityFn;\n}\n\nexport type SignalBaseGetter = (() => T) & {readonly [SIGNAL]: unknown};\nexport type SignalSetter = (newValue: T) => void;\nexport type SignalUpdater = (updateFn: (value: T) => T) => void;\n\n// Note: Closure *requires* this to be an `interface` and not a type, which is why the\n// `SignalBaseGetter` type exists to provide the correct shape.\nexport interface SignalGetter extends SignalBaseGetter {\n readonly [SIGNAL]: SignalNode;\n}\n\n/**\n * Creates a `Signal` getter, setter, and updater function.\n */\nexport function createSignal(\n initialValue: T,\n equal?: ValueEqualityFn,\n): [SignalGetter, SignalSetter, SignalUpdater] {\n const node: SignalNode = Object.create(SIGNAL_NODE);\n node.value = initialValue;\n if (equal !== undefined) {\n node.equal = equal;\n }\n const getter = (() => signalGetFn(node)) as SignalGetter;\n (getter as any)[SIGNAL] = node;\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n getter.toString = () =>\n `[Signal${node.debugName ? ' (' + node.debugName + ')' : ''}: ${String(node.value)}]`;\n }\n\n runPostProducerCreatedFn(node);\n const set = (newValue: T) => signalSetFn(node, newValue);\n const update = (updateFn: (value: T) => T) => signalUpdateFn(node, updateFn);\n return [getter, set, update];\n}\n\nexport function setPostSignalSetFn(fn: ReactiveHookFn | null): ReactiveHookFn | null {\n const prev = postSignalSetFn;\n postSignalSetFn = fn;\n return prev;\n}\n\nexport function signalGetFn(node: SignalNode): T {\n producerAccessed(node);\n return node.value;\n}\n\nexport function signalSetFn(node: SignalNode, newValue: T) {\n if (!producerUpdatesAllowed()) {\n throwInvalidWriteToSignalError(node);\n }\n\n if (!node.equal(node.value, newValue)) {\n node.value = newValue;\n signalValueChanged(node);\n }\n}\n\nexport function signalUpdateFn(node: SignalNode, updater: (value: T) => T): void {\n if (!producerUpdatesAllowed()) {\n throwInvalidWriteToSignalError(node);\n }\n\n signalSetFn(node, updater(node.value));\n}\n\nexport function runPostSignalSetFn(node: SignalNode): void {\n postSignalSetFn?.(node);\n}\n\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.\nexport const SIGNAL_NODE: SignalNode = /* @__PURE__ */ (() => {\n return {\n ...REACTIVE_NODE,\n equal: defaultEquals,\n value: undefined,\n kind: 'signal',\n };\n})();\n\nfunction signalValueChanged(node: SignalNode): void {\n node.version++;\n producerIncrementEpoch();\n producerNotifyConsumers(node);\n postSignalSetFn?.(node);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n consumerAfterComputation,\n consumerBeforeComputation,\n consumerPollProducersForChange,\n REACTIVE_NODE,\n ReactiveNode,\n} from './graph';\n\n/**\n * An effect can, optionally, register a cleanup function. If registered, the cleanup is executed\n * before the next effect run. The cleanup function makes it possible to \"cancel\" any work that the\n * previous effect run might have started.\n */\nexport type EffectCleanupFn = () => void;\n\n/**\n * A callback passed to the effect function that makes it possible to register cleanup logic.\n */\nexport type EffectCleanupRegisterFn = (cleanupFn: EffectCleanupFn) => void;\n\nexport interface BaseEffectNode extends ReactiveNode {\n fn: () => void;\n destroy(): void;\n cleanup(): void;\n run(): void;\n}\n\nexport const BASE_EFFECT_NODE: Omit =\n /* @__PURE__ */ (() => ({\n ...REACTIVE_NODE,\n consumerIsAlwaysLive: true,\n consumerAllowSignalWrites: true,\n dirty: true,\n kind: 'effect',\n }))();\n\nexport function runEffect(node: BaseEffectNode) {\n node.dirty = false;\n if (node.version > 0 && !consumerPollProducersForChange(node)) {\n return;\n }\n node.version++;\n const prevNode = consumerBeforeComputation(node);\n try {\n node.cleanup();\n node.fn();\n } finally {\n consumerAfterComputation(node, prevNode);\n }\n}\n","/**\n * @license Angular v22.2.4\n * (c) 2010-2026 Google LLC. https://angular.dev/\n * License: MIT\n */\n\nconst _currentInjector = [undefined];\nfunction getCurrentInjector() {\n return _currentInjector[0];\n}\nfunction setCurrentInjector(injector) {\n const former = _currentInjector[0];\n _currentInjector[0] = injector;\n return former;\n}\nfunction inject(token, options) {\n const currentInjector = getCurrentInjector();\n if (!currentInjector) {\n throw new Error('Current injector is not set.');\n }\n if (!token.ษตprov) {\n throw new Error('Token is not an injectable');\n }\n return currentInjector.retrieve(token, options);\n}\n\nconst NOT_FOUND = /*#__PURE__*/ Symbol('NotFound');\nclass NotFoundError extends Error {\n name = 'ษตNotFound';\n constructor(message) {\n super(message);\n }\n}\nfunction isNotFound(e) {\n return e === NOT_FOUND || e?.name === 'ษตNotFound';\n}\n\nexport { NOT_FOUND, NotFoundError, getCurrentInjector, inject, isNotFound, setCurrentInjector };\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {COMPUTING, ERRORED, UNSET} from './computed';\nimport {defaultEquals, ValueEqualityFn} from './equality';\nimport {\n consumerAfterComputation,\n consumerBeforeComputation,\n producerAccessed,\n producerMarkClean,\n producerUpdateValueVersion,\n REACTIVE_NODE,\n ReactiveNode,\n runPostProducerCreatedFn,\n setActiveConsumer,\n SIGNAL,\n} from './graph';\nimport {signalSetFn, signalUpdateFn} from './signal';\n\n// Required as the signals library is in a separate package, so we need to explicitly ensure the\n// global `ngDevMode` type is defined.\ndeclare const ngDevMode: boolean | undefined;\n\nexport type ComputationFn = (source: S, previous?: PreviousValue) => D;\nexport type PreviousValue = {source: S; value: D};\n\nexport interface LinkedSignalNode extends ReactiveNode {\n /**\n * Value of the source signal that was used to derive the computed value.\n */\n sourceValue: S;\n\n /**\n * Current state value, or one of the sentinel values (`UNSET`, `COMPUTING`,\n * `ERROR`).\n */\n value: D;\n\n /**\n * If `value` is `ERRORED`, the error caught from the last computation attempt which will\n * be re-thrown.\n */\n error: unknown;\n\n /**\n * The source function represents reactive dependency based on which the linked state is reset.\n */\n source: () => S;\n\n /**\n * The computation function which will produce a new value based on the source and, optionally - previous values.\n */\n computation: ComputationFn;\n\n equal: ValueEqualityFn;\n}\n\nexport type LinkedSignalGetter = (() => D) & {\n [SIGNAL]: LinkedSignalNode;\n};\n\nexport function createLinkedSignal(\n sourceFn: () => S,\n computationFn: ComputationFn,\n equalityFn?: ValueEqualityFn,\n): LinkedSignalGetter {\n const node: LinkedSignalNode = Object.create(LINKED_SIGNAL_NODE);\n\n node.source = sourceFn;\n node.computation = computationFn;\n if (equalityFn != undefined) {\n node.equal = equalityFn;\n }\n\n const linkedSignalGetter = () => {\n // Check if the value needs updating before returning it.\n producerUpdateValueVersion(node);\n\n // Record that someone looked at this signal.\n producerAccessed(node);\n\n if (node.value === ERRORED) {\n throw node.error;\n }\n\n return node.value;\n };\n\n const getter = linkedSignalGetter as LinkedSignalGetter;\n getter[SIGNAL] = node;\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n getter.toString = () =>\n `[LinkedSignal${node.debugName ? ' (' + node.debugName + ')' : ''}: ${String(node.value)}]`;\n }\n\n runPostProducerCreatedFn(node);\n\n return getter;\n}\n\nexport function linkedSignalSetFn(node: LinkedSignalNode, newValue: D) {\n producerUpdateValueVersion(node);\n signalSetFn(node, newValue);\n producerMarkClean(node);\n}\n\nexport function linkedSignalUpdateFn(\n node: LinkedSignalNode,\n updater: (value: D) => D,\n): void {\n producerUpdateValueVersion(node);\n // update() on a linked signal can't work if the current state is ERRORED, as there's no value.\n if (node.value === ERRORED) {\n throw node.error;\n }\n signalUpdateFn(node, updater);\n producerMarkClean(node);\n}\n\n// Note: Using an IIFE here to ensure that the spread assignment is not considered\n// a side-effect, ending up preserving `LINKED_SIGNAL_NODE` and `REACTIVE_NODE`.\nexport const LINKED_SIGNAL_NODE: Omit<\n LinkedSignalNode,\n 'computation' | 'source' | 'sourceValue'\n> = /* @__PURE__ */ (() => {\n return {\n ...REACTIVE_NODE,\n value: UNSET,\n dirty: true,\n error: null,\n equal: defaultEquals,\n kind: 'linkedSignal',\n\n producerMustRecompute(node: LinkedSignalNode): boolean {\n // Force a recomputation if there's no current value, or if the current value is in the\n // process of being calculated (which should throw an error).\n return node.value === UNSET || node.value === COMPUTING;\n },\n\n producerRecomputeValue(node: LinkedSignalNode): void {\n if (node.value === COMPUTING) {\n // Our computation somehow led to a cyclic read of itself.\n throw new Error(\n typeof ngDevMode !== 'undefined' && ngDevMode ? 'Detected cycle in computations.' : '',\n );\n }\n\n const oldValue = node.value;\n node.value = COMPUTING;\n\n const prevConsumer = consumerBeforeComputation(node);\n let newValue: unknown;\n let wasEqual = false;\n try {\n const newSourceValue = node.source();\n const oldValueValid = oldValue !== UNSET && oldValue !== ERRORED;\n const prev = oldValueValid\n ? {\n source: node.sourceValue,\n value: oldValue,\n }\n : undefined;\n newValue = node.computation(newSourceValue, prev);\n node.sourceValue = newSourceValue;\n // We want to mark this node as errored if calling `equal` throws; however, we don't want\n // to track any reactive reads inside `equal`.\n setActiveConsumer(null);\n wasEqual = oldValueValid && newValue !== ERRORED && node.equal(oldValue, newValue);\n } catch (err) {\n newValue = ERRORED;\n node.error = err;\n } finally {\n consumerAfterComputation(node, prevConsumer);\n }\n\n if (wasEqual) {\n // No change to `valueVersion` - old and new values are\n // semantically equivalent.\n node.value = oldValue;\n return;\n }\n\n node.value = newValue;\n node.version++;\n },\n };\n})();\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {setActiveConsumer} from './graph';\n\n/**\n * Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function\n * can, optionally, return a value.\n */\nexport function untracked(nonReactiveReadsFn: () => T): T {\n const prevConsumer = setActiveConsumer(null);\n // We are not trying to catch any particular errors here, just making sure that the consumers\n // stack is restored in case of errors.\n try {\n return nonReactiveReadsFn();\n } finally {\n setActiveConsumer(prevConsumer);\n }\n}\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n","export function createErrorClass(createImpl) {\n const _super = (instance) => {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n const ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n","import { createErrorClass } from './createErrorClass';\nexport const UnsubscriptionError = createErrorClass((_super) => function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}`\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n});\n","export function arrRemove(arr, item) {\n if (arr) {\n const index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n","import { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nexport class Subscription {\n constructor(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n unsubscribe() {\n let errors;\n if (!this.closed) {\n this.closed = true;\n const { _parentage } = this;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n for (const parent of _parentage) {\n parent.remove(this);\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n const { initialTeardown: initialFinalizer } = this;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n const { _finalizers } = this;\n if (_finalizers) {\n this._finalizers = null;\n for (const finalizer of _finalizers) {\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = [...errors, ...err.errors];\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n }\n add(teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n }\n _hasParent(parent) {\n const { _parentage } = this;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n }\n _addParent(parent) {\n const { _parentage } = this;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n }\n _removeParent(parent) {\n const { _parentage } = this;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n }\n remove(teardown) {\n const { _finalizers } = this;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n }\n}\nSubscription.EMPTY = (() => {\n const empty = new Subscription();\n empty.closed = true;\n return empty;\n})();\nexport const EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n","export const config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n","export const timeoutProvider = {\n setTimeout(handler, timeout, ...args) {\n const { delegate } = timeoutProvider;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout(handler, timeout, ...args);\n }\n return setTimeout(handler, timeout, ...args);\n },\n clearTimeout(handle) {\n const { delegate } = timeoutProvider;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(() => {\n const { onUnhandledError } = config;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n","export function noop() { }\n","export const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined))();\nexport function errorNotification(error) {\n return createNotification('E', undefined, error);\n}\nexport function nextNotification(value) {\n return createNotification('N', value, undefined);\n}\nexport function createNotification(kind, value, error) {\n return {\n kind,\n value,\n error,\n };\n}\n","import { config } from '../config';\nlet context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n const isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n const { errorThrown, error } = context;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n","import { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nexport class Subscriber extends Subscription {\n constructor(destination) {\n super();\n this.isStopped = false;\n if (destination) {\n this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(this);\n }\n }\n else {\n this.destination = EMPTY_OBSERVER;\n }\n }\n static create(next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n }\n next(value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n }\n error(err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n }\n complete() {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n }\n unsubscribe() {\n if (!this.closed) {\n this.isStopped = true;\n super.unsubscribe();\n this.destination = null;\n }\n }\n _next(value) {\n this.destination.next(value);\n }\n _error(err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n _complete() {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n }\n}\nconst _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nclass ConsumerObserver {\n constructor(partialObserver) {\n this.partialObserver = partialObserver;\n }\n next(value) {\n const { partialObserver } = this;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n error(err) {\n const { partialObserver } = this;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n }\n complete() {\n const { partialObserver } = this;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n}\nexport class SafeSubscriber extends Subscriber {\n constructor(observerOrNext, error, complete) {\n super();\n let partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n let context;\n if (this && config.useDeprecatedNextContext) {\n context = Object.create(observerOrNext);\n context.unsubscribe = () => this.unsubscribe();\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context),\n error: observerOrNext.error && bind(observerOrNext.error, context),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n this.destination = new ConsumerObserver(partialObserver);\n }\n}\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n const { onStoppedNotification } = config;\n onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));\n}\nexport const EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n","export const observable = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();\n","export function identity(x) {\n return x;\n}\n","import { identity } from './identity';\nexport function pipe(...fns) {\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce((prev, fn) => fn(prev), input);\n };\n}\n","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nexport class Observable {\n constructor(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n lift(operator) {\n const observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n subscribe(observerOrNext, error, complete) {\n const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(() => {\n const { operator, source } = this;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n this._subscribe(subscriber)\n :\n this._trySubscribe(subscriber));\n });\n return subscriber;\n }\n _trySubscribe(sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n }\n forEach(next, promiseCtor) {\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor((resolve, reject) => {\n const subscriber = new SafeSubscriber({\n next: (value) => {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n this.subscribe(subscriber);\n });\n }\n _subscribe(subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n }\n [Symbol_observable]() {\n return this;\n }\n pipe(...operations) {\n return pipeFromArray(operations)(this);\n }\n toPromise(promiseCtor) {\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor((resolve, reject) => {\n let value;\n this.subscribe((x) => (value = x), (err) => reject(err), () => resolve(value));\n });\n }\n}\nObservable.create = (subscribe) => {\n return new Observable(subscribe);\n};\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n","import { isFunction } from './isFunction';\nexport function hasLift(source) {\n return isFunction(source === null || source === void 0 ? void 0 : source.lift);\n}\nexport function operate(init) {\n return (source) => {\n if (hasLift(source)) {\n return source.lift(function (liftedSource) {\n try {\n return init(liftedSource, this);\n }\n catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n","import { Subscriber } from '../Subscriber';\nexport function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\nexport class OperatorSubscriber extends Subscriber {\n constructor(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {\n super(destination);\n this.onFinalize = onFinalize;\n this.shouldUnsubscribe = shouldUnsubscribe;\n this._next = onNext\n ? function (value) {\n try {\n onNext(value);\n }\n catch (err) {\n destination.error(err);\n }\n }\n : super._next;\n this._error = onError\n ? function (err) {\n try {\n onError(err);\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : super._error;\n this._complete = onComplete\n ? function () {\n try {\n onComplete();\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : super._complete;\n }\n unsubscribe() {\n var _a;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n const { closed } = this;\n super.unsubscribe();\n !closed && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));\n }\n }\n}\n","import { createErrorClass } from './createErrorClass';\nexport const ObjectUnsubscribedError = createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n});\n","import { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nexport class Subject extends Observable {\n constructor() {\n super();\n this.closed = false;\n this.currentObservers = null;\n this.observers = [];\n this.isStopped = false;\n this.hasError = false;\n this.thrownError = null;\n }\n lift(operator) {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n }\n _throwIfClosed() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n }\n next(value) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n if (!this.currentObservers) {\n this.currentObservers = Array.from(this.observers);\n }\n for (const observer of this.currentObservers) {\n observer.next(value);\n }\n }\n });\n }\n error(err) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.hasError = this.isStopped = true;\n this.thrownError = err;\n const { observers } = this;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n }\n complete() {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.isStopped = true;\n const { observers } = this;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n }\n unsubscribe() {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n }\n get observed() {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n }\n _trySubscribe(subscriber) {\n this._throwIfClosed();\n return super._trySubscribe(subscriber);\n }\n _subscribe(subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n }\n _innerSubscribe(subscriber) {\n const { hasError, isStopped, observers } = this;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(() => {\n this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n }\n _checkFinalizedStatuses(subscriber) {\n const { hasError, thrownError, isStopped } = this;\n if (hasError) {\n subscriber.error(thrownError);\n }\n else if (isStopped) {\n subscriber.complete();\n }\n }\n asObservable() {\n const observable = new Observable();\n observable.source = this;\n return observable;\n }\n}\nSubject.create = (destination, source) => {\n return new AnonymousSubject(destination, source);\n};\nexport class AnonymousSubject extends Subject {\n constructor(destination, source) {\n super();\n this.destination = destination;\n this.source = source;\n }\n next(value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n }\n error(err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n }\n complete() {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n _subscribe(subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n }\n}\n","import { Subject } from './Subject';\nexport class BehaviorSubject extends Subject {\n constructor(_value) {\n super();\n this._value = _value;\n }\n get value() {\n return this.getValue();\n }\n _subscribe(subscriber) {\n const subscription = super._subscribe(subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n }\n getValue() {\n const { hasError, thrownError, _value } = this;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n }\n next(value) {\n super.next((this._value = value));\n }\n}\n","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function map(project, thisArg) {\n return operate((source, subscriber) => {\n let index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, (value) => {\n subscriber.next(project.call(thisArg, value, index++));\n }));\n });\n}\n","/**\n * @license Angular v22.2.4\n * (c) 2010-2026 Google LLC. https://angular.dev/\n * License: MIT\n */\n\nimport { getActiveConsumer, setActiveConsumer as setActiveConsumer$1, createSignal, SIGNAL, consumerDestroy, BASE_EFFECT_NODE, isInNotificationPhase, runEffect } from './_effect-chunk.mjs';\nimport { isNotFound, getCurrentInjector, setCurrentInjector } from './_not_found-chunk.mjs';\nimport { isNotFound as isNotFound$1 } from '@angular/core/primitives/di';\nimport { setActiveConsumer } from '@angular/core/primitives/signals';\nimport { BehaviorSubject, Observable, Subject, Subscription } from 'rxjs';\n\nclass Version {\n full;\n major;\n minor;\n patch;\n constructor(full) {\n this.full = full;\n const parts = full.split('.');\n this.major = parts[0];\n this.minor = parts[1];\n this.patch = parts.slice(2).join('.');\n }\n}\nconst VERSION = /* @__PURE__ */new Version('22.2.4');\n\nconst DOC_PAGE_BASE_URL = /*#__PURE__*/ (() => {\n const full = VERSION.full;\n const isPreRelease = full.includes('-next') || full.includes('-rc') || full === '0.0.0' + '-PLACEHOLDER';\n const prefix = isPreRelease ? 'next' : `v${VERSION.major}`;\n return `https://${prefix}.angular.dev`;\n})();\nconst ERROR_DETAILS_PAGE_BASE_URL = /*#__PURE__*/ (() => {\n return `${DOC_PAGE_BASE_URL}/errors`;\n})();\nconst XSS_SECURITY_URL = 'https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss';\n\nclass RuntimeError extends Error {\n code;\n constructor(code, message) {\n super(formatRuntimeError(code, message));\n this.code = code;\n }\n}\nfunction formatRuntimeErrorCode(code) {\n return `NG0${Math.abs(code)}`;\n}\nfunction formatRuntimeError(code, message) {\n const fullCode = formatRuntimeErrorCode(code);\n let errorMessage = `${fullCode}${message ? ': ' + message : ''}`;\n if (ngDevMode && code < 0) {\n const addPeriodSeparator = !errorMessage.match(/[.,;!?\\n]$/);\n const separator = addPeriodSeparator ? '.' : '';\n errorMessage = `${errorMessage}${separator} Find more at ${ERROR_DETAILS_PAGE_BASE_URL}/${fullCode}`;\n }\n return errorMessage;\n}\n\nfunction getClosureSafeProperty(objWithPropertyToExtract) {\n for (let key in objWithPropertyToExtract) {\n if (objWithPropertyToExtract[key] === getClosureSafeProperty) {\n return key;\n }\n }\n throw Error(typeof ngDevMode !== 'undefined' && ngDevMode ? 'Could not find renamed property on target object.' : '');\n}\nfunction fillProperties(target, source) {\n for (const key in source) {\n if (Object.hasOwn(source, key) && !Object.hasOwn(target, key)) {\n target[key] = source[key];\n }\n }\n}\n\nfunction stringify(token) {\n if (typeof token === 'string') {\n return token;\n }\n if (Array.isArray(token)) {\n return `[${token.map(stringify).join(', ')}]`;\n }\n if (token == null) {\n return '' + token;\n }\n const name = token.overriddenName || token.name;\n if (name) {\n return `${name}`;\n }\n const result = token.toString();\n if (result == null) {\n return '' + result;\n }\n const newLineIndex = result.indexOf('\\n');\n return newLineIndex >= 0 ? result.slice(0, newLineIndex) : result;\n}\nfunction concatStringsWithSpace(before, after) {\n if (!before) return after || '';\n if (!after) return before;\n return `${before} ${after}`;\n}\nfunction truncateMiddle(str, maxLength = 100) {\n if (!str || maxLength < 1 || str.length <= maxLength) return str;\n if (maxLength == 1) return str.substring(0, 1) + '...';\n const halfLimit = Math.round(maxLength / 2);\n return str.substring(0, halfLimit) + '...' + str.substring(str.length - halfLimit);\n}\n\nconst __forward_ref__ = /*#__PURE__*/ getClosureSafeProperty({\n __forward_ref__: getClosureSafeProperty\n});\nfunction forwardRef(forwardRefFn) {\n forwardRefFn.__forward_ref__ = forwardRef;\n if (ngDevMode) {\n forwardRefFn.toString = function () {\n return stringify(this());\n };\n }\n return forwardRefFn;\n}\nfunction resolveForwardRef(type) {\n return isForwardRef(type) ? type() : type;\n}\nfunction isForwardRef(fn) {\n return typeof fn === 'function' && Object.hasOwn(fn, __forward_ref__) && fn.__forward_ref__ === forwardRef;\n}\n\nfunction assertNumber(actual, msg) {\n if (!(typeof actual === 'number')) {\n throwError(msg, typeof actual, 'number', '===');\n }\n}\nfunction assertNumberInRange(actual, minInclusive, maxInclusive) {\n assertNumber(actual, 'Expected a number');\n assertLessThanOrEqual(actual, maxInclusive, 'Expected number to be less than or equal to');\n assertGreaterThanOrEqual(actual, minInclusive, 'Expected number to be greater than or equal to');\n}\nfunction assertString(actual, msg) {\n if (!(typeof actual === 'string')) {\n throwError(msg, actual === null ? 'null' : typeof actual, 'string', '===');\n }\n}\nfunction assertFunction(actual, msg) {\n if (!(typeof actual === 'function')) {\n throwError(msg, actual === null ? 'null' : typeof actual, 'function', '===');\n }\n}\nfunction assertEqual(actual, expected, msg) {\n if (!(actual == expected)) {\n throwError(msg, actual, expected, '==');\n }\n}\nfunction assertNotEqual(actual, expected, msg) {\n if (!(actual != expected)) {\n throwError(msg, actual, expected, '!=');\n }\n}\nfunction assertSame(actual, expected, msg) {\n if (!(actual === expected)) {\n throwError(msg, actual, expected, '===');\n }\n}\nfunction assertNotSame(actual, expected, msg) {\n if (!(actual !== expected)) {\n throwError(msg, actual, expected, '!==');\n }\n}\nfunction assertLessThan(actual, expected, msg) {\n if (!(actual < expected)) {\n throwError(msg, actual, expected, '<');\n }\n}\nfunction assertLessThanOrEqual(actual, expected, msg) {\n if (!(actual <= expected)) {\n throwError(msg, actual, expected, '<=');\n }\n}\nfunction assertGreaterThan(actual, expected, msg) {\n if (!(actual > expected)) {\n throwError(msg, actual, expected, '>');\n }\n}\nfunction assertGreaterThanOrEqual(actual, expected, msg) {\n if (!(actual >= expected)) {\n throwError(msg, actual, expected, '>=');\n }\n}\nfunction assertNotDefined(actual, msg) {\n if (actual != null) {\n throwError(msg, actual, null, '==');\n }\n}\nfunction assertDefined(actual, msg) {\n if (actual == null) {\n throwError(msg, actual, null, '!=');\n }\n}\nfunction throwError(msg, actual, expected, comparison) {\n throw new Error(`ASSERTION ERROR: ${msg}` + (comparison == null ? '' : ` [Expected=> ${expected} ${comparison} ${actual} <=Actual]`));\n}\nfunction assertDomNode(node) {\n if (!(node instanceof Node)) {\n throwError(`The provided value must be an instance of a DOM Node but got ${stringify(node)}`);\n }\n}\nfunction assertElement(node) {\n if (!(node instanceof Element)) {\n throwError(`The provided value must be an element but got ${stringify(node)}`);\n }\n}\nfunction assertIndexInRange(arr, index) {\n assertDefined(arr, 'Array must be defined.');\n const maxLen = arr.length;\n if (index < 0 || index >= maxLen) {\n throwError(`Index expected to be less than ${maxLen} but got ${index}`);\n }\n}\nfunction assertOneOf(value, ...validValues) {\n if (validValues.indexOf(value) !== -1) return true;\n throwError(`Expected value to be one of ${JSON.stringify(validValues)} but was ${JSON.stringify(value)}.`);\n}\nfunction assertNotReactive(fn) {\n if (getActiveConsumer() !== null) {\n throwError(`${fn}() should never be called in a reactive context.`);\n }\n}\n\nfunction ษตษตdefineInjectable(opts) {\n return {\n token: opts.token,\n providedIn: opts.providedIn || null,\n factory: opts.factory,\n value: undefined\n };\n}\nfunction ษตษตdefineInjector(options) {\n return {\n providers: options.providers || [],\n imports: options.imports || []\n };\n}\nfunction getInjectableDef(type) {\n return getOwnDefinition(type, NG_PROV_DEF);\n}\nfunction isInjectable(type) {\n return getInjectableDef(type) !== null;\n}\nfunction getOwnDefinition(type, field) {\n return Object.hasOwn(type, field) && type[field] || null;\n}\nfunction getInheritedInjectableDef(type) {\n const def = type?.[NG_PROV_DEF] ?? null;\n if (def) {\n ngDevMode && console.warn(`DEPRECATED: DI is instantiating a token \"${type.name}\" that inherits its @Injectable decorator but does not provide one itself.\\n` + `This will become an error in a future version of Angular. Please add @Injectable() to the \"${type.name}\" class.`);\n return def;\n } else {\n return null;\n }\n}\nfunction getInjectorDef(type) {\n return type && Object.hasOwn(type, NG_INJ_DEF) ? type[NG_INJ_DEF] : null;\n}\nconst NG_PROV_DEF = /*#__PURE__*/ getClosureSafeProperty({\n ษตprov: getClosureSafeProperty\n});\nconst NG_INJ_DEF = /*#__PURE__*/ getClosureSafeProperty({\n ษตinj: getClosureSafeProperty\n});\n\nclass InjectionToken {\n _desc;\n ngMetadataName = 'InjectionToken';\n ษตprov;\n constructor(_desc, options) {\n this._desc = _desc;\n this.ษตprov = undefined;\n if (typeof options == 'number') {\n (typeof ngDevMode === 'undefined' || ngDevMode) && assertLessThan(options, 0, 'Only negative numbers are supported here');\n this.__NG_ELEMENT_ID__ = options;\n } else if (options !== undefined) {\n this.ษตprov = ษตษตdefineInjectable({\n token: this,\n providedIn: options.providedIn || 'root',\n factory: options.factory\n });\n }\n }\n get multi() {\n return this;\n }\n toString() {\n return `InjectionToken ${this._desc}`;\n }\n}\n\nlet _injectorProfilerContext;\nfunction getInjectorProfilerContext() {\n !ngDevMode && throwError('getInjectorProfilerContext should never be called in production mode');\n return _injectorProfilerContext;\n}\nfunction setInjectorProfilerContext(context) {\n !ngDevMode && throwError('setInjectorProfilerContext should never be called in production mode');\n const previous = _injectorProfilerContext;\n _injectorProfilerContext = context;\n return previous;\n}\nconst injectorProfilerCallbacks = [];\nconst NOOP_PROFILER_REMOVAL = () => {};\nfunction removeProfiler(profiler) {\n const profilerIdx = injectorProfilerCallbacks.indexOf(profiler);\n if (profilerIdx !== -1) {\n injectorProfilerCallbacks.splice(profilerIdx, 1);\n }\n}\nfunction setInjectorProfiler(injectorProfiler) {\n !ngDevMode && throwError('setInjectorProfiler should never be called in production mode');\n if (injectorProfiler !== null) {\n if (!injectorProfilerCallbacks.includes(injectorProfiler)) {\n injectorProfilerCallbacks.push(injectorProfiler);\n }\n return () => removeProfiler(injectorProfiler);\n } else {\n injectorProfilerCallbacks.length = 0;\n return NOOP_PROFILER_REMOVAL;\n }\n}\nfunction injectorProfiler(event) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n for (let i = 0; i < injectorProfilerCallbacks.length; i++) {\n const injectorProfilerCallback = injectorProfilerCallbacks[i];\n injectorProfilerCallback(event);\n }\n}\nfunction emitProviderConfiguredEvent(eventProvider, isViewProvider = false) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n let token;\n if (typeof eventProvider === 'function') {\n token = eventProvider;\n } else if (eventProvider instanceof InjectionToken) {\n token = eventProvider;\n } else {\n token = resolveForwardRef(eventProvider.provide);\n }\n let provider = eventProvider;\n if (eventProvider instanceof InjectionToken) {\n provider = eventProvider.ษตprov || eventProvider;\n }\n injectorProfiler({\n type: 2,\n context: getInjectorProfilerContext(),\n providerRecord: {\n token,\n provider,\n isViewProvider\n }\n });\n}\nfunction emitInjectorToCreateInstanceEvent(token) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n injectorProfiler({\n type: 5,\n context: getInjectorProfilerContext(),\n token: token\n });\n}\nfunction emitInstanceCreatedByInjectorEvent(instance) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n injectorProfiler({\n type: 1,\n context: getInjectorProfilerContext(),\n instance: {\n value: instance\n }\n });\n}\nfunction emitInjectEvent(token, value, flags) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n injectorProfiler({\n type: 0,\n context: getInjectorProfilerContext(),\n service: {\n token,\n value,\n flags\n }\n });\n}\nfunction emitEffectCreatedEvent(effect) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n injectorProfiler({\n type: 3,\n context: getInjectorProfilerContext(),\n effect\n });\n}\nfunction emitAfterRenderEffectPhaseCreatedEvent(effectPhase) {\n !ngDevMode && throwError('Injector profiler should never be called in production mode');\n injectorProfiler({\n type: 4,\n context: getInjectorProfilerContext(),\n effectPhase\n });\n}\nfunction runInInjectorProfilerContext(injector, token, callback) {\n !ngDevMode && throwError('runInInjectorProfilerContext should never be called in production mode');\n const prevInjectContext = setInjectorProfilerContext({\n injector,\n token\n });\n try {\n callback();\n } finally {\n setInjectorProfilerContext(prevInjectContext);\n }\n}\n\nfunction isEnvironmentProviders(value) {\n return value && !!value.ษตproviders;\n}\n\nconst NG_COMP_DEF = /*#__PURE__*/ getClosureSafeProperty({\n ษตcmp: getClosureSafeProperty\n});\nconst NG_DIR_DEF = /*#__PURE__*/ getClosureSafeProperty({\n ษตdir: getClosureSafeProperty\n});\nconst NG_PIPE_DEF = /*#__PURE__*/ getClosureSafeProperty({\n ษตpipe: getClosureSafeProperty\n});\nconst NG_MOD_DEF = /*#__PURE__*/ getClosureSafeProperty({\n ษตmod: getClosureSafeProperty\n});\nconst NG_FACTORY_DEF = /*#__PURE__*/ getClosureSafeProperty({\n ษตfac: getClosureSafeProperty\n});\nconst NG_ELEMENT_ID = /*#__PURE__*/ getClosureSafeProperty({\n __NG_ELEMENT_ID__: getClosureSafeProperty\n});\nconst NG_ENV_ID = /*#__PURE__*/ getClosureSafeProperty({\n __NG_ENV_ID__: getClosureSafeProperty\n});\n\nfunction getNgModuleDef(type) {\n assertTypeDefined(type, '@NgModule');\n return type[NG_MOD_DEF] || null;\n}\nfunction getNgModuleDefOrThrow(type) {\n const ngModuleDef = getNgModuleDef(type);\n if (!ngModuleDef) {\n throw new RuntimeError(915, (typeof ngDevMode === 'undefined' || ngDevMode) && `Type ${stringify(type)} does not have 'ษตmod' property.`);\n }\n return ngModuleDef;\n}\nfunction getComponentDef(type) {\n assertTypeDefined(type, '@Component');\n return type[NG_COMP_DEF] || null;\n}\nfunction getDirectiveDefOrThrow(type) {\n const def = getDirectiveDef(type);\n if (!def) {\n throw new RuntimeError(916, (typeof ngDevMode === 'undefined' || ngDevMode) && `Type ${stringify(type)} does not have 'ษตdir' property.`);\n }\n return def;\n}\nfunction getDirectiveDef(type) {\n assertTypeDefined(type, '@Directive');\n return type[NG_DIR_DEF] || null;\n}\nfunction getPipeDef(type) {\n assertTypeDefined(type, '@Pipe');\n return type[NG_PIPE_DEF] || null;\n}\nfunction assertTypeDefined(type, symbolType) {\n if (type == null) {\n throw new RuntimeError(-919, (typeof ngDevMode === 'undefined' || ngDevMode) && `Cannot read ${symbolType} metadata. This can indicate a runtime ` + `circular dependency in your app that needs to be resolved.`);\n }\n}\nfunction isStandalone(type) {\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef(type);\n return def !== null && def.standalone;\n}\n\nfunction renderStringify(value) {\n if (typeof value === 'string') return value;\n if (value == null) return '';\n return String(value);\n}\nfunction stringifyForError(value) {\n if (typeof value === 'function') return value.name || value.toString();\n if (typeof value === 'object' && value != null && typeof value.type === 'function') {\n return value.type.name || value.type.toString();\n }\n return renderStringify(value);\n}\nfunction debugStringifyTypeForError(type) {\n const componentDef = getComponentDef(type);\n if (componentDef !== null && componentDef.debugInfo) {\n return stringifyTypeFromDebugInfo(componentDef.debugInfo);\n }\n return stringifyForError(type);\n}\nfunction stringifyTypeFromDebugInfo(debugInfo) {\n if (!debugInfo.filePath || !debugInfo.lineNumber) {\n return debugInfo.className;\n } else {\n return `${debugInfo.className} (at ${debugInfo.filePath}:${debugInfo.lineNumber})`;\n }\n}\n\nconst NG_RUNTIME_ERROR_CODE = /*#__PURE__*/ getClosureSafeProperty({\n 'ngErrorCode': getClosureSafeProperty\n});\nconst NG_RUNTIME_ERROR_MESSAGE = /*#__PURE__*/ getClosureSafeProperty({\n 'ngErrorMessage': getClosureSafeProperty\n});\nconst NG_TOKEN_PATH = /*#__PURE__*/ getClosureSafeProperty({\n 'ngTokenPath': getClosureSafeProperty\n});\nfunction cyclicDependencyError(token, path) {\n const message = ngDevMode ? `Circular dependency detected for \\`${token}\\`.` : '';\n return createRuntimeError(message, -200, path);\n}\nfunction cyclicDependencyErrorWithDetails(token, path) {\n return augmentRuntimeError(cyclicDependencyError(token, path), null);\n}\nfunction throwMixedMultiProviderError() {\n throw new Error(`Cannot mix multi providers and regular providers`);\n}\nfunction throwInvalidProviderError(ngModuleType, providers, provider) {\n if (ngModuleType && providers) {\n const providerDetail = providers.map(v => v == provider ? '?' + provider + '?' : '...');\n throw new Error(`Invalid provider for the NgModule '${stringify(ngModuleType)}' - only instances of Provider and Type are allowed, got: [${providerDetail.join(', ')}]`);\n } else if (isEnvironmentProviders(provider)) {\n if (provider.ษตfromNgModule) {\n throw new RuntimeError(-207, `Invalid providers from 'importProvidersFrom' present in a non-environment injector. 'importProvidersFrom' can't be used for component providers.`);\n } else {\n throw new RuntimeError(-207, `Invalid providers present in a non-environment injector. 'EnvironmentProviders' can't be used for component providers.`);\n }\n } else {\n throw new Error('Invalid provider');\n }\n}\nfunction throwProviderNotFoundError(token, injectorName) {\n const errorMessage = ngDevMode && `No provider for ${stringifyForError(token)} found${injectorName ? ` in ${injectorName}` : ''}`;\n throw new RuntimeError(-201, errorMessage);\n}\nfunction prependTokenToDependencyPath(error, token) {\n error[NG_TOKEN_PATH] ??= [];\n const currentPath = error[NG_TOKEN_PATH];\n let pathStr;\n if (typeof token === 'object' && 'multi' in token && token?.multi === true) {\n assertDefined(token.provide, 'Token with multi: true should have a provide property');\n pathStr = stringifyForError(token.provide);\n } else {\n pathStr = stringifyForError(token);\n }\n if (currentPath[0] !== pathStr) {\n error[NG_TOKEN_PATH].unshift(pathStr);\n }\n}\nfunction augmentRuntimeError(error, source) {\n const tokenPath = error[NG_TOKEN_PATH];\n const errorCode = error[NG_RUNTIME_ERROR_CODE];\n const message = error[NG_RUNTIME_ERROR_MESSAGE] || error.message;\n error.message = formatErrorMessage(message, errorCode, tokenPath, source);\n return error;\n}\nfunction createRuntimeError(message, code, path) {\n const error = new RuntimeError(code, message);\n error[NG_RUNTIME_ERROR_CODE] = code;\n error[NG_RUNTIME_ERROR_MESSAGE] = message;\n if (path) {\n error[NG_TOKEN_PATH] = path;\n }\n return error;\n}\nfunction getRuntimeErrorCode(error) {\n return error[NG_RUNTIME_ERROR_CODE];\n}\nfunction formatErrorMessage(text, code, path = [], source = null) {\n let pathDetails = '';\n if (path && path.length > 1) {\n pathDetails = ` Path: ${path.join(' -> ')}.`;\n }\n const sourceDetails = source ? ` Source: ${source}.` : '';\n return formatRuntimeError(code, `${text}${sourceDetails}${pathDetails}`);\n}\n\nlet _injectImplementation;\nfunction getInjectImplementation() {\n return _injectImplementation;\n}\nfunction setInjectImplementation(impl) {\n const previous = _injectImplementation;\n _injectImplementation = impl;\n return previous;\n}\nfunction injectRootLimpMode(token, notFoundValue, flags) {\n const injectableDef = getInjectableDef(token);\n if (injectableDef && injectableDef.providedIn == 'root') {\n return injectableDef.value === undefined ? injectableDef.value = injectableDef.factory() : injectableDef.value;\n }\n if (flags & 8) return null;\n if (notFoundValue !== undefined) return notFoundValue;\n throwProviderNotFoundError(token, typeof ngDevMode !== 'undefined' && ngDevMode ? 'Injector' : '');\n}\nfunction assertInjectImplementationNotEqual(fn) {\n ngDevMode && assertNotEqual(_injectImplementation, fn, 'Calling ษตษตinject would cause infinite recursion');\n}\n\nconst _global = globalThis;\n\nfunction ngDevModeResetPerfCounters() {\n const locationString = typeof location !== 'undefined' ? location.toString() : '';\n const newCounters = {\n hydratedNodes: 0,\n hydratedComponents: 0,\n dehydratedViewsRemoved: 0,\n dehydratedViewsCleanupRuns: 0,\n componentsSkippedHydration: 0,\n deferBlocksWithIncrementalHydration: 0\n };\n const allowNgDevModeTrue = locationString.indexOf('ngDevMode=false') === -1;\n if (!allowNgDevModeTrue) {\n _global['ngDevMode'] = false;\n } else {\n if (typeof _global['ngDevMode'] !== 'object') {\n _global['ngDevMode'] = {};\n }\n Object.assign(_global['ngDevMode'], newCounters);\n }\n return newCounters;\n}\nfunction initNgDevMode() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n if (typeof ngDevMode !== 'object' || Object.keys(ngDevMode).length === 0) {\n ngDevModeResetPerfCounters();\n }\n return typeof ngDevMode !== 'undefined' && !!ngDevMode;\n }\n return false;\n}\n\nconst _THROW_IF_NOT_FOUND = {};\nconst THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;\nconst DI_DECORATOR_FLAG = '__NG_DI_FLAG__';\nclass RetrievingInjector {\n injector;\n constructor(injector) {\n this.injector = injector;\n }\n retrieve(token, options) {\n const flags = convertToBitFlags(options) || 0;\n try {\n return this.injector.get(token, flags & 8 ? null : THROW_IF_NOT_FOUND, flags);\n } catch (e) {\n if (isNotFound(e)) {\n return e;\n }\n throw e;\n }\n }\n}\nfunction injectInjectorOnly(token, flags = 0) {\n const currentInjector = getCurrentInjector();\n if (currentInjector === undefined) {\n throw new RuntimeError(-203, ngDevMode && `The \\`${stringify(token)}\\` token injection failed. \\`inject()\\` function must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with \\`runInInjectionContext\\`.`);\n } else if (currentInjector === null) {\n return injectRootLimpMode(token, undefined, flags);\n } else {\n const options = convertToInjectOptions(flags);\n const value = currentInjector.retrieve(token, options);\n ngDevMode && emitInjectEvent(token, value, flags);\n if (isNotFound(value)) {\n if (options.optional) {\n return null;\n }\n throw value;\n }\n return value;\n }\n}\nfunction ษตษตinject(token, flags = 0) {\n return (getInjectImplementation() || injectInjectorOnly)(resolveForwardRef(token), flags);\n}\nfunction ษตษตinvalidFactoryDep(index) {\n throw new RuntimeError(202, ngDevMode && `This constructor is not compatible with Angular Dependency Injection because its dependency at index ${index} of the parameter list is invalid.\nThis can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.\n\nPlease check that 1) the type for the parameter at index ${index} is correct and 2) the correct Angular decorators are defined for this class and its ancestors.`);\n}\nfunction inject(token, options) {\n return ษตษตinject(token, convertToBitFlags(options));\n}\nfunction convertToBitFlags(flags) {\n if (typeof flags === 'undefined' || typeof flags === 'number') {\n return flags;\n }\n return 0 | (flags.optional && 8) | (flags.host && 1) | (flags.self && 2) | (flags.skipSelf && 4);\n}\nfunction convertToInjectOptions(flags) {\n return {\n optional: !!(flags & 8),\n host: !!(flags & 1),\n self: !!(flags & 2),\n skipSelf: !!(flags & 4)\n };\n}\nfunction injectArgs(types) {\n const args = [];\n for (let i = 0; i < types.length; i++) {\n const arg = resolveForwardRef(types[i]);\n if (Array.isArray(arg)) {\n if (arg.length === 0) {\n throw new RuntimeError(900, ngDevMode && 'Arguments array must have arguments.');\n }\n let type = undefined;\n let flags = 0;\n for (let j = 0; j < arg.length; j++) {\n const meta = arg[j];\n const flag = getInjectFlag(meta);\n if (typeof flag === 'number') {\n if (flag === -1) {\n type = meta.token;\n } else {\n flags |= flag;\n }\n } else {\n type = meta;\n }\n }\n args.push(ษตษตinject(type, flags));\n } else {\n args.push(ษตษตinject(arg));\n }\n }\n return args;\n}\nfunction attachInjectFlag(decorator, flag) {\n decorator[DI_DECORATOR_FLAG] = flag;\n decorator.prototype[DI_DECORATOR_FLAG] = flag;\n return decorator;\n}\nfunction getInjectFlag(token) {\n return token[DI_DECORATOR_FLAG];\n}\n\nfunction getFactoryDef(type, throwNotFound) {\n const hasFactoryDef = Object.hasOwn(type, NG_FACTORY_DEF);\n if (!hasFactoryDef && throwNotFound === true && ngDevMode) {\n throw new Error(`Type ${stringify(type)} does not have 'ษตfac' property.`);\n }\n return hasFactoryDef ? type[NG_FACTORY_DEF] : null;\n}\n\nfunction arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n let valueA = a[i];\n let valueB = b[i];\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n if (valueB !== valueA) {\n return false;\n }\n }\n return true;\n}\nfunction flatten(list) {\n return list.flat(Number.POSITIVE_INFINITY);\n}\nfunction deepForEach(input, fn) {\n input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));\n}\nfunction addToArray(arr, index, value) {\n if (index >= arr.length) {\n arr.push(value);\n } else {\n arr.splice(index, 0, value);\n }\n}\nfunction removeFromArray(arr, index) {\n if (index >= arr.length - 1) {\n return arr.pop();\n } else {\n return arr.splice(index, 1)[0];\n }\n}\nfunction newArray(size, value) {\n const list = [];\n for (let i = 0; i < size; i++) {\n list.push(value);\n }\n return list;\n}\nfunction arraySplice(array, index, count) {\n const length = array.length - count;\n while (index < length) {\n array[index] = array[index + count];\n index++;\n }\n while (count--) {\n array.pop();\n }\n}\nfunction arrayInsert2(array, index, value1, value2) {\n ngDevMode && assertLessThanOrEqual(index, array.length, \"Can't insert past array end.\");\n let end = array.length;\n if (end == index) {\n array.push(value1, value2);\n } else if (end === 1) {\n array.push(value2, array[0]);\n array[0] = value1;\n } else {\n end--;\n array.push(array[end - 1], array[end]);\n while (end > index) {\n const previousEnd = end - 2;\n array[end] = array[previousEnd];\n end--;\n }\n array[index] = value1;\n array[index + 1] = value2;\n }\n}\nfunction keyValueArraySet(keyValueArray, key, value) {\n let index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n keyValueArray[index | 1] = value;\n } else {\n index = ~index;\n arrayInsert2(keyValueArray, index, key, value);\n }\n return index;\n}\nfunction keyValueArrayGet(keyValueArray, key) {\n const index = keyValueArrayIndexOf(keyValueArray, key);\n if (index >= 0) {\n return keyValueArray[index | 1];\n }\n return undefined;\n}\nfunction keyValueArrayIndexOf(keyValueArray, key) {\n return _arrayIndexOfSorted(keyValueArray, key, 1);\n}\nfunction _arrayIndexOfSorted(array, value, shift) {\n ngDevMode && assertEqual(Array.isArray(array), true, 'Expecting an array');\n let start = 0;\n let end = array.length >> shift;\n while (end !== start) {\n const middle = start + (end - start >> 1);\n const current = array[middle << shift];\n if (value === current) {\n return middle << shift;\n } else if (current > value) {\n end = middle;\n } else {\n start = middle + 1;\n }\n }\n return ~(end << shift);\n}\n\nconst EMPTY_OBJ = {};\nconst EMPTY_ARRAY = [];\nif ((typeof ngDevMode === 'undefined' || ngDevMode) && /*#__PURE__*/ initNgDevMode()) {\n /*#__PURE__*/ Object.freeze(EMPTY_OBJ);\n /*#__PURE__*/ Object.freeze(EMPTY_ARRAY);\n}\n\nconst ENVIRONMENT_INITIALIZER = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'ENVIRONMENT_INITIALIZER' : '');\n\nconst INJECTOR$1 = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'INJECTOR' : '', -1);\n\nconst INJECTOR_DEF_TYPES = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'INJECTOR_DEF_TYPES' : '');\n\nclass NullInjector {\n get(token, notFoundValue = THROW_IF_NOT_FOUND) {\n if (notFoundValue === THROW_IF_NOT_FOUND) {\n const message = ngDevMode ? `No provider found for \\`${stringify(token)}\\`.` : '';\n const error = createRuntimeError(message, -201);\n error.name = 'ษตNotFound';\n throw error;\n }\n return notFoundValue;\n }\n}\n\nfunction makeEnvironmentProviders(providers) {\n return {\n ษตproviders: providers\n };\n}\nfunction provideEnvironmentInitializer(initializerFn) {\n return makeEnvironmentProviders([{\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useValue: initializerFn\n }]);\n}\nfunction importProvidersFrom(...sources) {\n return {\n ษตproviders: internalImportProvidersFrom(true, sources),\n ษตfromNgModule: true\n };\n}\nfunction internalImportProvidersFrom(checkForStandaloneCmp, ...sources) {\n const providersOut = [];\n const dedup = new Set();\n let injectorTypesWithProviders;\n const collectProviders = provider => {\n providersOut.push(provider);\n };\n deepForEach(sources, source => {\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && checkForStandaloneCmp) {\n const cmpDef = getComponentDef(source);\n if (cmpDef?.standalone) {\n throw new RuntimeError(800, `Importing providers supports NgModule or ModuleWithProviders but got a standalone component \"${stringifyForError(source)}\"`);\n }\n }\n const internalSource = source;\n if (walkProviderTree(internalSource, collectProviders, [], dedup)) {\n injectorTypesWithProviders ||= [];\n injectorTypesWithProviders.push(internalSource);\n }\n });\n if (injectorTypesWithProviders !== undefined) {\n processInjectorTypesWithProviders(injectorTypesWithProviders, collectProviders);\n }\n return providersOut;\n}\nfunction processInjectorTypesWithProviders(typesWithProviders, visitor) {\n for (let i = 0; i < typesWithProviders.length; i++) {\n const {\n ngModule,\n providers\n } = typesWithProviders[i];\n deepForEachProvider(providers, provider => {\n ngDevMode && validateProvider(provider, providers || EMPTY_ARRAY, ngModule);\n visitor(provider, ngModule);\n });\n }\n}\nfunction walkProviderTree(container, visitor, parents, dedup) {\n container = resolveForwardRef(container);\n if (!container) return false;\n let defType = null;\n let injDef = getInjectorDef(container);\n const cmpDef = !injDef && getComponentDef(container);\n if (!injDef && !cmpDef) {\n const ngModule = container.ngModule;\n injDef = getInjectorDef(ngModule);\n if (injDef) {\n defType = ngModule;\n } else {\n return false;\n }\n } else if (cmpDef && !cmpDef.standalone) {\n return false;\n } else {\n defType = container;\n }\n if (ngDevMode && parents.indexOf(defType) !== -1) {\n const defName = stringify(defType);\n const path = parents.map(stringify).concat(defName);\n throw cyclicDependencyErrorWithDetails(defName, path);\n }\n const isDuplicate = dedup.has(defType);\n if (cmpDef) {\n if (isDuplicate) {\n return false;\n }\n dedup.add(defType);\n if (cmpDef.dependencies) {\n const deps = typeof cmpDef.dependencies === 'function' ? cmpDef.dependencies() : cmpDef.dependencies;\n for (const dep of deps) {\n walkProviderTree(dep, visitor, parents, dedup);\n }\n }\n } else if (injDef) {\n if (injDef.imports != null && !isDuplicate) {\n ngDevMode && parents.push(defType);\n dedup.add(defType);\n let importTypesWithProviders;\n try {\n deepForEach(injDef.imports, imported => {\n if (walkProviderTree(imported, visitor, parents, dedup)) {\n importTypesWithProviders ||= [];\n importTypesWithProviders.push(imported);\n }\n });\n } finally {\n ngDevMode && parents.pop();\n }\n if (importTypesWithProviders !== undefined) {\n processInjectorTypesWithProviders(importTypesWithProviders, visitor);\n }\n }\n if (!isDuplicate) {\n const factory = getFactoryDef(defType) || (() => new defType());\n visitor({\n provide: defType,\n useFactory: factory,\n deps: EMPTY_ARRAY\n }, defType);\n visitor({\n provide: INJECTOR_DEF_TYPES,\n useValue: defType,\n multi: true\n }, defType);\n visitor({\n provide: ENVIRONMENT_INITIALIZER,\n useValue: () => ษตษตinject(defType),\n multi: true\n }, defType);\n }\n const defProviders = injDef.providers;\n if (defProviders != null && !isDuplicate) {\n const injectorType = container;\n deepForEachProvider(defProviders, provider => {\n ngDevMode && validateProvider(provider, defProviders, injectorType);\n visitor(provider, injectorType);\n });\n }\n } else {\n return false;\n }\n return defType !== container && container.providers !== undefined;\n}\nfunction validateProvider(provider, providers, containerType) {\n if (isTypeProvider(provider) || isValueProvider(provider) || isFactoryProvider(provider) || isExistingProvider(provider)) {\n return;\n }\n const classRef = resolveForwardRef(provider && (provider.useClass || provider.provide));\n if (!classRef) {\n throwInvalidProviderError(containerType, providers, provider);\n }\n}\nfunction deepForEachProvider(providers, fn) {\n for (let provider of providers) {\n if (isEnvironmentProviders(provider)) {\n provider = provider.ษตproviders;\n }\n if (Array.isArray(provider)) {\n deepForEachProvider(provider, fn);\n } else {\n fn(provider);\n }\n }\n}\nconst USE_VALUE = /*#__PURE__*/ getClosureSafeProperty({\n provide: String,\n useValue: getClosureSafeProperty\n});\nfunction isValueProvider(value) {\n return value !== null && typeof value == 'object' && USE_VALUE in value;\n}\nfunction isExistingProvider(value) {\n return !!(value && value.useExisting);\n}\nfunction isFactoryProvider(value) {\n return !!(value && value.useFactory);\n}\nfunction isTypeProvider(value) {\n return typeof value === 'function';\n}\nfunction isClassProvider(value) {\n return !!value.useClass;\n}\n\nconst INJECTOR_SCOPE = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'Set Injector scope.' : '');\n\nconst NOT_YET = {};\nconst CIRCULAR = {};\nlet NULL_INJECTOR = undefined;\nfunction getNullInjector() {\n if (NULL_INJECTOR === undefined) {\n NULL_INJECTOR = new NullInjector();\n }\n return NULL_INJECTOR;\n}\nclass EnvironmentInjector {}\nclass R3Injector extends EnvironmentInjector {\n parent;\n source;\n scopes;\n records = new Map();\n _ngOnDestroyHooks = new Set();\n _onDestroyHooks = [];\n get destroyed() {\n return this._destroyed;\n }\n _destroyed = false;\n injectorDefTypes;\n constructor(providers, parent, source, scopes) {\n super();\n this.parent = parent;\n this.source = source;\n this.scopes = scopes;\n forEachSingleProvider(providers, provider => this.processProvider(provider));\n this.records.set(INJECTOR$1, makeRecord(undefined, this));\n if (scopes.has('environment')) {\n this.records.set(EnvironmentInjector, makeRecord(undefined, this));\n }\n const record = this.records.get(INJECTOR_SCOPE);\n if (record != null && typeof record.value === 'string') {\n this.scopes.add(record.value);\n }\n this.injectorDefTypes = new Set(this.get(INJECTOR_DEF_TYPES, EMPTY_ARRAY, {\n self: true\n }));\n }\n retrieve(token, options) {\n const flags = convertToBitFlags(options) || 0;\n try {\n return this.get(token, THROW_IF_NOT_FOUND, flags);\n } catch (e) {\n if (isNotFound$1(e)) {\n return e;\n }\n throw e;\n }\n }\n destroy() {\n assertNotDestroyed(this);\n this._destroyed = true;\n const prevConsumer = setActiveConsumer(null);\n try {\n for (const service of this._ngOnDestroyHooks) {\n service.ngOnDestroy();\n }\n const onDestroyHooks = this._onDestroyHooks;\n this._onDestroyHooks = [];\n for (const hook of onDestroyHooks) {\n hook();\n }\n } finally {\n this.records.clear();\n this._ngOnDestroyHooks.clear();\n this.injectorDefTypes.clear();\n setActiveConsumer(prevConsumer);\n }\n }\n onDestroy(callback) {\n assertNotDestroyed(this);\n this._onDestroyHooks.push(callback);\n return () => this.removeOnDestroy(callback);\n }\n runInContext(fn) {\n assertNotDestroyed(this);\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n let prevInjectContext;\n if (ngDevMode) {\n prevInjectContext = setInjectorProfilerContext({\n injector: this,\n token: null\n });\n }\n try {\n return fn();\n } finally {\n setCurrentInjector(previousInjector);\n setInjectImplementation(previousInjectImplementation);\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n }\n }\n get(token, notFoundValue = THROW_IF_NOT_FOUND, options) {\n assertNotDestroyed(this);\n if (Object.hasOwn(token, NG_ENV_ID)) {\n return token[NG_ENV_ID](this);\n }\n const flags = convertToBitFlags(options);\n let prevInjectContext;\n if (ngDevMode) {\n prevInjectContext = setInjectorProfilerContext({\n injector: this,\n token: token\n });\n }\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n if (!(flags & 4)) {\n let record = this.records.get(token);\n if (record === undefined) {\n const def = couldBeInjectableType(token) && getInjectableDef(token);\n if (def && this.injectableDefInScope(def)) {\n if (ngDevMode) {\n runInInjectorProfilerContext(this, token, () => {\n emitProviderConfiguredEvent(token);\n });\n }\n record = makeRecord(injectableDefOrInjectorDefFactory(token), NOT_YET);\n } else {\n record = null;\n }\n this.records.set(token, record);\n }\n if (record != null) {\n return this.hydrate(token, record, flags);\n }\n }\n const nextInjector = !(flags & 2) ? this.parent : getNullInjector();\n notFoundValue = flags & 8 && notFoundValue === THROW_IF_NOT_FOUND ? null : notFoundValue;\n return nextInjector.get(token, notFoundValue);\n } catch (error) {\n const errorCode = getRuntimeErrorCode(error);\n if (errorCode === -200 || errorCode === -201) {\n if (ngDevMode) {\n prependTokenToDependencyPath(error, token);\n if (previousInjector) {\n throw error;\n } else {\n throw augmentRuntimeError(error, this.source);\n }\n } else {\n throw new RuntimeError(errorCode, null);\n }\n } else {\n throw error;\n }\n } finally {\n setInjectImplementation(previousInjectImplementation);\n setCurrentInjector(previousInjector);\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n }\n }\n resolveInjectorInitializers() {\n const prevConsumer = setActiveConsumer(null);\n const previousInjector = setCurrentInjector(this);\n const previousInjectImplementation = setInjectImplementation(undefined);\n let prevInjectContext;\n if (ngDevMode) {\n prevInjectContext = setInjectorProfilerContext({\n injector: this,\n token: null\n });\n }\n try {\n const initializers = this.get(ENVIRONMENT_INITIALIZER, EMPTY_ARRAY, {\n self: true\n });\n if (ngDevMode && !Array.isArray(initializers)) {\n throw new RuntimeError(-209, 'Unexpected type of the `ENVIRONMENT_INITIALIZER` token value ' + `(expected an array, but got ${typeof initializers}). ` + 'Please check that the `ENVIRONMENT_INITIALIZER` token is configured as a ' + '`multi: true` provider.');\n }\n for (const initializer of initializers) {\n initializer();\n }\n } finally {\n setCurrentInjector(previousInjector);\n setInjectImplementation(previousInjectImplementation);\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n setActiveConsumer(prevConsumer);\n }\n }\n toString() {\n if (ngDevMode) {\n const tokens = [];\n const records = this.records;\n for (const token of records.keys()) {\n tokens.push(stringify(token));\n }\n return `R3Injector[${tokens.join(', ')}]`;\n }\n return 'R3Injector[...]';\n }\n processProvider(provider) {\n provider = resolveForwardRef(provider);\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);\n const record = providerToRecord(provider);\n if (ngDevMode) {\n runInInjectorProfilerContext(this, token, () => {\n if (isValueProvider(provider)) {\n emitInjectorToCreateInstanceEvent(token);\n emitInstanceCreatedByInjectorEvent(provider.useValue);\n }\n emitProviderConfiguredEvent(provider);\n });\n }\n if (!isTypeProvider(provider) && provider.multi === true) {\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n if (ngDevMode && multiRecord.multi === undefined) {\n throwMixedMultiProviderError();\n }\n } else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord.multi);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi.push(provider);\n } else {\n if (ngDevMode) {\n const existing = this.records.get(token);\n if (existing && existing.multi !== undefined) {\n throwMixedMultiProviderError();\n }\n }\n }\n this.records.set(token, record);\n }\n hydrate(token, record, flags) {\n const prevConsumer = setActiveConsumer(null);\n try {\n if (record.value === CIRCULAR) {\n throw cyclicDependencyError(ngDevMode ? stringify(token) : '');\n } else if (record.value === NOT_YET) {\n record.value = CIRCULAR;\n if (ngDevMode) {\n runInInjectorProfilerContext(this, token, () => {\n emitInjectorToCreateInstanceEvent(token);\n record.value = record.factory(undefined, flags);\n emitInstanceCreatedByInjectorEvent(record.value);\n });\n } else {\n record.value = record.factory(undefined, flags);\n }\n }\n if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {\n this._ngOnDestroyHooks.add(record.value);\n }\n return record.value;\n } finally {\n setActiveConsumer(prevConsumer);\n }\n }\n injectableDefInScope(def) {\n if (!def.providedIn) {\n return false;\n }\n const providedIn = resolveForwardRef(def.providedIn);\n if (typeof providedIn === 'string') {\n return providedIn === 'any' || this.scopes.has(providedIn);\n } else {\n return this.injectorDefTypes.has(providedIn);\n }\n }\n removeOnDestroy(callback) {\n const destroyCBIdx = this._onDestroyHooks.indexOf(callback);\n if (destroyCBIdx !== -1) {\n this._onDestroyHooks.splice(destroyCBIdx, 1);\n }\n }\n}\nfunction injectableDefOrInjectorDefFactory(token) {\n const injectableDef = getInjectableDef(token);\n const factory = injectableDef !== null ? injectableDef.factory : getFactoryDef(token);\n if (factory !== null) {\n return factory;\n }\n if (token instanceof InjectionToken) {\n throw new RuntimeError(-204, ngDevMode && `Token ${stringify(token)} is missing a ษตprov definition.`);\n }\n if (token instanceof Function) {\n return getUndecoratedInjectableFactory(token);\n }\n throw new RuntimeError(-204, ngDevMode && 'unreachable');\n}\nfunction getUndecoratedInjectableFactory(token) {\n const paramLength = token.length;\n if (paramLength > 0) {\n throw new RuntimeError(-204, ngDevMode && `Can't resolve all parameters for ${stringify(token)}: (${newArray(paramLength, '?').join(', ')}).`);\n }\n const inheritedInjectableDef = getInheritedInjectableDef(token);\n if (inheritedInjectableDef !== null) {\n return () => inheritedInjectableDef.factory(token);\n } else {\n return () => new token();\n }\n}\nfunction providerToRecord(provider) {\n if (isValueProvider(provider)) {\n return makeRecord(undefined, provider.useValue);\n } else {\n const factory = providerToFactory(provider);\n return makeRecord(factory, NOT_YET);\n }\n}\nfunction providerToFactory(provider, ngModuleType, providers) {\n let factory = undefined;\n if (ngDevMode && isEnvironmentProviders(provider)) {\n throwInvalidProviderError(undefined, providers, provider);\n }\n if (isTypeProvider(provider)) {\n const unwrappedProvider = resolveForwardRef(provider);\n return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);\n } else {\n if (isValueProvider(provider)) {\n factory = () => resolveForwardRef(provider.useValue);\n } else if (isFactoryProvider(provider)) {\n factory = () => provider.useFactory(...injectArgs(provider.deps || []));\n } else if (isExistingProvider(provider)) {\n factory = (_, flags) => ษตษตinject(resolveForwardRef(provider.useExisting), flags !== undefined && flags & 8 ? 8 : undefined);\n } else {\n const classRef = resolveForwardRef(provider && (provider.useClass || provider.provide));\n if (ngDevMode && !classRef) {\n throwInvalidProviderError(ngModuleType, providers, provider);\n }\n if (hasDeps(provider)) {\n factory = () => new classRef(...injectArgs(provider.deps));\n } else {\n return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef);\n }\n }\n }\n return factory;\n}\nfunction assertNotDestroyed(injector) {\n if (injector.destroyed) {\n throw new RuntimeError(-205, ngDevMode && 'Injector has already been destroyed.');\n }\n}\nfunction makeRecord(factory, value, multi = false) {\n return {\n factory: factory,\n value: value,\n multi: multi ? [] : undefined\n };\n}\nfunction hasDeps(value) {\n return !!value.deps;\n}\nfunction hasOnDestroy(value) {\n return value !== null && typeof value === 'object' && typeof value.ngOnDestroy === 'function';\n}\nfunction couldBeInjectableType(value) {\n return typeof value === 'function' || typeof value === 'object' && value.ngMetadataName === 'InjectionToken';\n}\nfunction forEachSingleProvider(providers, fn) {\n for (const provider of providers) {\n if (Array.isArray(provider)) {\n forEachSingleProvider(provider, fn);\n } else if (provider && isEnvironmentProviders(provider)) {\n forEachSingleProvider(provider.ษตproviders, fn);\n } else {\n fn(provider);\n }\n }\n}\n\nfunction runInInjectionContext(injector, fn) {\n let internalInjector;\n if (injector instanceof R3Injector) {\n assertNotDestroyed(injector);\n internalInjector = injector;\n } else {\n internalInjector = new RetrievingInjector(injector);\n }\n let prevInjectorProfilerContext;\n if (ngDevMode) {\n prevInjectorProfilerContext = setInjectorProfilerContext({\n injector,\n token: null\n });\n }\n const prevInjector = setCurrentInjector(internalInjector);\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n return fn();\n } finally {\n setCurrentInjector(prevInjector);\n ngDevMode && setInjectorProfilerContext(prevInjectorProfilerContext);\n setInjectImplementation(previousInjectImplementation);\n }\n}\nfunction isInInjectionContext() {\n return getInjectImplementation() !== undefined || getCurrentInjector() != null;\n}\nfunction assertInInjectionContext(debugFn) {\n if (!isInInjectionContext()) {\n throw new RuntimeError(-203, ngDevMode && debugFn.name + '() can only be used within an injection context such as a constructor, a factory function, a field initializer, or a function used with `runInInjectionContext`');\n }\n}\n\nconst HOST = 0;\nconst TVIEW = 1;\nconst FLAGS = 2;\nconst PARENT = 3;\nconst NEXT = 4;\nconst T_HOST = 5;\nconst HYDRATION = 6;\nconst CLEANUP = 7;\nconst CONTEXT = 8;\nconst INJECTOR = 9;\nconst ENVIRONMENT = 10;\nconst RENDERER = 11;\nconst CHILD_HEAD = 12;\nconst CHILD_TAIL = 13;\nconst DECLARATION_VIEW = 14;\nconst DECLARATION_COMPONENT_VIEW = 15;\nconst DECLARATION_LCONTAINER = 16;\nconst PREORDER_HOOK_FLAGS = 17;\nconst QUERIES = 18;\nconst ID = 19;\nconst EMBEDDED_VIEW_INJECTOR = 20;\nconst ON_DESTROY_HOOKS = 21;\nconst EFFECTS_TO_SCHEDULE = 22;\nconst EFFECTS = 23;\nconst REACTIVE_TEMPLATE_CONSUMER = 24;\nconst AFTER_RENDER_SEQUENCES_TO_ADD = 25;\nconst ANIMATIONS = 26;\nconst ON_ERROR = 27;\nconst HEADER_OFFSET = 28;\n\nconst TYPE = 1;\nconst DEHYDRATED_VIEWS = 6;\nconst NATIVE = 7;\nconst VIEW_REFS = 8;\nconst MOVED_VIEWS = 9;\nconst CONTAINER_HEADER_OFFSET = 10;\n\nfunction isLView(value) {\n return Array.isArray(value) && typeof value[TYPE] === 'object';\n}\nfunction isLContainer(value) {\n return Array.isArray(value) && value[TYPE] === true;\n}\nfunction isContentQueryHost(tNode) {\n return (tNode.flags & 4) !== 0;\n}\nfunction isComponentHost(tNode) {\n return tNode.componentOffset > -1;\n}\nfunction isDirectiveHost(tNode) {\n return (tNode.flags & 1) === 1;\n}\nfunction isComponentDef(def) {\n return !!def.template;\n}\nfunction isRootView(target) {\n return (target[FLAGS] & 512) !== 0;\n}\nfunction isProjectionTNode(tNode) {\n return (tNode.type & 16) === 16;\n}\nfunction hasI18n(lView) {\n return (lView[FLAGS] & 32) === 32;\n}\nfunction isDestroyed(lView) {\n return (lView[FLAGS] & 256) === 256;\n}\n\nfunction assertTNodeForLView(tNode, lView) {\n assertTNodeForTView(tNode, lView[TVIEW]);\n}\nfunction assertTNodeCreationIndex(lView, index) {\n const adjustedIndex = index + HEADER_OFFSET;\n assertIndexInRange(lView, adjustedIndex);\n assertLessThan(adjustedIndex, lView[TVIEW].bindingStartIndex, 'TNodes should be created before any bindings');\n}\nfunction assertTNodeForTView(tNode, tView) {\n assertTNode(tNode);\n const tData = tView.data;\n for (let i = HEADER_OFFSET; i < tData.length; i++) {\n if (tData[i] === tNode) {\n return;\n }\n }\n throwError('This TNode does not belong to this TView.');\n}\nfunction assertTNode(tNode) {\n assertDefined(tNode, 'TNode must be defined');\n if (!(tNode && typeof tNode === 'object' && Object.hasOwn(tNode, 'directiveStylingLast'))) {\n throwError('Not of type TNode, got: ' + tNode);\n }\n}\nfunction assertTIcu(tIcu) {\n assertDefined(tIcu, 'Expected TIcu to be defined');\n if (!(typeof tIcu.currentCaseLViewIndex === 'number')) {\n throwError('Object is not of TIcu type.');\n }\n}\nfunction assertNgModuleType(actual, msg = \"Type passed in is not NgModuleType, it does not have 'ษตmod' property.\") {\n if (!getNgModuleDef(actual)) {\n throwError(msg);\n }\n}\nfunction assertHasParent(tNode) {\n assertDefined(tNode, 'currentTNode should exist!');\n assertDefined(tNode.parent, 'currentTNode should have a parent');\n}\nfunction assertLContainer(value) {\n assertDefined(value, 'LContainer must be defined');\n assertEqual(isLContainer(value), true, 'Expecting LContainer');\n}\nfunction assertLViewOrUndefined(value) {\n value && assertEqual(isLView(value), true, 'Expecting LView or undefined or null');\n}\nfunction assertLView(value) {\n assertDefined(value, 'LView must be defined');\n assertEqual(isLView(value), true, 'Expecting LView');\n}\nfunction assertFirstCreatePass(tView, errMessage) {\n assertEqual(tView.firstCreatePass, true, errMessage || 'Should only be called in first create pass.');\n}\nfunction assertFirstUpdatePass(tView, errMessage) {\n assertEqual(tView.firstUpdatePass, true, 'Should only be called in first update pass.');\n}\nfunction assertDirectiveDef(obj) {\n if (obj.type === undefined || obj.selectors == undefined || obj.inputs === undefined) {\n throwError(`Expected a DirectiveDef/ComponentDef and this object does not seem to have the expected shape.`);\n }\n}\nfunction assertIndexInDeclRange(tView, index) {\n assertBetween(HEADER_OFFSET, tView.bindingStartIndex, index);\n}\nfunction assertIndexInExpandoRange(lView, index) {\n const tView = lView[1];\n assertBetween(tView.expandoStartIndex, lView.length, index);\n}\nfunction assertBetween(lower, upper, index) {\n if (!(lower <= index && index < upper)) {\n throwError(`Index out of range (expecting ${lower} <= ${index} < ${upper})`);\n }\n}\nfunction assertProjectionSlots(lView, errMessage) {\n assertDefined(lView[DECLARATION_COMPONENT_VIEW], 'Component views should exist.');\n assertDefined(lView[DECLARATION_COMPONENT_VIEW][T_HOST].projection, 'Components with projection nodes () must have projection slots defined.');\n}\nfunction assertParentView(lView, errMessage) {\n assertDefined(lView, \"Component views should always have a parent view (component's host view)\");\n}\nfunction assertNodeInjector(lView, injectorIndex) {\n assertIndexInExpandoRange(lView, injectorIndex);\n assertIndexInExpandoRange(lView, injectorIndex + 8);\n assertNumber(lView[injectorIndex + 0], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 1], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 2], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 3], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 4], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 5], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 6], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 7], 'injectorIndex should point to a bloom filter');\n assertNumber(lView[injectorIndex + 8], 'injectorIndex should point to parent injector');\n}\n\nvar SecurityContext = /*#__PURE__*/ (function (SecurityContext) {\n SecurityContext[SecurityContext[\"NONE\"] = 0] = \"NONE\";\n SecurityContext[SecurityContext[\"HTML\"] = 1] = \"HTML\";\n SecurityContext[SecurityContext[\"STYLE\"] = 2] = \"STYLE\";\n SecurityContext[SecurityContext[\"SCRIPT\"] = 3] = \"SCRIPT\";\n SecurityContext[SecurityContext[\"URL\"] = 4] = \"URL\";\n SecurityContext[SecurityContext[\"RESOURCE_URL\"] = 5] = \"RESOURCE_URL\";\n SecurityContext[SecurityContext[\"ATTRIBUTE_NO_BINDING\"] = 6] = \"ATTRIBUTE_NO_BINDING\";\n; return SecurityContext;})(SecurityContext || {});\n\nlet _SECURITY_SCHEMA;\nconst SVG_NAMESPACE = 'svg';\nconst MATH_ML_NAMESPACE = 'math';\nconst NO_NAMESPACE = '';\nconst MATCH_ALL_ELEMENTS = '*';\nconst createNullObj = () => Object.create(null);\nfunction SECURITY_SCHEMA() {\n if (_SECURITY_SCHEMA) {\n return _SECURITY_SCHEMA;\n }\n _SECURITY_SCHEMA = createNullObj();\n registerContext(SecurityContext.HTML, undefined, [['iframe', ['srcdoc']], ['*', ['innerHTML', 'outerHTML']]]);\n registerContext(SecurityContext.STYLE, undefined, [['*', ['style']]]);\n registerContext(SecurityContext.URL, undefined, [['*', ['formAction']], ['area', ['href']], ['a', ['href', 'xlink:href']], ['form', ['action']]]);\n registerContext(SecurityContext.URL, MATH_ML_NAMESPACE, [['*', ['href', 'xlink:href']]]);\n registerContext(SecurityContext.RESOURCE_URL, undefined, [['base', ['href']], ['embed', ['src']], ['frame', ['src']], ['iframe', ['src']], ['link', ['href']], ['object', ['codebase', 'data']]]);\n registerContext(SecurityContext.URL, SVG_NAMESPACE, [['a', ['href', 'xlink:href']]]);\n registerContext(SecurityContext.ATTRIBUTE_NO_BINDING, SVG_NAMESPACE, [['animate', ['attributeName', 'values', 'to', 'from']], ['set', ['to', 'attributeName']], ['animateMotion', ['attributeName']], ['animateTransform', ['attributeName']]]);\n registerContext(SecurityContext.ATTRIBUTE_NO_BINDING, undefined, [['unknown', ['attributeName', 'values', 'to', 'from', 'sandbox', 'allow', 'allowFullscreen', 'referrerPolicy', 'csp', 'fetchPriority', 'credentialless']], ['iframe', ['sandbox', 'allow', 'allowFullscreen', 'referrerPolicy', 'csp', 'fetchPriority', 'credentialless']]]);\n return _SECURITY_SCHEMA;\n}\nfunction registerContext(ctx, namespace, specs) {\n const nsKey = namespace ?? NO_NAMESPACE;\n for (const [element, attributeNames] of specs) {\n const tagName = element.toLowerCase();\n for (const attr of attributeNames) {\n const attrLower = attr.toLowerCase();\n const attrSchema = _SECURITY_SCHEMA[attrLower] ??= createNullObj();\n const nsSchema = attrSchema[nsKey] ??= createNullObj();\n nsSchema[tagName] = ctx;\n }\n }\n}\nfunction checkSecurityContext(tagName, propName, namespace) {\n const securitySchema = SECURITY_SCHEMA();\n const attrSchema = securitySchema[propName.toLowerCase()];\n if (!attrSchema) {\n return SecurityContext.NONE;\n }\n const tagLower = tagName.toLowerCase();\n let context;\n if (namespace) {\n const nsSchema = attrSchema[namespace];\n if (nsSchema) {\n context = nsSchema[tagLower] ?? nsSchema[MATCH_ALL_ELEMENTS];\n }\n }\n if (context === undefined) {\n const defaultSchema = attrSchema[NO_NAMESPACE];\n if (defaultSchema) {\n context = defaultSchema[tagLower] ?? defaultSchema[MATCH_ALL_ELEMENTS];\n }\n }\n if (context === undefined && (!namespace || namespace === NO_NAMESPACE)) {\n const svgSchema = attrSchema[SVG_NAMESPACE];\n if (svgSchema) {\n context = svgSchema[tagLower];\n }\n }\n return context ?? SecurityContext.NONE;\n}\n\nfunction unwrapRNode(value) {\n while (Array.isArray(value)) {\n value = value[HOST];\n }\n return value;\n}\nfunction unwrapLView(value) {\n while (Array.isArray(value)) {\n if (typeof value[TYPE] === 'object') return value;\n value = value[HOST];\n }\n return null;\n}\nfunction getNativeByIndex(index, lView) {\n ngDevMode && assertIndexInRange(lView, index);\n ngDevMode && assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Expected to be past HEADER_OFFSET');\n return unwrapRNode(lView[index]);\n}\nfunction getNativeByTNode(tNode, lView) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n ngDevMode && assertIndexInRange(lView, tNode.index);\n const node = unwrapRNode(lView[tNode.index]);\n return node;\n}\nfunction getNativeByTNodeOrNull(tNode, lView) {\n const index = tNode === null ? -1 : tNode.index;\n if (index !== -1) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n const node = unwrapRNode(lView[index]);\n return node;\n }\n return null;\n}\nfunction getTNode(tView, index) {\n ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode');\n ngDevMode && assertLessThan(index, tView.data.length, 'wrong index for TNode');\n const tNode = tView.data[index];\n ngDevMode && tNode !== null && assertTNode(tNode);\n return tNode;\n}\nfunction load(view, index) {\n ngDevMode && assertIndexInRange(view, index);\n return view[index];\n}\nfunction store(tView, lView, index, value) {\n if (index >= tView.data.length) {\n tView.data[index] = null;\n tView.blueprint[index] = null;\n }\n lView[index] = value;\n}\nfunction getComponentLViewByIndex(nodeIndex, hostView) {\n ngDevMode && assertIndexInRange(hostView, nodeIndex);\n const slotValue = hostView[nodeIndex];\n const lView = isLView(slotValue) ? slotValue : slotValue[HOST];\n return lView;\n}\nfunction isCreationMode(view) {\n return (view[FLAGS] & 4) === 4;\n}\nfunction viewAttachedToChangeDetector(view) {\n return (view[FLAGS] & 128) === 128;\n}\nfunction viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}\nfunction getConstant(consts, index) {\n if (index === null || index === undefined) return null;\n ngDevMode && assertIndexInRange(consts, index);\n return consts[index];\n}\nfunction resetPreOrderHookFlags(lView) {\n lView[PREORDER_HOOK_FLAGS] = 0;\n}\nfunction markViewForRefresh(lView) {\n if (lView[FLAGS] & 1024) {\n return;\n }\n lView[FLAGS] |= 1024;\n if (viewAttachedToChangeDetector(lView)) {\n markAncestorsForTraversal(lView);\n }\n}\nfunction walkUpViews(nestingLevel, currentView) {\n while (nestingLevel > 0) {\n ngDevMode && assertDefined(currentView[DECLARATION_VIEW], 'Declaration view should be defined if nesting level is greater than 0.');\n currentView = currentView[DECLARATION_VIEW];\n nestingLevel--;\n }\n return currentView;\n}\nfunction requiresRefreshOrTraversal(lView) {\n return !!(lView[FLAGS] & (1024 | 8192) || lView[REACTIVE_TEMPLATE_CONSUMER]?.dirty);\n}\nfunction updateAncestorTraversalFlagsOnAttach(lView) {\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(8);\n if (lView[FLAGS] & 64) {\n lView[FLAGS] |= 1024;\n }\n if (requiresRefreshOrTraversal(lView)) {\n markAncestorsForTraversal(lView);\n }\n}\nfunction markAncestorsForTraversal(lView) {\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(0);\n let parent = getLViewParent(lView);\n while (parent !== null) {\n if (parent[FLAGS] & 8192) {\n break;\n }\n parent[FLAGS] |= 8192;\n if (!viewAttachedToChangeDetector(parent)) {\n break;\n }\n parent = getLViewParent(parent);\n }\n}\nfunction storeLViewOnDestroy(lView, onDestroyCallback) {\n if (isDestroyed(lView)) {\n throw new RuntimeError(911, ngDevMode && 'View has already been destroyed.');\n }\n if (lView[ON_DESTROY_HOOKS] === null) {\n lView[ON_DESTROY_HOOKS] = [];\n }\n lView[ON_DESTROY_HOOKS].push(onDestroyCallback);\n}\nfunction removeLViewOnDestroy(lView, onDestroyCallback) {\n if (lView[ON_DESTROY_HOOKS] === null) return;\n const destroyCBIdx = lView[ON_DESTROY_HOOKS].indexOf(onDestroyCallback);\n if (destroyCBIdx !== -1) {\n lView[ON_DESTROY_HOOKS].splice(destroyCBIdx, 1);\n }\n}\nfunction getLViewParent(lView) {\n ngDevMode && assertLView(lView);\n const parent = lView[PARENT];\n return isLContainer(parent) ? parent[PARENT] : parent;\n}\nfunction getOrCreateLViewCleanup(view) {\n return view[CLEANUP] ??= [];\n}\nfunction getOrCreateTViewCleanup(tView) {\n return tView.cleanup ??= [];\n}\nfunction storeCleanupWithContext(tView, lView, context, cleanupFn) {\n const lCleanup = getOrCreateLViewCleanup(lView);\n ngDevMode && assertDefined(context, 'Cleanup context is mandatory when registering framework-level destroy hooks');\n lCleanup.push(context);\n if (tView.firstCreatePass) {\n getOrCreateTViewCleanup(tView).push(cleanupFn, lCleanup.length - 1);\n } else {\n if (ngDevMode) {\n Object.freeze(getOrCreateTViewCleanup(tView));\n }\n }\n}\n\nconst instructionState = {\n lFrame: /*#__PURE__*/ createLFrame(null),\n bindingsEnabled: true,\n skipHydrationRootTNode: null\n};\nvar CheckNoChangesMode = /*#__PURE__*/ (function (CheckNoChangesMode) {\n CheckNoChangesMode[CheckNoChangesMode[\"Off\"] = 0] = \"Off\";\n CheckNoChangesMode[CheckNoChangesMode[\"Exhaustive\"] = 1] = \"Exhaustive\";\n CheckNoChangesMode[CheckNoChangesMode[\"OnlyDirtyViews\"] = 2] = \"OnlyDirtyViews\";\n; return CheckNoChangesMode;})(CheckNoChangesMode || {});\n\nlet _checkNoChangesMode = 0;\nlet _isRefreshingViews = false;\nfunction getElementDepthCount() {\n return instructionState.lFrame.elementDepthCount;\n}\nfunction increaseElementDepthCount() {\n instructionState.lFrame.elementDepthCount++;\n}\nfunction decreaseElementDepthCount() {\n instructionState.lFrame.elementDepthCount--;\n}\nfunction getBindingsEnabled() {\n return instructionState.bindingsEnabled;\n}\nfunction isInSkipHydrationBlock() {\n return instructionState.skipHydrationRootTNode !== null;\n}\nfunction isSkipHydrationRootTNode(tNode) {\n return instructionState.skipHydrationRootTNode === tNode;\n}\nfunction ษตษตenableBindings() {\n instructionState.bindingsEnabled = true;\n}\nfunction enterSkipHydrationBlock(tNode) {\n instructionState.skipHydrationRootTNode = tNode;\n}\nfunction ษตษตdisableBindings() {\n instructionState.bindingsEnabled = false;\n}\nfunction leaveSkipHydrationBlock() {\n instructionState.skipHydrationRootTNode = null;\n}\nfunction getLView() {\n return instructionState.lFrame.lView;\n}\nfunction getTView() {\n return instructionState.lFrame.tView;\n}\nfunction ษตษตrestoreView(viewToRestore) {\n instructionState.lFrame.contextLView = viewToRestore;\n return viewToRestore[CONTEXT];\n}\nfunction ษตษตresetView(value) {\n instructionState.lFrame.contextLView = null;\n return value;\n}\nfunction getCurrentTNode() {\n let currentTNode = getCurrentTNodePlaceholderOk();\n while (currentTNode !== null && currentTNode.type === 64) {\n currentTNode = currentTNode.parent;\n }\n return currentTNode;\n}\nfunction getCurrentTNodePlaceholderOk() {\n return instructionState.lFrame.currentTNode;\n}\nfunction getCurrentParentTNode() {\n const lFrame = instructionState.lFrame;\n const currentTNode = lFrame.currentTNode;\n return lFrame.isParent ? currentTNode : currentTNode.parent;\n}\nfunction setCurrentTNode(tNode, isParent) {\n ngDevMode && tNode && assertTNodeForTView(tNode, instructionState.lFrame.tView);\n const lFrame = instructionState.lFrame;\n lFrame.currentTNode = tNode;\n lFrame.isParent = isParent;\n}\nfunction isCurrentTNodeParent() {\n return instructionState.lFrame.isParent;\n}\nfunction setCurrentTNodeAsNotParent() {\n instructionState.lFrame.isParent = false;\n}\nfunction getContextLView() {\n const contextLView = instructionState.lFrame.contextLView;\n ngDevMode && assertDefined(contextLView, 'contextLView must be defined.');\n return contextLView;\n}\nfunction isInCheckNoChangesMode() {\n !ngDevMode && throwError('Must never be called in production mode');\n return _checkNoChangesMode !== CheckNoChangesMode.Off;\n}\nfunction isExhaustiveCheckNoChanges() {\n !ngDevMode && throwError('Must never be called in production mode');\n return _checkNoChangesMode === CheckNoChangesMode.Exhaustive;\n}\nfunction setIsInCheckNoChangesMode(mode) {\n !ngDevMode && throwError('Must never be called in production mode');\n _checkNoChangesMode = mode;\n}\nfunction isRefreshingViews() {\n return _isRefreshingViews;\n}\nfunction setIsRefreshingViews(mode) {\n const prev = _isRefreshingViews;\n _isRefreshingViews = mode;\n return prev;\n}\nfunction getBindingRoot() {\n const lFrame = instructionState.lFrame;\n let index = lFrame.bindingRootIndex;\n if (index === -1) {\n index = lFrame.bindingRootIndex = lFrame.tView.bindingStartIndex;\n }\n return index;\n}\nfunction getBindingIndex() {\n return instructionState.lFrame.bindingIndex;\n}\nfunction setBindingIndex(value) {\n return instructionState.lFrame.bindingIndex = value;\n}\nfunction nextBindingIndex() {\n return instructionState.lFrame.bindingIndex++;\n}\nfunction incrementBindingIndex(count) {\n const lFrame = instructionState.lFrame;\n const index = lFrame.bindingIndex;\n lFrame.bindingIndex = lFrame.bindingIndex + count;\n return index;\n}\nfunction isInI18nBlock() {\n return instructionState.lFrame.inI18n;\n}\nfunction setInI18nBlock(isInI18nBlock) {\n instructionState.lFrame.inI18n = isInI18nBlock;\n}\nfunction setBindingRootForHostBindings(bindingRootIndex, currentDirectiveIndex) {\n const lFrame = instructionState.lFrame;\n lFrame.bindingIndex = lFrame.bindingRootIndex = bindingRootIndex;\n setCurrentDirectiveIndex(currentDirectiveIndex);\n}\nfunction getCurrentDirectiveIndex() {\n return instructionState.lFrame.currentDirectiveIndex;\n}\nfunction setCurrentDirectiveIndex(currentDirectiveIndex) {\n instructionState.lFrame.currentDirectiveIndex = currentDirectiveIndex;\n}\nfunction getCurrentDirectiveDef(tData) {\n const currentDirectiveIndex = instructionState.lFrame.currentDirectiveIndex;\n return currentDirectiveIndex === -1 ? null : tData[currentDirectiveIndex];\n}\nfunction getCurrentQueryIndex() {\n return instructionState.lFrame.currentQueryIndex;\n}\nfunction setCurrentQueryIndex(value) {\n instructionState.lFrame.currentQueryIndex = value;\n}\nfunction getDeclarationTNode(lView) {\n const tView = lView[TVIEW];\n if (tView.type === 2) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode;\n }\n if (tView.type === 1) {\n return lView[T_HOST];\n }\n return null;\n}\nfunction enterDI(lView, tNode, flags) {\n ngDevMode && assertLViewOrUndefined(lView);\n if (flags & 4) {\n ngDevMode && assertTNodeForTView(tNode, lView[TVIEW]);\n let parentTNode = tNode;\n let parentLView = lView;\n while (true) {\n ngDevMode && assertDefined(parentTNode, 'Parent TNode should be defined');\n parentTNode = parentTNode.parent;\n if (parentTNode === null && !(flags & 1)) {\n parentTNode = getDeclarationTNode(parentLView);\n if (parentTNode === null) break;\n ngDevMode && assertDefined(parentLView, 'Parent LView should be defined');\n parentLView = parentLView[DECLARATION_VIEW];\n if (parentTNode.type & (2 | 8)) {\n break;\n }\n } else {\n break;\n }\n }\n if (parentTNode === null) {\n return false;\n } else {\n tNode = parentTNode;\n lView = parentLView;\n }\n }\n ngDevMode && assertTNodeForLView(tNode, lView);\n const lFrame = instructionState.lFrame = allocLFrame();\n lFrame.currentTNode = tNode;\n lFrame.lView = lView;\n return true;\n}\nfunction enterView(newView) {\n ngDevMode && assertNotEqual(newView[0], newView[1], '????');\n ngDevMode && assertLViewOrUndefined(newView);\n const newLFrame = allocLFrame();\n if (ngDevMode) {\n assertEqual(newLFrame.isParent, true, 'Expected clean LFrame');\n assertEqual(newLFrame.lView, null, 'Expected clean LFrame');\n assertEqual(newLFrame.tView, null, 'Expected clean LFrame');\n assertEqual(newLFrame.selectedIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.elementDepthCount, 0, 'Expected clean LFrame');\n assertEqual(newLFrame.currentDirectiveIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.currentNamespace, null, 'Expected clean LFrame');\n assertEqual(newLFrame.bindingRootIndex, -1, 'Expected clean LFrame');\n assertEqual(newLFrame.currentQueryIndex, 0, 'Expected clean LFrame');\n }\n const tView = newView[TVIEW];\n instructionState.lFrame = newLFrame;\n ngDevMode && tView.firstChild && assertTNodeForTView(tView.firstChild, tView);\n newLFrame.currentTNode = tView.firstChild;\n newLFrame.lView = newView;\n newLFrame.tView = tView;\n newLFrame.contextLView = newView;\n newLFrame.bindingIndex = tView.bindingStartIndex;\n newLFrame.inI18n = false;\n}\nfunction allocLFrame() {\n const currentLFrame = instructionState.lFrame;\n const childLFrame = currentLFrame === null ? null : currentLFrame.child;\n const newLFrame = childLFrame === null ? createLFrame(currentLFrame) : childLFrame;\n return newLFrame;\n}\nfunction createLFrame(parent) {\n const lFrame = {\n currentTNode: null,\n isParent: true,\n lView: null,\n tView: null,\n selectedIndex: -1,\n contextLView: null,\n elementDepthCount: 0,\n currentNamespace: null,\n currentDirectiveIndex: -1,\n bindingRootIndex: -1,\n bindingIndex: -1,\n currentQueryIndex: 0,\n parent: parent,\n child: null,\n inI18n: false\n };\n parent !== null && (parent.child = lFrame);\n return lFrame;\n}\nfunction leaveViewLight() {\n const oldLFrame = instructionState.lFrame;\n instructionState.lFrame = oldLFrame.parent;\n oldLFrame.currentTNode = null;\n oldLFrame.lView = null;\n return oldLFrame;\n}\nconst leaveDI = leaveViewLight;\nfunction leaveView() {\n const oldLFrame = leaveViewLight();\n oldLFrame.isParent = true;\n oldLFrame.tView = null;\n oldLFrame.selectedIndex = -1;\n oldLFrame.contextLView = null;\n oldLFrame.elementDepthCount = 0;\n oldLFrame.currentDirectiveIndex = -1;\n oldLFrame.currentNamespace = null;\n oldLFrame.bindingRootIndex = -1;\n oldLFrame.bindingIndex = -1;\n oldLFrame.currentQueryIndex = 0;\n}\nfunction nextContextImpl(level) {\n const contextLView = instructionState.lFrame.contextLView = walkUpViews(level, instructionState.lFrame.contextLView);\n return contextLView[CONTEXT];\n}\nfunction getSelectedIndex() {\n return instructionState.lFrame.selectedIndex;\n}\nfunction setSelectedIndex(index) {\n ngDevMode && index !== -1 && assertGreaterThanOrEqual(index, HEADER_OFFSET, 'Index must be past HEADER_OFFSET (or -1).');\n ngDevMode && assertLessThan(index, instructionState.lFrame.lView.length, \"Can't set index passed end of LView\");\n instructionState.lFrame.selectedIndex = index;\n}\nfunction getSelectedTNode() {\n const lFrame = instructionState.lFrame;\n return getTNode(lFrame.tView, lFrame.selectedIndex);\n}\nfunction ษตษตnamespaceSVG() {\n instructionState.lFrame.currentNamespace = SVG_NAMESPACE;\n}\nfunction ษตษตnamespaceMathML() {\n instructionState.lFrame.currentNamespace = MATH_ML_NAMESPACE;\n}\nfunction ษตษตnamespaceHTML() {\n namespaceHTMLInternal();\n}\nfunction namespaceHTMLInternal() {\n instructionState.lFrame.currentNamespace = null;\n}\nfunction getNamespace() {\n return instructionState.lFrame.currentNamespace;\n}\nlet _wasLastNodeCreated = true;\nfunction wasLastNodeCreated() {\n return _wasLastNodeCreated;\n}\nfunction lastNodeWasCreated(flag) {\n _wasLastNodeCreated = flag;\n}\n\nfunction promiseWithResolvers() {\n let resolve;\n let reject;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return {\n promise,\n resolve,\n reject\n };\n}\n\nfunction createInjector(defType, parent = null, additionalProviders = null, name) {\n const injector = createInjectorWithoutInjectorInstances(defType, parent, additionalProviders, name);\n injector.resolveInjectorInitializers();\n return injector;\n}\nfunction createInjectorWithoutInjectorInstances(defType, parent = null, additionalProviders = null, name, scopes = new Set()) {\n const providers = [additionalProviders || EMPTY_ARRAY, importProvidersFrom(defType)];\n let source = undefined;\n if (ngDevMode) {\n source = name || (typeof defType === 'object' ? undefined : stringify(defType));\n }\n return new R3Injector(providers, parent || getNullInjector(), source || null, scopes);\n}\n\nconst specialProviders = /*#__PURE__*/ new Set();\nfunction registerSpecialProvider(clazz) {\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n specialProviders.add(clazz);\n }\n}\nfunction getAllSpecialProviders() {\n return specialProviders;\n}\n\nclass Injector {\n static THROW_IF_NOT_FOUND = THROW_IF_NOT_FOUND;\n static NULL = new NullInjector();\n static create(options, parent) {\n if (Array.isArray(options)) {\n return createInjector({\n name: ''\n }, parent, options, '');\n } else {\n const name = options.name ?? '';\n return createInjector({\n name\n }, options.parent, options.providers, name);\n }\n }\n static ษตprov =\n /* @__PURE__ */\n ษตษตdefineInjectable({\n token: Injector,\n providedIn: 'any',\n factory: () => ษตษตinject(INJECTOR$1)\n });\n static __NG_ELEMENT_ID__ = -1;\n}\nif (typeof ngDevMode === 'undefined' || ngDevMode) {\n /*#__PURE__*/ registerSpecialProvider(Injector);\n}\n\nconst DOCUMENT = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'DocumentToken' : '');\n\nclass DestroyRef {\n static __NG_ELEMENT_ID__ = injectDestroyRef;\n static __NG_ENV_ID__ = injector => injector;\n}\nif (typeof ngDevMode === 'undefined' || ngDevMode) {\n /*#__PURE__*/ registerSpecialProvider(DestroyRef);\n}\nclass NodeInjectorDestroyRef extends DestroyRef {\n _lView;\n constructor(_lView) {\n super();\n this._lView = _lView;\n }\n get destroyed() {\n return isDestroyed(this._lView);\n }\n onDestroy(callback) {\n const lView = this._lView;\n storeLViewOnDestroy(lView, callback);\n return () => removeLViewOnDestroy(lView, callback);\n }\n}\nfunction injectDestroyRef() {\n return new NodeInjectorDestroyRef(getLView());\n}\n\nconst SCHEDULE_IN_ROOT_ZONE_DEFAULT = false;\n\nconst DEBUG_TASK_TRACKER = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'DEBUG_TASK_TRACKER' : '');\n\nlet PendingTasksInternal = /*#__PURE__*/ (() => {\nclass PendingTasksInternal {\n taskId = 0;\n pendingTasks = new Set();\n destroyed = false;\n pendingTask = new BehaviorSubject(false);\n debugTaskTracker = inject(DEBUG_TASK_TRACKER, {\n optional: true\n });\n get hasPendingTasks() {\n return this.destroyed ? false : this.pendingTask.value;\n }\n get hasPendingTasksObservable() {\n if (this.destroyed) {\n return new Observable(subscriber => {\n subscriber.next(false);\n subscriber.complete();\n });\n }\n return this.pendingTask;\n }\n add() {\n if (!this.hasPendingTasks && !this.destroyed) {\n this.pendingTask.next(true);\n }\n const taskId = this.taskId++;\n this.pendingTasks.add(taskId);\n this.debugTaskTracker?.add(taskId);\n return taskId;\n }\n has(taskId) {\n return this.pendingTasks.has(taskId);\n }\n remove(taskId) {\n this.pendingTasks.delete(taskId);\n this.debugTaskTracker?.remove(taskId);\n if (this.pendingTasks.size === 0 && this.hasPendingTasks) {\n this.pendingTask.next(false);\n }\n }\n ngOnDestroy() {\n this.pendingTasks.clear();\n if (this.hasPendingTasks) {\n this.pendingTask.next(false);\n }\n this.destroyed = true;\n this.pendingTask.unsubscribe();\n }\n static ษตprov =\n /* @__PURE__ */\n ษตษตdefineInjectable({\n token: PendingTasksInternal,\n providedIn: 'root',\n factory: () => new PendingTasksInternal()\n });\n}\nreturn PendingTasksInternal;\n})();\n\nclass EventEmitter_ extends Subject {\n __isAsync;\n destroyRef = undefined;\n pendingTasks = undefined;\n constructor(isAsync = false) {\n super();\n this.__isAsync = isAsync;\n if (isInInjectionContext()) {\n this.destroyRef = inject(DestroyRef, {\n optional: true\n }) ?? undefined;\n this.pendingTasks = inject(PendingTasksInternal, {\n optional: true\n }) ?? undefined;\n }\n }\n emit(value) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n super.next(value);\n } finally {\n setActiveConsumer$1(prevConsumer);\n }\n }\n subscribe(observerOrNext, error, complete) {\n let nextFn = observerOrNext;\n let errorFn = error || (() => null);\n let completeFn = complete;\n if (observerOrNext && typeof observerOrNext === 'object') {\n const observer = observerOrNext;\n nextFn = observer.next?.bind(observer);\n errorFn = observer.error?.bind(observer);\n completeFn = observer.complete?.bind(observer);\n }\n if (this.__isAsync) {\n errorFn = this.wrapInTimeout(errorFn);\n if (nextFn) {\n nextFn = this.wrapInTimeout(nextFn);\n }\n if (completeFn) {\n completeFn = this.wrapInTimeout(completeFn);\n }\n }\n const sink = super.subscribe({\n next: nextFn,\n error: errorFn,\n complete: completeFn\n });\n if (observerOrNext instanceof Subscription) {\n observerOrNext.add(sink);\n }\n return sink;\n }\n wrapInTimeout(fn) {\n return value => {\n const taskId = this.pendingTasks?.add();\n setTimeout(() => {\n try {\n fn(value);\n } finally {\n if (taskId !== undefined) {\n this.pendingTasks?.remove(taskId);\n }\n }\n });\n };\n }\n}\nconst EventEmitter = EventEmitter_;\n\nfunction noop(...args) {}\n\nfunction scheduleCallbackWithRafRace(callback) {\n let timeoutId;\n let animationFrameId;\n function cleanup() {\n callback = noop;\n try {\n if (animationFrameId !== undefined && typeof cancelAnimationFrame === 'function') {\n cancelAnimationFrame(animationFrameId);\n }\n if (timeoutId !== undefined) {\n clearTimeout(timeoutId);\n }\n } catch {}\n }\n timeoutId = setTimeout(() => {\n callback();\n cleanup();\n });\n if (typeof requestAnimationFrame === 'function') {\n animationFrameId = requestAnimationFrame(() => {\n callback();\n cleanup();\n });\n }\n return () => cleanup();\n}\nfunction scheduleCallbackWithMicrotask(callback) {\n queueMicrotask(() => callback());\n return () => {\n callback = noop;\n };\n}\n\nclass AsyncStackTaggingZoneSpec {\n createTask;\n constructor(namePrefix, consoleAsyncStackTaggingImpl = console) {\n this.name = 'asyncStackTagging for ' + namePrefix;\n this.createTask = consoleAsyncStackTaggingImpl?.createTask ?? (() => null);\n }\n name;\n onScheduleTask(delegate, _current, target, task) {\n task.consoleTask = this.createTask(`Zone - ${task.source || task.type}`);\n return delegate.scheduleTask(target, task);\n }\n onInvokeTask(delegate, _currentZone, targetZone, task, applyThis, applyArgs) {\n let ret;\n if (task.consoleTask) {\n ret = task.consoleTask.run(() => delegate.invokeTask(targetZone, task, applyThis, applyArgs));\n } else {\n ret = delegate.invokeTask(targetZone, task, applyThis, applyArgs);\n }\n return ret;\n }\n}\n\nconst isAngularZoneProperty = 'isAngularZone';\nconst angularZoneInstanceIdProperty = isAngularZoneProperty + '_ID';\nlet ngZoneInstanceId = 0;\nclass NgZone {\n hasPendingMacrotasks = false;\n hasPendingMicrotasks = false;\n isStable = true;\n onUnstable = new EventEmitter(false);\n onMicrotaskEmpty = new EventEmitter(false);\n onStable = new EventEmitter(false);\n onError = new EventEmitter(false);\n constructor(options) {\n const {\n enableLongStackTrace = false,\n shouldCoalesceEventChangeDetection = false,\n shouldCoalesceRunChangeDetection = false,\n scheduleInRootZone = SCHEDULE_IN_ROOT_ZONE_DEFAULT\n } = options;\n if (typeof Zone == 'undefined') {\n throw new RuntimeError(908, ngDevMode && `In this configuration Angular requires Zone.js`);\n }\n Zone.assertZonePatched();\n const self = this;\n self._nesting = 0;\n self._outer = self._inner = Zone.current;\n if (ngDevMode) {\n self._inner = self._inner.fork(new AsyncStackTaggingZoneSpec('Angular'));\n }\n if (Zone['TaskTrackingZoneSpec']) {\n self._inner = self._inner.fork(new Zone['TaskTrackingZoneSpec']());\n }\n if (enableLongStackTrace && Zone['longStackTraceZoneSpec']) {\n self._inner = self._inner.fork(Zone['longStackTraceZoneSpec']);\n }\n self.shouldCoalesceEventChangeDetection = !shouldCoalesceRunChangeDetection && shouldCoalesceEventChangeDetection;\n self.shouldCoalesceRunChangeDetection = shouldCoalesceRunChangeDetection;\n self.callbackScheduled = false;\n self.scheduleInRootZone = scheduleInRootZone;\n forkInnerZoneWithAngularBehavior(self);\n }\n static isInAngularZone() {\n return typeof Zone !== 'undefined' && Zone.current.get(isAngularZoneProperty) === true;\n }\n static assertInAngularZone() {\n if (!NgZone.isInAngularZone()) {\n throw new RuntimeError(909, ngDevMode && 'Expected to be in Angular Zone, but it is not!');\n }\n }\n static assertNotInAngularZone() {\n if (NgZone.isInAngularZone()) {\n throw new RuntimeError(909, ngDevMode && 'Expected to not be in Angular Zone, but it is!');\n }\n }\n run(fn, applyThis, applyArgs) {\n return this._inner.run(fn, applyThis, applyArgs);\n }\n runTask(fn, applyThis, applyArgs, name) {\n const zone = this._inner;\n const task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);\n try {\n return zone.runTask(task, applyThis, applyArgs);\n } finally {\n zone.cancelTask(task);\n }\n }\n runGuarded(fn, applyThis, applyArgs) {\n return this._inner.runGuarded(fn, applyThis, applyArgs);\n }\n runOutsideAngular(fn) {\n return this._outer.run(fn);\n }\n}\nconst EMPTY_PAYLOAD = {};\nfunction checkStable(zone) {\n if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {\n try {\n zone._nesting++;\n zone.onMicrotaskEmpty.emit(null);\n } finally {\n zone._nesting--;\n if (!zone.hasPendingMicrotasks) {\n try {\n zone.runOutsideAngular(() => zone.onStable.emit(null));\n } finally {\n zone.isStable = true;\n }\n }\n }\n }\n}\nfunction delayChangeDetectionForEvents(zone) {\n if (zone.isCheckStableRunning || zone.callbackScheduled) {\n return;\n }\n zone.callbackScheduled = true;\n function scheduleCheckStable() {\n scheduleCallbackWithRafRace(() => {\n zone.callbackScheduled = false;\n updateMicroTaskStatus(zone);\n zone.isCheckStableRunning = true;\n checkStable(zone);\n zone.isCheckStableRunning = false;\n });\n }\n if (zone.scheduleInRootZone) {\n Zone.root.run(() => {\n scheduleCheckStable();\n });\n } else {\n zone._outer.run(() => {\n scheduleCheckStable();\n });\n }\n updateMicroTaskStatus(zone);\n}\nfunction forkInnerZoneWithAngularBehavior(zone) {\n const delayChangeDetectionForEventsDelegate = () => {\n delayChangeDetectionForEvents(zone);\n };\n const instanceId = ngZoneInstanceId++;\n zone._inner = zone._inner.fork({\n name: 'angular',\n properties: {\n [isAngularZoneProperty]: true,\n [angularZoneInstanceIdProperty]: instanceId,\n [angularZoneInstanceIdProperty + instanceId]: true\n },\n onInvokeTask: (delegate, current, target, task, applyThis, applyArgs) => {\n if (shouldBeIgnoredByZone(applyArgs)) {\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n }\n try {\n onEnter(zone);\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n } finally {\n if (zone.shouldCoalesceEventChangeDetection && task.type === 'eventTask' || zone.shouldCoalesceRunChangeDetection) {\n delayChangeDetectionForEventsDelegate();\n }\n onLeave(zone);\n }\n },\n onInvoke: (delegate, current, target, callback, applyThis, applyArgs, source) => {\n try {\n onEnter(zone);\n return delegate.invoke(target, callback, applyThis, applyArgs, source);\n } finally {\n if (zone.shouldCoalesceRunChangeDetection && !zone.callbackScheduled && !isSchedulerTick(applyArgs)) {\n delayChangeDetectionForEventsDelegate();\n }\n onLeave(zone);\n }\n },\n onHasTask: (delegate, current, target, hasTaskState) => {\n delegate.hasTask(target, hasTaskState);\n if (current === target) {\n if (hasTaskState.change == 'microTask') {\n zone._hasPendingMicrotasks = hasTaskState.microTask;\n updateMicroTaskStatus(zone);\n checkStable(zone);\n } else if (hasTaskState.change == 'macroTask') {\n zone.hasPendingMacrotasks = hasTaskState.macroTask;\n }\n }\n },\n onHandleError: (delegate, current, target, error) => {\n delegate.handleError(target, error);\n zone.runOutsideAngular(() => zone.onError.emit(error));\n return false;\n }\n });\n}\nfunction updateMicroTaskStatus(zone) {\n if (zone._hasPendingMicrotasks || (zone.shouldCoalesceEventChangeDetection || zone.shouldCoalesceRunChangeDetection) && zone.callbackScheduled === true) {\n zone.hasPendingMicrotasks = true;\n } else {\n zone.hasPendingMicrotasks = false;\n }\n}\nfunction onEnter(zone) {\n zone._nesting++;\n if (zone.isStable) {\n zone.isStable = false;\n zone.onUnstable.emit(null);\n }\n}\nfunction onLeave(zone) {\n zone._nesting--;\n checkStable(zone);\n}\nclass NoopNgZone {\n hasPendingMicrotasks = false;\n hasPendingMacrotasks = false;\n isStable = true;\n onUnstable = new EventEmitter();\n onMicrotaskEmpty = new EventEmitter();\n onStable = new EventEmitter();\n onError = new EventEmitter();\n run(fn, applyThis, applyArgs) {\n return fn.apply(applyThis, applyArgs);\n }\n runGuarded(fn, applyThis, applyArgs) {\n return fn.apply(applyThis, applyArgs);\n }\n runOutsideAngular(fn) {\n return fn();\n }\n runTask(fn, applyThis, applyArgs, name) {\n return fn.apply(applyThis, applyArgs);\n }\n}\nfunction shouldBeIgnoredByZone(applyArgs) {\n return hasApplyArgsData(applyArgs, '__ignore_ng_zone__');\n}\nfunction isSchedulerTick(applyArgs) {\n return hasApplyArgsData(applyArgs, '__scheduler_tick__');\n}\nfunction hasApplyArgsData(applyArgs, key) {\n if (!Array.isArray(applyArgs)) {\n return false;\n }\n if (applyArgs.length !== 1) {\n return false;\n }\n return applyArgs[0]?.data?.[key] === true;\n}\n\nclass ErrorHandler {\n _console = console;\n handleError(error) {\n this._console.error('ERROR', error);\n }\n}\nfunction encapsulateBoundaryError(error) {\n if (isErrorLike(error)) {\n return error;\n }\n return new ErrorBoundaryWrappedError(error);\n}\nfunction isErrorLike(error) {\n return error instanceof Error || typeof error === 'object' && error !== null && typeof error.name === 'string' && typeof error.message === 'string';\n}\nclass ErrorBoundaryWrappedError extends Error {\n constructor(error) {\n super(typeof ngDevMode !== 'undefined' && ngDevMode ? `Error boundary caught an error that's not an Error instance: ${String(error)}. Check this error's .cause for the actual error.` : String(error), {\n cause: error\n });\n this.name = 'ErrorBoundaryWrappedError';\n }\n}\nconst INTERNAL_APPLICATION_ERROR_HANDLER = /*#__PURE__*/ new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'internal error handler' : '', {\n factory: () => {\n const zone = inject(NgZone);\n const injector = inject(EnvironmentInjector);\n let userErrorHandler;\n return e => {\n zone.runOutsideAngular(() => {\n if (injector.destroyed && !userErrorHandler) {\n setTimeout(() => {\n throw e;\n });\n } else {\n userErrorHandler ??= injector.get(ErrorHandler);\n userErrorHandler.handleError(e);\n }\n });\n };\n }\n});\nconst errorHandlerEnvironmentInitializer = {\n provide: ENVIRONMENT_INITIALIZER,\n useValue: () => {\n const handler = inject(ErrorHandler, {\n optional: true\n });\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && handler === null) {\n throw new RuntimeError(402, `A required Injectable was not found in the dependency injection tree. ` + 'If you are bootstrapping an NgModule, make sure that the `BrowserModule` is imported.');\n }\n },\n multi: true\n};\nconst globalErrorListeners = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'GlobalErrorListeners' : '', {\n factory: () => {\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n return;\n }\n const window = inject(DOCUMENT).defaultView;\n if (!window) {\n return;\n }\n const errorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);\n const rejectionListener = e => {\n errorHandler(e.reason);\n e.preventDefault();\n };\n const errorListener = e => {\n if (e.error) {\n errorHandler(e.error);\n } else {\n errorHandler(new Error(ngDevMode ? `An ErrorEvent with no error occurred. See Error.cause for details: ${e.message}` : e.message, {\n cause: e\n }));\n }\n e.preventDefault();\n };\n const setupEventListeners = () => {\n window.addEventListener('unhandledrejection', rejectionListener);\n window.addEventListener('error', errorListener);\n };\n if (typeof Zone !== 'undefined') {\n Zone.root.run(setupEventListeners);\n } else {\n setupEventListeners();\n }\n inject(DestroyRef).onDestroy(() => {\n window.removeEventListener('error', errorListener);\n window.removeEventListener('unhandledrejection', rejectionListener);\n });\n }\n});\nfunction provideBrowserGlobalErrorListeners() {\n return makeEnvironmentProviders([provideEnvironmentInitializer(() => void inject(globalErrorListeners))]);\n}\n\nfunction ษตunwrapWritableSignal(value) {\n return null;\n}\nfunction signal(initialValue, options) {\n const [get, set, update] = createSignal(initialValue, options?.equal);\n const signalFn = get;\n const node = signalFn[SIGNAL];\n signalFn.set = set;\n signalFn.update = update;\n signalFn.asReadonly = signalAsReadonlyFn.bind(signalFn);\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n const debugName = options?.debugName;\n node.debugName = debugName;\n signalFn.toString = () => `[Signal${debugName ? ' (' + debugName + ')' : ''}: ${signalFn()}]`;\n }\n return signalFn;\n}\nfunction signalAsReadonlyFn() {\n const node = this[SIGNAL];\n if (node.readonlyFn === undefined) {\n const readonlyFn = () => this();\n readonlyFn[SIGNAL] = node;\n node.readonlyFn = readonlyFn;\n }\n return node.readonlyFn;\n}\n\nconst APP_ID = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AppId' : '', {\n factory: () => DEFAULT_APP_ID\n});\nconst DEFAULT_APP_ID = 'ng';\nconst validAppIdInitializer = {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useValue: () => {\n const appId = inject(APP_ID);\n const isAlphanumeric = /^[a-zA-Z0-9\\-_]+$/.test(appId);\n if (!isAlphanumeric) {\n throw new RuntimeError(211, `APP_ID value \"${appId}\" is not alphanumeric. ` + `The APP_ID must be a string of alphanumeric characters. (a-zA-Z0-9), hyphens (-) and underscores (_) are allowed.`);\n }\n }\n};\nconst PLATFORM_INITIALIZER = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'Platform Initializer' : '');\nconst PLATFORM_ID = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'Platform ID' : '', {\n providedIn: 'platform',\n factory: () => 'unknown'\n});\nconst ANIMATION_MODULE_TYPE = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AnimationModuleType' : '');\nconst CSP_NONCE = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'CSP nonce' : '', {\n factory: () => {\n return inject(DOCUMENT).body?.querySelector('[ngCspNonce]')?.getAttribute('ngCspNonce') || null;\n }\n});\nconst IMAGE_CONFIG_DEFAULTS = {\n breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],\n placeholderResolution: 30,\n disableImageSizeWarning: false,\n disableImageLazyLoadWarning: false\n};\nconst IMAGE_CONFIG = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'ImageConfig' : '', {\n factory: () => IMAGE_CONFIG_DEFAULTS\n});\n\nfunction makeStateKey(key) {\n return key;\n}\nfunction createDictionary() {\n return Object.create(null);\n}\nlet TransferState = /*#__PURE__*/ (() => {\nclass TransferState {\n static ษตprov =\n /* @__PURE__ */\n ษตษตdefineInjectable({\n token: TransferState,\n providedIn: 'root',\n factory: () => {\n const transferState = new TransferState();\n if (typeof ngServerMode === 'undefined' || !ngServerMode) {\n transferState.store = retrieveTransferredState(inject(DOCUMENT), inject(APP_ID));\n }\n return transferState;\n }\n });\n store = createDictionary();\n onSerializeCallbacks = createDictionary();\n get(key, defaultValue) {\n if (!Object.hasOwn(this.store, key)) {\n return defaultValue;\n }\n const value = this.store[key];\n return value !== undefined ? value : defaultValue;\n }\n set(key, value) {\n this.store[key] = value;\n }\n remove(key) {\n delete this.store[key];\n }\n hasKey(key) {\n return Object.hasOwn(this.store, key);\n }\n get isEmpty() {\n return Object.keys(this.store).length === 0;\n }\n onSerialize(key, callback) {\n this.onSerializeCallbacks[key] = callback;\n }\n toJson() {\n for (const key in this.onSerializeCallbacks) {\n if (Object.hasOwn(this.onSerializeCallbacks, key)) {\n try {\n this.store[key] = this.onSerializeCallbacks[key]();\n } catch (e) {\n console.warn('Exception in onSerialize callback: ', e);\n }\n }\n }\n return JSON.stringify(this.store).replace(/ {\nclass ViewContext {\n view;\n node;\n constructor(view, node) {\n this.view = view;\n this.node = node;\n }\n static __NG_ELEMENT_ID__ = injectViewContext;\n}\nreturn ViewContext;\n})();\nfunction injectViewContext() {\n return new ViewContext(getLView(), getCurrentTNode());\n}\n\nclass ChangeDetectionScheduler {}\nconst ZONELESS_ENABLED = /*#__PURE__*/ new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'Zoneless enabled' : '', {\n factory: () => true\n});\nconst PROVIDED_ZONELESS = /*#__PURE__*/ new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'Zoneless provided' : '', {\n factory: () => false\n});\nconst SCHEDULE_IN_ROOT_ZONE = /*#__PURE__*/ new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'run changes outside zone in root' : '');\n\nlet EffectScheduler = /*#__PURE__*/ (() => {\nclass EffectScheduler {\n static ษตprov =\n /* @__PURE__ */\n ษตษตdefineInjectable({\n token: EffectScheduler,\n providedIn: 'root',\n factory: () => new ZoneAwareEffectScheduler()\n });\n}\nreturn EffectScheduler;\n})();\nclass ZoneAwareEffectScheduler {\n dirtyEffectCount = 0;\n queues = new Map();\n add(handle) {\n this.enqueue(handle);\n this.schedule(handle);\n }\n schedule(handle) {\n if (!handle.dirty) {\n return;\n }\n this.dirtyEffectCount++;\n }\n remove(handle) {\n const zone = handle.zone;\n const queue = this.queues.get(zone);\n if (!queue.has(handle)) {\n return;\n }\n queue.delete(handle);\n if (handle.dirty) {\n this.dirtyEffectCount--;\n }\n }\n enqueue(handle) {\n const zone = handle.zone;\n if (!this.queues.has(zone)) {\n this.queues.set(zone, new Set());\n }\n const queue = this.queues.get(zone);\n if (queue.has(handle)) {\n return;\n }\n queue.add(handle);\n }\n flush() {\n while (this.dirtyEffectCount > 0) {\n let ranOneEffect = false;\n for (const [zone, queue] of this.queues) {\n if (zone === null) {\n ranOneEffect ||= this.flushQueue(queue);\n } else {\n ranOneEffect ||= zone.run(() => this.flushQueue(queue));\n }\n }\n if (!ranOneEffect) {\n this.dirtyEffectCount = 0;\n }\n }\n }\n flushQueue(queue) {\n let ranOneEffect = false;\n for (const handle of queue) {\n if (!handle.dirty) {\n continue;\n }\n this.dirtyEffectCount--;\n ranOneEffect = true;\n handle.run();\n }\n return ranOneEffect;\n }\n}\n\nclass EffectRefImpl {\n [SIGNAL];\n constructor(node) {\n this[SIGNAL] = node;\n }\n destroy() {\n this[SIGNAL].destroy();\n }\n}\nfunction effect(effectFn, options) {\n ngDevMode && assertNotInReactiveContext(effect, 'Call `effect` outside of a reactive context. For example, schedule the ' + 'effect inside the component constructor.');\n if (ngDevMode && !options?.injector) {\n assertInInjectionContext(effect);\n }\n if (ngDevMode && options?.allowSignalWrites !== undefined) {\n console.warn(`The 'allowSignalWrites' flag is deprecated and no longer impacts effect() (writes are always allowed)`);\n }\n const injector = options?.injector ?? inject(Injector);\n let destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;\n let node;\n const viewContext = injector.get(ViewContext, null, {\n optional: true\n });\n const notifier = injector.get(ChangeDetectionScheduler);\n if (viewContext !== null) {\n node = createViewEffect(viewContext.view, notifier, effectFn);\n if (destroyRef instanceof NodeInjectorDestroyRef && destroyRef._lView === viewContext.view) {\n destroyRef = null;\n }\n } else {\n node = createRootEffect(effectFn, injector.get(EffectScheduler), notifier);\n }\n node.injector = injector;\n if (destroyRef !== null) {\n node.onDestroyFns = [destroyRef.onDestroy(() => node.destroy())];\n }\n const effectRef = new EffectRefImpl(node);\n if (ngDevMode) {\n node.debugName = options?.debugName ?? '';\n const prevInjectorProfilerContext = setInjectorProfilerContext({\n injector,\n token: null\n });\n try {\n emitEffectCreatedEvent(effectRef);\n } finally {\n setInjectorProfilerContext(prevInjectorProfilerContext);\n }\n }\n return effectRef;\n}\nconst EFFECT_NODE = /* @__PURE__ */(() => ({\n ...BASE_EFFECT_NODE,\n cleanupFns: undefined,\n zone: null,\n onDestroyFns: null,\n run() {\n if (ngDevMode && isInNotificationPhase()) {\n throw new Error(`Schedulers cannot synchronously execute watches while scheduling.`);\n }\n const prevRefreshingViews = setIsRefreshingViews(false);\n try {\n runEffect(this);\n } finally {\n setIsRefreshingViews(prevRefreshingViews);\n }\n },\n cleanup() {\n if (!this.cleanupFns?.length) {\n return;\n }\n const prevConsumer = setActiveConsumer$1(null);\n try {\n while (this.cleanupFns.length) {\n this.cleanupFns.pop()();\n }\n } finally {\n this.cleanupFns = [];\n setActiveConsumer$1(prevConsumer);\n }\n }\n}))();\nconst ROOT_EFFECT_NODE = /* @__PURE__ */(() => ({\n ...EFFECT_NODE,\n consumerMarkedDirty() {\n this.scheduler.schedule(this);\n this.notifier.notify(12);\n },\n destroy() {\n consumerDestroy(this);\n if (this.onDestroyFns !== null) {\n for (const fn of this.onDestroyFns) {\n fn();\n }\n }\n this.cleanup();\n this.scheduler.remove(this);\n }\n}))();\nconst VIEW_EFFECT_NODE = /* @__PURE__ */(() => ({\n ...EFFECT_NODE,\n consumerMarkedDirty() {\n this.view[FLAGS] |= 8192;\n markAncestorsForTraversal(this.view);\n this.notifier.notify(13);\n },\n destroy() {\n consumerDestroy(this);\n if (this.onDestroyFns !== null) {\n for (const fn of this.onDestroyFns) {\n fn();\n }\n }\n this.cleanup();\n this.view[EFFECTS]?.delete(this);\n }\n}))();\nfunction createViewEffect(view, notifier, fn) {\n const node = Object.create(VIEW_EFFECT_NODE);\n node.view = view;\n node.zone = typeof Zone !== 'undefined' ? Zone.current : null;\n node.notifier = notifier;\n node.userFn = fn;\n node.fn = createEffectFn(node, fn);\n view[EFFECTS] ??= new Set();\n view[EFFECTS].add(node);\n node.consumerMarkedDirty(node);\n return node;\n}\nfunction createRootEffect(fn, scheduler, notifier) {\n const node = Object.create(ROOT_EFFECT_NODE);\n node.userFn = fn;\n node.fn = createEffectFn(node, fn);\n node.scheduler = scheduler;\n node.notifier = notifier;\n node.zone = typeof Zone !== 'undefined' ? Zone.current : null;\n node.scheduler.add(node);\n node.notifier.notify(12);\n return node;\n}\nfunction createEffectFn(node, fn) {\n return () => {\n fn(cleanupFn => (node.cleanupFns ??= []).push(cleanupFn));\n };\n}\n\nfunction isSignal(value) {\n return typeof value === 'function' && value[SIGNAL] !== undefined;\n}\nfunction isWritableSignal(value) {\n return isSignal(value) && typeof value.set === 'function';\n}\n\nlet PendingTasks = /*#__PURE__*/ (() => {\nclass PendingTasks {\n internalPendingTasks = inject(PendingTasksInternal);\n scheduler = inject(ChangeDetectionScheduler);\n errorHandler = inject(INTERNAL_APPLICATION_ERROR_HANDLER);\n add() {\n const taskId = this.internalPendingTasks.add();\n return () => {\n if (!this.internalPendingTasks.has(taskId)) {\n return;\n }\n this.scheduler.notify(11);\n this.internalPendingTasks.remove(taskId);\n };\n }\n run(fn) {\n const removeTask = this.add();\n try {\n fn().catch(this.errorHandler).finally(removeTask);\n } catch (err) {\n this.errorHandler(err);\n removeTask();\n }\n }\n static ษตprov =\n /* @__PURE__ */\n ษตษตdefineInjectable({\n token: PendingTasks,\n providedIn: 'root',\n factory: () => new PendingTasks()\n });\n}\nreturn PendingTasks;\n})();\n\nexport { AFTER_RENDER_SEQUENCES_TO_ADD, ANIMATIONS, ANIMATION_MODULE_TYPE, APP_ID, CHILD_HEAD, CHILD_TAIL, CLEANUP, CONTAINER_HEADER_OFFSET, CONTEXT, CSP_NONCE, ChangeDetectionScheduler, CheckNoChangesMode, DEBUG_TASK_TRACKER, DECLARATION_COMPONENT_VIEW, DECLARATION_LCONTAINER, DECLARATION_VIEW, DEHYDRATED_VIEWS, DOCUMENT, DOC_PAGE_BASE_URL, DestroyRef, EFFECTS, EFFECTS_TO_SCHEDULE, EMBEDDED_VIEW_INJECTOR, EMPTY_ARRAY, EMPTY_OBJ, ENVIRONMENT, ENVIRONMENT_INITIALIZER, ERROR_DETAILS_PAGE_BASE_URL, EffectRefImpl, EffectScheduler, EnvironmentInjector, ErrorHandler, EventEmitter, FLAGS, HEADER_OFFSET, HOST, HYDRATION, ID, IMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS, INJECTOR, INJECTOR$1, INJECTOR_DEF_TYPES, INJECTOR_SCOPE, INTERNAL_APPLICATION_ERROR_HANDLER, InjectionToken, Injector, MATH_ML_NAMESPACE, MOVED_VIEWS, NATIVE, NEXT, NG_COMP_DEF, NG_DIR_DEF, NG_ELEMENT_ID, NG_FACTORY_DEF, NG_INJ_DEF, NG_MOD_DEF, NG_PIPE_DEF, NG_PROV_DEF, NgZone, NoopNgZone, NullInjector, ON_DESTROY_HOOKS, ON_ERROR, PARENT, PLATFORM_ID, PLATFORM_INITIALIZER, PREORDER_HOOK_FLAGS, PROVIDED_ZONELESS, PendingTasks, PendingTasksInternal, QUERIES, R3Injector, REACTIVE_TEMPLATE_CONSUMER, RENDERER, RuntimeError, SCHEDULE_IN_ROOT_ZONE, SCHEDULE_IN_ROOT_ZONE_DEFAULT, SVG_NAMESPACE, SecurityContext, TVIEW, T_HOST, TransferState, VERSION, VIEW_REFS, Version, ViewContext, XSS_SECURITY_URL, ZONELESS_ENABLED, _global, addToArray, angularZoneInstanceIdProperty, arrayEquals, arrayInsert2, arraySplice, assertDefined, assertDirectiveDef, assertDomNode, assertElement, assertEqual, assertFirstCreatePass, assertFirstUpdatePass, assertFunction, assertGreaterThan, assertGreaterThanOrEqual, assertHasParent, assertInInjectionContext, assertIndexInDeclRange, assertIndexInExpandoRange, assertIndexInRange, assertInjectImplementationNotEqual, assertLContainer, assertLView, assertLessThan, assertNgModuleType, assertNodeInjector, assertNotDefined, assertNotEqual, assertNotInReactiveContext, assertNotReactive, assertNotSame, assertNumber, assertNumberInRange, assertOneOf, assertParentView, assertProjectionSlots, assertSame, assertString, assertTIcu, assertTNode, assertTNodeCreationIndex, assertTNodeForLView, assertTNodeForTView, attachInjectFlag, checkSecurityContext, concatStringsWithSpace, convertToBitFlags, createDictionary, createInjector, createInjectorWithoutInjectorInstances, createViewEffect, cyclicDependencyError, cyclicDependencyErrorWithDetails, debugStringifyTypeForError, decreaseElementDepthCount, deepForEach, effect, emitAfterRenderEffectPhaseCreatedEvent, emitInjectEvent, emitInjectorToCreateInstanceEvent, emitInstanceCreatedByInjectorEvent, emitProviderConfiguredEvent, encapsulateBoundaryError, enterDI, enterSkipHydrationBlock, enterView, errorHandlerEnvironmentInitializer, fillProperties, flatten, formatRuntimeError, forwardRef, getAllSpecialProviders, getBindingIndex, getBindingRoot, getBindingsEnabled, getClosureSafeProperty, getComponentDef, getComponentLViewByIndex, getConstant, getContextLView, getCurrentDirectiveDef, getCurrentDirectiveIndex, getCurrentParentTNode, getCurrentQueryIndex, getCurrentTNode, getCurrentTNodePlaceholderOk, getDirectiveDef, getDirectiveDefOrThrow, getElementDepthCount, getFactoryDef, getInjectableDef, getInjectorDef, getLView, getLViewParent, getNamespace, getNativeByIndex, getNativeByTNode, getNativeByTNodeOrNull, getNgModuleDef, getNgModuleDefOrThrow, getNullInjector, getOrCreateLViewCleanup, getOrCreateTViewCleanup, getPipeDef, getSelectedIndex, getSelectedTNode, getTNode, getTView, hasI18n, importProvidersFrom, increaseElementDepthCount, incrementBindingIndex, initNgDevMode, inject, injectRootLimpMode, internalImportProvidersFrom, isClassProvider, isComponentDef, isComponentHost, isContentQueryHost, isCreationMode, isCurrentTNodeParent, isDestroyed, isDirectiveHost, isEnvironmentProviders, isErrorLike, isExhaustiveCheckNoChanges, isForwardRef, isInCheckNoChangesMode, isInI18nBlock, isInInjectionContext, isInSkipHydrationBlock, isInjectable, isLContainer, isLView, isProjectionTNode, isRefreshingViews, isRootView, isSignal, isSkipHydrationRootTNode, isStandalone, isTypeProvider, isWritableSignal, keyValueArrayGet, keyValueArrayIndexOf, keyValueArraySet, lastNodeWasCreated, leaveDI, leaveSkipHydrationBlock, leaveView, load, makeEnvironmentProviders, makeStateKey, markAncestorsForTraversal, markViewForRefresh, newArray, nextBindingIndex, nextContextImpl, promiseWithResolvers, provideBrowserGlobalErrorListeners, provideEnvironmentInitializer, providerToFactory, registerSpecialProvider, removeFromArray, removeLViewOnDestroy, renderStringify, requiresRefreshOrTraversal, resetPreOrderHookFlags, resolveForwardRef, retrieveTransferredState, runInInjectionContext, runInInjectorProfilerContext, scheduleCallbackWithMicrotask, scheduleCallbackWithRafRace, setBindingIndex, setBindingRootForHostBindings, setCurrentDirectiveIndex, setCurrentQueryIndex, setCurrentTNode, setCurrentTNodeAsNotParent, setInI18nBlock, setInjectImplementation, setInjectorProfiler, setInjectorProfilerContext, setIsInCheckNoChangesMode, setIsRefreshingViews, setSelectedIndex, signal, signalAsReadonlyFn, store, storeCleanupWithContext, storeLViewOnDestroy, stringify, stringifyForError, throwError, throwProviderNotFoundError, truncateMiddle, unwrapLView, unwrapRNode, updateAncestorTraversalFlagsOnAttach, validAppIdInitializer, viewAttachedToChangeDetector, viewAttachedToContainer, walkProviderTree, walkUpViews, wasLastNodeCreated, ษตunwrapWritableSignal, ษตษตdefineInjectable, ษตษตdefineInjector, ษตษตdisableBindings, ษตษตenableBindings, ษตษตinject, ษตษตinvalidFactoryDep, ษตษตnamespaceHTML, ษตษตnamespaceMathML, ษตษตnamespaceSVG, ษตษตresetView, ษตษตrestoreView };\n","/**\n * @license Angular v22.2.4\n * (c) 2010-2026 Google LLC. https://angular.dev/\n * License: MIT\n */\n\nimport { assertString, EMPTY_OBJ, assertFirstCreatePass, assertDefined, assertNotEqual, FLAGS, assertEqual, isInCheckNoChangesMode, PREORDER_HOOK_FLAGS, throwError, assertNumber, assertGreaterThan, HEADER_OFFSET, DECLARATION_VIEW, NG_FACTORY_DEF, isForwardRef, resolveForwardRef, getFactoryDef, convertToBitFlags, isRootView, assertTNodeForLView, enterDI, runInInjectorProfilerContext, getCurrentTNode, getLView, emitInjectorToCreateInstanceEvent, emitInstanceCreatedByInjectorEvent, throwProviderNotFoundError, leaveDI, assertNodeInjector, setInjectImplementation, injectRootLimpMode, stringifyForError, cyclicDependencyErrorWithDetails, cyclicDependencyError, setInjectorProfilerContext, assertDirectiveDef, EMBEDDED_VIEW_INJECTOR, T_HOST, assertIndexInRange, INJECTOR, TVIEW as TVIEW$1, NG_ELEMENT_ID, isComponentDef, isComponentHost, DECLARATION_COMPONENT_VIEW, makeEnvironmentProviders, InjectionToken, _global, ษตษตinvalidFactoryDep as __invalidFactoryDep, ษตษตinject as __inject, ษตษตdefineInjector as __defineInjector, ษตษตdefineInjectable as __defineInjectable, newArray, attachInjectFlag, RuntimeError, NG_PROV_DEF, getClosureSafeProperty, getNativeByTNode, registerSpecialProvider, flatten, arrayEquals, ID, isLView, assertDomNode, EMPTY_ARRAY, getComponentLViewByIndex, CONTEXT, unwrapRNode, assertLView, HOST, getLViewParent, isLContainer, CONTAINER_HEADER_OFFSET, CHILD_HEAD, NEXT, Injector, CLEANUP, getComponentDef, getDirectiveDef, APP_ID, inject, makeStateKey, formatRuntimeError, TransferState, isInSkipHydrationBlock as isInSkipHydrationBlock$1, HYDRATION, isContentQueryHost, setCurrentQueryIndex, XSS_SECURITY_URL, isDirectiveHost, MATH_ML_NAMESPACE, SVG_NAMESPACE, RENDERER, SecurityContext, renderStringify, getSelectedTNode, checkSecurityContext, getSelectedIndex, ENVIRONMENT, stringify, ANIMATIONS, AFTER_RENDER_SEQUENCES_TO_ADD, markAncestorsForTraversal, NgZone, ChangeDetectionScheduler, ErrorHandler, assertNotInReactiveContext, assertInInjectionContext, DestroyRef, ViewContext, EnvironmentInjector, isDestroyed, assertLContainer, MOVED_VIEWS, assertProjectionSlots, PARENT, NATIVE, REACTIVE_TEMPLATE_CONSUMER, DECLARATION_LCONTAINER, QUERIES, assertParentView, assertNotReactive, ON_DESTROY_HOOKS, assertFunction, EFFECTS, resetPreOrderHookFlags, CHILD_TAIL, assertSame, assertFirstUpdatePass, getTView, assertIndexInDeclRange, setSelectedIndex, INTERNAL_APPLICATION_ERROR_HANDLER, assertNotSame, isCurrentTNodeParent, setCurrentTNodeAsNotParent, assertHasParent, setCurrentTNode, getElementDepthCount, increaseElementDepthCount, wasLastNodeCreated, setCurrentDirectiveIndex, getCurrentDirectiveIndex, unwrapLView, enterView, leaveView, isCreationMode, markViewForRefresh, setIsInCheckNoChangesMode, setIsRefreshingViews, isExhaustiveCheckNoChanges, requiresRefreshOrTraversal, setBindingIndex, EFFECTS_TO_SCHEDULE, ON_ERROR, encapsulateBoundaryError, setBindingRootForHostBindings, viewAttachedToChangeDetector, CheckNoChangesMode, isRefreshingViews, removeFromArray, addToArray, updateAncestorTraversalFlagsOnAttach, storeLViewOnDestroy, VIEW_REFS, DOC_PAGE_BASE_URL, assertGreaterThanOrEqual, isInI18nBlock, assertTNodeForTView, getCurrentParentTNode, getNamespace, getCurrentTNodePlaceholderOk, assertTIcu, assertTNode, assertNumberInRange, DEHYDRATED_VIEWS, getNgModuleDef, getPipeDef as getPipeDef$1, getNgModuleDefOrThrow, isStandalone, getTNode, assertLessThan, getOrCreateTViewCleanup, getOrCreateLViewCleanup, debugStringifyTypeForError, assertNotDefined, nextBindingIndex, concatStringsWithSpace, assertInjectImplementationNotEqual, emitInjectEvent, getConstant, getDirectiveDefOrThrow, DOCUMENT as DOCUMENT$1, viewAttachedToContainer, storeCleanupWithContext, signal, createInjectorWithoutInjectorInstances, R3Injector, getNullInjector, internalImportProvidersFrom, initNgDevMode, runInInjectionContext, fillProperties, NG_COMP_DEF, NG_DIR_DEF, getBindingsEnabled, lastNodeWasCreated, arrayInsert2, arraySplice, removeLViewOnDestroy, walkUpViews, getNativeByIndex, assertElement, setInjectorProfiler, EffectRefImpl, NullInjector, getAllSpecialProviders, ENVIRONMENT_INITIALIZER, INJECTOR_DEF_TYPES, walkProviderTree, deepForEach, getInjectorDef, isTypeProvider, VERSION, retrieveTransferredState, createDictionary, isSignal, isInInjectionContext, PendingTasksInternal, ZONELESS_ENABLED, EffectScheduler, PendingTasks, promiseWithResolvers, decreaseElementDepthCount, assertTNodeCreationIndex, enterSkipHydrationBlock, isSkipHydrationRootTNode, leaveSkipHydrationBlock, createViewEffect, getCurrentDirectiveDef, getBindingIndex, assertIndexInExpandoRange, assertOneOf, setInI18nBlock, nextContextImpl, getCurrentQueryIndex, getContextLView, load, keyValueArrayIndexOf, incrementBindingIndex, keyValueArrayGet, keyValueArraySet, isWritableSignal, store, getBindingRoot, providerToFactory, emitProviderConfiguredEvent, isClassProvider, forwardRef, ษตษตrestoreView as __restoreView, ษตษตdisableBindings as __disableBindings, ษตษตenableBindings as __enableBindings, ษตษตnamespaceSVG as __namespaceSVG, ษตษตnamespaceMathML as __namespaceMathML, ษตษตnamespaceHTML as __namespaceHTML, ษตษตresetView as __resetView, NG_MOD_DEF, NG_INJ_DEF, NG_PIPE_DEF, PROVIDED_ZONELESS, NoopNgZone, angularZoneInstanceIdProperty, scheduleCallbackWithMicrotask, scheduleCallbackWithRafRace, SCHEDULE_IN_ROOT_ZONE, getNativeByTNodeOrNull } from './_pending_tasks-chunk.mjs';\nimport { setActiveConsumer as setActiveConsumer$1 } from '@angular/core/primitives/signals';\nimport { SIGNAL_NODE, signalSetFn, setActiveConsumer, consumerDestroy, SIGNAL, REACTIVE_NODE, consumerPollProducersForChange, consumerBeforeComputation, getActiveConsumer, consumerAfterComputation, createComputed, producerUpdateValueVersion, producerAccessed, ERRORED, setThrowInvalidWriteToSignalError } from './_effect-chunk.mjs';\nimport { Subject, Subscription } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { Attribute as Attribute$1 } from './_attribute-chunk.mjs';\n\nconst REQUIRED_UNSET_VALUE = /* @__PURE__ */Symbol('InputSignalNode#UNSET');\nconst INPUT_SIGNAL_NODE = /* @__PURE__ */(() => {\n return {\n ...SIGNAL_NODE,\n transformFn: undefined,\n applyValueToInputSignal(node, value) {\n signalSetFn(node, value);\n }\n };\n})();\n\nfunction noSideEffects(fn) {\n return {\n toString: fn\n }.toString();\n}\n\nvar ProfilerEvent = /*#__PURE__*/ (function (ProfilerEvent) {\n ProfilerEvent[ProfilerEvent[\"TemplateCreateStart\"] = 0] = \"TemplateCreateStart\";\n ProfilerEvent[ProfilerEvent[\"TemplateCreateEnd\"] = 1] = \"TemplateCreateEnd\";\n ProfilerEvent[ProfilerEvent[\"TemplateUpdateStart\"] = 2] = \"TemplateUpdateStart\";\n ProfilerEvent[ProfilerEvent[\"TemplateUpdateEnd\"] = 3] = \"TemplateUpdateEnd\";\n ProfilerEvent[ProfilerEvent[\"LifecycleHookStart\"] = 4] = \"LifecycleHookStart\";\n ProfilerEvent[ProfilerEvent[\"LifecycleHookEnd\"] = 5] = \"LifecycleHookEnd\";\n ProfilerEvent[ProfilerEvent[\"OutputStart\"] = 6] = \"OutputStart\";\n ProfilerEvent[ProfilerEvent[\"OutputEnd\"] = 7] = \"OutputEnd\";\n ProfilerEvent[ProfilerEvent[\"BootstrapApplicationStart\"] = 8] = \"BootstrapApplicationStart\";\n ProfilerEvent[ProfilerEvent[\"BootstrapApplicationEnd\"] = 9] = \"BootstrapApplicationEnd\";\n ProfilerEvent[ProfilerEvent[\"BootstrapComponentStart\"] = 10] = \"BootstrapComponentStart\";\n ProfilerEvent[ProfilerEvent[\"BootstrapComponentEnd\"] = 11] = \"BootstrapComponentEnd\";\n ProfilerEvent[ProfilerEvent[\"ChangeDetectionStart\"] = 12] = \"ChangeDetectionStart\";\n ProfilerEvent[ProfilerEvent[\"ChangeDetectionEnd\"] = 13] = \"ChangeDetectionEnd\";\n ProfilerEvent[ProfilerEvent[\"ChangeDetectionSyncStart\"] = 14] = \"ChangeDetectionSyncStart\";\n ProfilerEvent[ProfilerEvent[\"ChangeDetectionSyncEnd\"] = 15] = \"ChangeDetectionSyncEnd\";\n ProfilerEvent[ProfilerEvent[\"AfterRenderHooksStart\"] = 16] = \"AfterRenderHooksStart\";\n ProfilerEvent[ProfilerEvent[\"AfterRenderHooksEnd\"] = 17] = \"AfterRenderHooksEnd\";\n ProfilerEvent[ProfilerEvent[\"ComponentStart\"] = 18] = \"ComponentStart\";\n ProfilerEvent[ProfilerEvent[\"ComponentEnd\"] = 19] = \"ComponentEnd\";\n ProfilerEvent[ProfilerEvent[\"DeferBlockStateStart\"] = 20] = \"DeferBlockStateStart\";\n ProfilerEvent[ProfilerEvent[\"DeferBlockStateEnd\"] = 21] = \"DeferBlockStateEnd\";\n ProfilerEvent[ProfilerEvent[\"DynamicComponentStart\"] = 22] = \"DynamicComponentStart\";\n ProfilerEvent[ProfilerEvent[\"DynamicComponentEnd\"] = 23] = \"DynamicComponentEnd\";\n ProfilerEvent[ProfilerEvent[\"HostBindingsUpdateStart\"] = 24] = \"HostBindingsUpdateStart\";\n ProfilerEvent[ProfilerEvent[\"HostBindingsUpdateEnd\"] = 25] = \"HostBindingsUpdateEnd\";\n; return ProfilerEvent;})(ProfilerEvent || {});\n\n\nclass SimpleChange {\n previousValue;\n currentValue;\n firstChange;\n constructor(previousValue, currentValue, firstChange) {\n this.previousValue = previousValue;\n this.currentValue = currentValue;\n this.firstChange = firstChange;\n }\n isFirstChange() {\n return this.firstChange;\n }\n}\n\nfunction applyValueToInputField(instance, inputSignalNode, privateName, value) {\n if (inputSignalNode !== null) {\n inputSignalNode.applyValueToInputSignal(inputSignalNode, value);\n } else {\n instance[privateName] = value;\n }\n}\n\nlet _ngOnChangesFeatureImpl = null;\nconst ษตษตNgOnChangesFeature = /* @__PURE__ */(() => {\n _ngOnChangesFeatureImpl = NgOnChangesFeatureImpl;\n const ษตษตNgOnChangesFeatureImpl = () => NgOnChangesFeatureImpl;\n ษตษตNgOnChangesFeatureImpl.ngInherit = true;\n return ษตษตNgOnChangesFeatureImpl;\n})();\nfunction getNgOnChangesFeatureImpl() {\n return _ngOnChangesFeatureImpl;\n}\nfunction NgOnChangesFeatureImpl(definition) {\n if (definition.type.prototype.ngOnChanges) {\n definition.setInput = ngOnChangesSetInput;\n }\n return rememberChangeHistoryAndInvokeOnChangesHook;\n}\nfunction rememberChangeHistoryAndInvokeOnChangesHook() {\n const simpleChangesStore = getSimpleChangesStore(this);\n const current = simpleChangesStore?.current;\n if (current) {\n const previous = simpleChangesStore.previous;\n if (previous === EMPTY_OBJ) {\n simpleChangesStore.previous = current;\n } else {\n for (let key in current) {\n previous[key] = current[key];\n }\n }\n simpleChangesStore.current = null;\n this.ngOnChanges(current);\n }\n}\nfunction ngOnChangesSetInput(instance, inputSignalNode, value, publicName, privateName) {\n const declaredName = this.declaredInputs[publicName];\n ngDevMode && assertString(declaredName, 'Name of input in ngOnChanges has to be a string');\n const simpleChangesStore = getSimpleChangesStore(instance) || setSimpleChangesStore(instance, {\n previous: EMPTY_OBJ,\n current: null\n });\n const current = simpleChangesStore.current || (simpleChangesStore.current = {});\n const previous = simpleChangesStore.previous;\n const previousChange = previous[declaredName];\n current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === EMPTY_OBJ);\n applyValueToInputField(instance, inputSignalNode, privateName, value);\n}\nconst SIMPLE_CHANGES_STORE = '__ngSimpleChanges__';\nfunction getSimpleChangesStore(instance) {\n return Object.hasOwn(instance, SIMPLE_CHANGES_STORE) ? instance[SIMPLE_CHANGES_STORE] || null : null;\n}\nfunction setSimpleChangesStore(instance, store) {\n return instance[SIMPLE_CHANGES_STORE] = store;\n}\n\nconst profilerCallbacks = [];\nconst NOOP_PROFILER_REMOVAL = () => {};\nfunction removeProfiler(profiler) {\n const profilerIdx = profilerCallbacks.indexOf(profiler);\n if (profilerIdx !== -1) {\n profilerCallbacks.splice(profilerIdx, 1);\n }\n}\nfunction setProfiler(profiler) {\n if (profiler !== null) {\n if (!profilerCallbacks.includes(profiler)) {\n profilerCallbacks.push(profiler);\n }\n return () => removeProfiler(profiler);\n } else {\n profilerCallbacks.length = 0;\n return NOOP_PROFILER_REMOVAL;\n }\n}\nconst profiler = function (event, instance = null, eventFn) {\n for (let i = 0; i < profilerCallbacks.length; i++) {\n const profilerCallback = profilerCallbacks[i];\n profilerCallback(event, instance, eventFn);\n }\n};\n\nfunction registerPreOrderHooks(directiveIndex, directiveDef, tView) {\n ngDevMode && assertFirstCreatePass(tView);\n const {\n ngOnChanges,\n ngOnInit,\n ngDoCheck\n } = directiveDef.type.prototype;\n if (ngOnChanges) {\n const wrappedOnChanges = getNgOnChangesFeatureImpl()(directiveDef);\n (tView.preOrderHooks ??= []).push(directiveIndex, wrappedOnChanges);\n (tView.preOrderCheckHooks ??= []).push(directiveIndex, wrappedOnChanges);\n }\n if (ngOnInit) {\n (tView.preOrderHooks ??= []).push(0 - directiveIndex, ngOnInit);\n }\n if (ngDoCheck) {\n (tView.preOrderHooks ??= []).push(directiveIndex, ngDoCheck);\n (tView.preOrderCheckHooks ??= []).push(directiveIndex, ngDoCheck);\n }\n}\nfunction registerPostOrderHooks(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) {\n const directiveDef = tView.data[i];\n ngDevMode && assertDefined(directiveDef, 'Expecting DirectiveDef');\n const lifecycleHooks = directiveDef.type.prototype;\n const {\n ngAfterContentInit,\n ngAfterContentChecked,\n ngAfterViewInit,\n ngAfterViewChecked,\n ngOnDestroy\n } = lifecycleHooks;\n if (ngAfterContentInit) {\n (tView.contentHooks ??= []).push(-i, ngAfterContentInit);\n }\n if (ngAfterContentChecked) {\n (tView.contentHooks ??= []).push(i, ngAfterContentChecked);\n (tView.contentCheckHooks ??= []).push(i, ngAfterContentChecked);\n }\n if (ngAfterViewInit) {\n (tView.viewHooks ??= []).push(-i, ngAfterViewInit);\n }\n if (ngAfterViewChecked) {\n (tView.viewHooks ??= []).push(i, ngAfterViewChecked);\n (tView.viewCheckHooks ??= []).push(i, ngAfterViewChecked);\n }\n if (ngOnDestroy != null) {\n (tView.destroyHooks ??= []).push(i, ngOnDestroy);\n }\n }\n}\nfunction executeCheckHooks(lView, hooks, nodeIndex) {\n callHooks(lView, hooks, 3, nodeIndex);\n}\nfunction executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) {\n ngDevMode && assertNotEqual(initPhase, 3, 'Init pre-order hooks should not be called more than once');\n if ((lView[FLAGS] & 3) === initPhase) {\n callHooks(lView, hooks, initPhase, nodeIndex);\n }\n}\nfunction incrementInitPhaseFlags(lView, initPhase) {\n ngDevMode && assertNotEqual(initPhase, 3, 'Init hooks phase should not be incremented after all init hooks have been run.');\n let flags = lView[FLAGS];\n if ((flags & 3) === initPhase) {\n flags &= 16383;\n flags += 1;\n lView[FLAGS] = flags;\n }\n}\nfunction callHooks(currentView, arr, initPhase, currentNodeIndex) {\n ngDevMode && assertEqual(isInCheckNoChangesMode(), false, 'Hooks should never be run when in check no changes mode.');\n const startIndex = currentNodeIndex !== undefined ? currentView[PREORDER_HOOK_FLAGS] & 65535 : 0;\n const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1;\n const max = arr.length - 1;\n let lastNodeIndexFound = 0;\n for (let i = startIndex; i < max; i++) {\n const hook = arr[i + 1];\n if (typeof hook === 'number') {\n lastNodeIndexFound = arr[i];\n if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) {\n break;\n }\n } else {\n const isInitHook = arr[i] < 0;\n if (isInitHook) {\n currentView[PREORDER_HOOK_FLAGS] += 65536;\n }\n if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) {\n callHook(currentView, initPhase, arr, i);\n currentView[PREORDER_HOOK_FLAGS] = (currentView[PREORDER_HOOK_FLAGS] & 4294901760) + i + 2;\n }\n i++;\n }\n }\n}\nfunction callHookInternal(directive, hook) {\n profiler(ProfilerEvent.LifecycleHookStart, directive, hook);\n const prevConsumer = setActiveConsumer(null);\n try {\n hook.call(directive);\n } finally {\n setActiveConsumer(prevConsumer);\n profiler(ProfilerEvent.LifecycleHookEnd, directive, hook);\n }\n}\nfunction callHook(currentView, initPhase, arr, i) {\n const isInitHook = arr[i] < 0;\n const hook = arr[i + 1];\n const directiveIndex = isInitHook ? -arr[i] : arr[i];\n const directive = currentView[directiveIndex];\n if (isInitHook) {\n const indexWithintInitPhase = currentView[FLAGS] >> 14;\n if (indexWithintInitPhase < currentView[PREORDER_HOOK_FLAGS] >> 16 && (currentView[FLAGS] & 3) === initPhase) {\n currentView[FLAGS] += 16384;\n callHookInternal(directive, hook);\n }\n } else {\n callHookInternal(directive, hook);\n }\n}\n\nconst NO_PARENT_INJECTOR = -1;\nclass NodeInjectorFactory {\n factory;\n name;\n injectImpl;\n resolving = false;\n canSeeViewProviders;\n multi;\n componentProviders;\n index;\n providerFactory;\n constructor(factory, isViewProvider, injectImplementation, name) {\n this.factory = factory;\n this.name = name;\n ngDevMode && assertDefined(factory, 'Factory not specified');\n ngDevMode && assertEqual(typeof factory, 'function', 'Expected factory function.');\n this.canSeeViewProviders = isViewProvider;\n this.injectImpl = injectImplementation;\n }\n}\n\nfunction toTNodeTypeAsString(tNodeType) {\n let text = '';\n tNodeType & 1 && (text += '|Text');\n tNodeType & 2 && (text += '|Element');\n tNodeType & 4 && (text += '|Container');\n tNodeType & 8 && (text += '|ElementContainer');\n tNodeType & 16 && (text += '|Projection');\n tNodeType & 32 && (text += '|IcuContainer');\n tNodeType & 64 && (text += '|Placeholder');\n tNodeType & 128 && (text += '|LetDeclaration');\n return text.length > 0 ? text.substring(1) : text;\n}\nfunction isTNodeShape(value) {\n return value != null && typeof value === 'object' && (value.insertBeforeIndex === null || typeof value.insertBeforeIndex === 'number' || Array.isArray(value.insertBeforeIndex));\n}\nfunction isLetDeclaration(tNode) {\n return !!(tNode.type & 128);\n}\nfunction hasClassInput(tNode) {\n return (tNode.flags & 8) !== 0;\n}\nfunction hasStyleInput(tNode) {\n return (tNode.flags & 16) !== 0;\n}\n\nfunction assertTNodeType(tNode, expectedTypes, message) {\n assertDefined(tNode, 'should be called with a TNode');\n if ((tNode.type & expectedTypes) === 0) {\n throwError(message || `Expected [${toTNodeTypeAsString(expectedTypes)}] but got ${toTNodeTypeAsString(tNode.type)}.`);\n }\n}\nfunction assertPureTNodeType(type) {\n if (!(type === 2 || type === 1 || type === 4 || type === 8 || type === 32 || type === 16 || type === 64 || type === 128)) {\n throwError(`Expected TNodeType to have only a single type selected, but got ${toTNodeTypeAsString(type)}.`);\n }\n}\n\nfunction setUpAttributes(renderer, native, attrs) {\n let i = 0;\n while (i < attrs.length) {\n const value = attrs[i];\n if (typeof value === 'number') {\n if (value !== 0) {\n break;\n }\n i++;\n const namespaceURI = attrs[i++];\n const attrName = attrs[i++];\n const attrVal = attrs[i++];\n renderer.setAttribute(native, attrName, attrVal, namespaceURI);\n } else {\n const attrName = value;\n const attrVal = attrs[++i];\n if (isAnimationProp(attrName)) {\n renderer.setProperty(native, attrName, attrVal);\n } else {\n renderer.setAttribute(native, attrName, attrVal);\n }\n i++;\n }\n }\n return i;\n}\nfunction isNameOnlyAttributeMarker(marker) {\n return marker === 3 || marker === 4 || marker === 6;\n}\nfunction isAnimationProp(name) {\n return name.charCodeAt(0) === 64;\n}\nfunction mergeHostAttrs(dst, src) {\n if (src === null || src.length === 0) ; else if (dst === null || dst.length === 0) {\n dst = src.slice();\n } else {\n let srcMarker = -1;\n for (let i = 0; i < src.length; i++) {\n const item = src[i];\n if (typeof item === 'number') {\n srcMarker = item;\n } else {\n if (srcMarker === 0) ; else if (srcMarker === -1 || srcMarker === 2) {\n mergeHostAttribute(dst, srcMarker, item, null, src[++i]);\n } else {\n mergeHostAttribute(dst, srcMarker, item, null, null);\n }\n }\n }\n }\n return dst;\n}\nfunction mergeHostAttribute(dst, marker, key1, key2, value) {\n let i = 0;\n let markerInsertPosition = dst.length;\n if (marker === -1) {\n markerInsertPosition = -1;\n } else {\n while (i < dst.length) {\n const dstValue = dst[i++];\n if (typeof dstValue === 'number') {\n if (dstValue === marker) {\n markerInsertPosition = -1;\n break;\n } else if (dstValue > marker) {\n markerInsertPosition = i - 1;\n break;\n }\n }\n }\n }\n while (i < dst.length) {\n const item = dst[i];\n if (typeof item === 'number') {\n break;\n } else if (item === key1) {\n {\n if (value !== null) {\n dst[i + 1] = value;\n }\n return;\n }\n }\n i++;\n if (value !== null) i++;\n }\n if (markerInsertPosition !== -1) {\n dst.splice(markerInsertPosition, 0, marker);\n i = markerInsertPosition + 1;\n }\n dst.splice(i++, 0, key1);\n if (value !== null) {\n dst.splice(i++, 0, value);\n }\n}\n\nfunction hasParentInjector(parentLocation) {\n return parentLocation !== NO_PARENT_INJECTOR;\n}\nfunction getParentInjectorIndex(parentLocation) {\n if (ngDevMode) {\n assertNumber(parentLocation, 'Number expected');\n assertNotEqual(parentLocation, -1, 'Not a valid state.');\n const parentInjectorIndex = parentLocation & 32767;\n assertGreaterThan(parentInjectorIndex, HEADER_OFFSET, 'Parent injector must be pointing past HEADER_OFFSET.');\n }\n return parentLocation & 32767;\n}\nfunction getParentInjectorViewOffset(parentLocation) {\n return parentLocation >> 16;\n}\nfunction getParentInjectorView(location, startView) {\n let viewOffset = getParentInjectorViewOffset(location);\n let parentView = startView;\n while (viewOffset > 0) {\n parentView = parentView[DECLARATION_VIEW];\n viewOffset--;\n }\n return parentView;\n}\n\nlet includeViewProviders = true;\nfunction setIncludeViewProviders(v) {\n const oldValue = includeViewProviders;\n includeViewProviders = v;\n return oldValue;\n}\nconst BLOOM_SIZE = 256;\nconst BLOOM_MASK = BLOOM_SIZE - 1;\nconst BLOOM_BUCKET_BITS = 5;\nlet nextNgElementId = 0;\nconst NOT_FOUND = {};\nfunction bloomAdd(injectorIndex, tView, type) {\n ngDevMode && assertEqual(tView.firstCreatePass, true, 'expected firstCreatePass to be true');\n let id;\n if (typeof type === 'string') {\n id = type.charCodeAt(0) || 0;\n } else if (Object.hasOwn(type, NG_ELEMENT_ID)) {\n id = type[NG_ELEMENT_ID];\n }\n if (id == null) {\n id = type[NG_ELEMENT_ID] = nextNgElementId++;\n }\n const bloomHash = id & BLOOM_MASK;\n const mask = 1 << bloomHash;\n tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask;\n}\nfunction getOrCreateNodeInjectorForNode(tNode, lView) {\n const existingInjectorIndex = getInjectorIndex(tNode, lView);\n if (existingInjectorIndex !== -1) {\n return existingInjectorIndex;\n }\n const tView = lView[TVIEW$1];\n if (tView.firstCreatePass) {\n tNode.injectorIndex = lView.length;\n insertBloom(tView.data, tNode);\n insertBloom(lView, null);\n insertBloom(tView.blueprint, null);\n }\n const parentLoc = getParentInjectorLocation(tNode, lView);\n const injectorIndex = tNode.injectorIndex;\n if (hasParentInjector(parentLoc)) {\n const parentIndex = getParentInjectorIndex(parentLoc);\n const parentLView = getParentInjectorView(parentLoc, lView);\n const parentData = parentLView[TVIEW$1].data;\n for (let i = 0; i < 8; i++) {\n lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];\n }\n }\n lView[injectorIndex + 8] = parentLoc;\n return injectorIndex;\n}\nfunction insertBloom(arr, footer) {\n arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);\n}\nfunction getInjectorIndex(tNode, lView) {\n if (tNode.injectorIndex === -1 || tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex || lView[tNode.injectorIndex + 8] === null) {\n return -1;\n } else {\n ngDevMode && assertIndexInRange(lView, tNode.injectorIndex);\n return tNode.injectorIndex;\n }\n}\nfunction getParentInjectorLocation(tNode, lView) {\n if (tNode.parent && tNode.parent.injectorIndex !== -1) {\n return tNode.parent.injectorIndex;\n }\n let declarationViewOffset = 0;\n let parentTNode = null;\n let lViewCursor = lView;\n while (lViewCursor !== null) {\n parentTNode = getTNodeFromLView(lViewCursor);\n if (parentTNode === null) {\n return NO_PARENT_INJECTOR;\n }\n ngDevMode && parentTNode && assertTNodeForLView(parentTNode, lViewCursor[DECLARATION_VIEW]);\n declarationViewOffset++;\n lViewCursor = lViewCursor[DECLARATION_VIEW];\n if (parentTNode.injectorIndex !== -1) {\n return parentTNode.injectorIndex | declarationViewOffset << 16;\n }\n }\n return NO_PARENT_INJECTOR;\n}\nfunction diPublicInInjector(injectorIndex, tView, token) {\n bloomAdd(injectorIndex, tView, token);\n}\nfunction injectAttributeImpl(tNode, attrNameToInject) {\n ngDevMode && assertTNodeType(tNode, 12 | 3);\n ngDevMode && assertDefined(tNode, 'expecting tNode');\n if (attrNameToInject === 'class') {\n return tNode.classes;\n }\n if (attrNameToInject === 'style') {\n return tNode.styles;\n }\n const attrs = tNode.attrs;\n if (attrs) {\n const attrsLength = attrs.length;\n let i = 0;\n while (i < attrsLength) {\n const value = attrs[i];\n if (isNameOnlyAttributeMarker(value)) break;\n if (value === 0) {\n i = i + 2;\n } else if (typeof value === 'number') {\n i++;\n while (i < attrsLength && typeof attrs[i] === 'string') {\n i++;\n }\n } else if (value === attrNameToInject) {\n return attrs[i + 1];\n } else {\n i = i + 2;\n }\n }\n }\n return null;\n}\nfunction notFoundValueOrThrow(notFoundValue, token, flags) {\n if (flags & 8 || notFoundValue !== undefined) {\n return notFoundValue;\n } else {\n throwProviderNotFoundError(token, 'NodeInjector');\n }\n}\nfunction lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) {\n if (flags & 8 && notFoundValue === undefined) {\n notFoundValue = null;\n }\n if ((flags & (2 | 1)) === 0) {\n const moduleInjector = lView[INJECTOR];\n const previousInjectImplementation = setInjectImplementation(undefined);\n try {\n if (moduleInjector) {\n return moduleInjector.get(token, notFoundValue, flags & 8);\n } else {\n return injectRootLimpMode(token, notFoundValue, flags & 8);\n }\n } finally {\n setInjectImplementation(previousInjectImplementation);\n }\n }\n return notFoundValueOrThrow(notFoundValue, token, flags);\n}\nfunction getOrCreateInjectable(tNode, lView, token, flags = 0, notFoundValue) {\n if (tNode !== null) {\n if (lView[FLAGS] & 2048 && !(flags & 2)) {\n const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND);\n if (embeddedInjectorValue !== NOT_FOUND) {\n return embeddedInjectorValue;\n }\n }\n const value = lookupTokenUsingNodeInjector(tNode, lView, token, flags, NOT_FOUND);\n if (value !== NOT_FOUND) {\n return value;\n }\n }\n return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n}\nfunction lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) {\n const bloomHash = bloomHashBitOrFactory(token);\n if (typeof bloomHash === 'function') {\n if (!enterDI(lView, tNode, flags)) {\n return flags & 1 ? notFoundValueOrThrow(notFoundValue, token, flags) : lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue);\n }\n try {\n let value;\n if (ngDevMode) {\n runInInjectorProfilerContext(new NodeInjector(getCurrentTNode(), getLView()), token, () => {\n emitInjectorToCreateInstanceEvent(token);\n value = bloomHash(flags);\n emitInstanceCreatedByInjectorEvent(value);\n });\n } else {\n value = bloomHash(flags);\n }\n if (value == null && !(flags & 8)) {\n throwProviderNotFoundError(token);\n } else {\n return value;\n }\n } finally {\n leaveDI();\n }\n } else if (typeof bloomHash === 'number') {\n let previousTView = null;\n let injectorIndex = getInjectorIndex(tNode, lView);\n let parentLocation = NO_PARENT_INJECTOR;\n let hostTElementNode = flags & 1 ? lView[DECLARATION_COMPONENT_VIEW][T_HOST] : null;\n if (injectorIndex === -1 || flags & 4) {\n parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) : lView[injectorIndex + 8];\n if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) {\n injectorIndex = -1;\n } else {\n previousTView = lView[TVIEW$1];\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n }\n }\n while (injectorIndex !== -1) {\n ngDevMode && assertNodeInjector(lView, injectorIndex);\n const tView = lView[TVIEW$1];\n ngDevMode && assertTNodeForLView(tView.data[injectorIndex + 8], lView);\n if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {\n const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode);\n if (instance !== NOT_FOUND) {\n return instance;\n }\n }\n parentLocation = lView[injectorIndex + 8];\n if (parentLocation !== NO_PARENT_INJECTOR && shouldSearchParent(flags, lView[TVIEW$1].data[injectorIndex + 8] === hostTElementNode) && bloomHasToken(bloomHash, injectorIndex, lView)) {\n previousTView = tView;\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n } else {\n injectorIndex = -1;\n }\n }\n }\n return notFoundValue;\n}\nfunction searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {\n const currentTView = lView[TVIEW$1];\n const tNode = currentTView.data[injectorIndex + 8];\n const canAccessViewProviders = previousTView == null ? isComponentHost(tNode) && includeViewProviders : previousTView != currentTView && (tNode.type & 3) !== 0;\n const isHostSpecialCase = flags & 1 && hostTElementNode === tNode;\n const injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase);\n if (injectableIdx !== null) {\n return getNodeInjectable(lView, currentTView, injectableIdx, tNode, flags);\n } else {\n return NOT_FOUND;\n }\n}\nfunction locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {\n const nodeProviderIndexes = tNode.providerIndexes;\n const tInjectables = tView.data;\n const injectablesStart = nodeProviderIndexes & 1048575;\n const directivesStart = tNode.directiveStart;\n const directiveEnd = tNode.directiveEnd;\n const cptViewProvidersCount = nodeProviderIndexes >> 20;\n const startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;\n const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;\n for (let i = startingIndex; i < endIndex; i++) {\n const providerTokenOrDef = tInjectables[i];\n if (i < directivesStart && token === providerTokenOrDef || i >= directivesStart && providerTokenOrDef.type === token) {\n return i;\n }\n }\n if (isHostSpecialCase) {\n const dirDef = tInjectables[directivesStart];\n if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {\n return directivesStart;\n }\n }\n return null;\n}\nlet injectionPath = [];\nfunction getNodeInjectable(lView, tView, index, tNode, flags) {\n let value = lView[index];\n const tData = tView.data;\n if (value instanceof NodeInjectorFactory) {\n const factory = value;\n ngDevMode && injectionPath.push(factory.name ?? 'unknown');\n if (factory.resolving) {\n let token = '';\n if (ngDevMode) {\n token = stringifyForError(tData[index]);\n throw cyclicDependencyErrorWithDetails(token, injectionPath);\n } else {\n throw cyclicDependencyError(token);\n }\n }\n const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);\n factory.resolving = true;\n const token = tData[index].type || tData[index];\n let prevInjectContext;\n if (ngDevMode) {\n const injector = new NodeInjector(tNode, lView);\n prevInjectContext = setInjectorProfilerContext({\n injector,\n token\n });\n }\n const previousInjectImplementation = factory.injectImpl ? setInjectImplementation(factory.injectImpl) : null;\n const success = enterDI(lView, tNode, 0);\n ngDevMode && assertEqual(success, true, \"Because flags do not contain `SkipSelf' we expect this to always succeed.\");\n try {\n ngDevMode && emitInjectorToCreateInstanceEvent(token);\n value = lView[index] = factory.factory(undefined, flags, tData, lView, tNode);\n ngDevMode && emitInstanceCreatedByInjectorEvent(value);\n if (tView.firstCreatePass && index >= tNode.directiveStart) {\n ngDevMode && assertDirectiveDef(tData[index]);\n registerPreOrderHooks(index, tData[index], tView);\n }\n } finally {\n ngDevMode && setInjectorProfilerContext(prevInjectContext);\n previousInjectImplementation !== null && setInjectImplementation(previousInjectImplementation);\n setIncludeViewProviders(previousIncludeViewProviders);\n factory.resolving = false;\n leaveDI();\n ngDevMode && (injectionPath = []);\n }\n }\n return value;\n}\nfunction bloomHashBitOrFactory(token) {\n ngDevMode && assertDefined(token, 'token must be defined');\n if (typeof token === 'string') {\n return token.charCodeAt(0) || 0;\n }\n const tokenId = Object.hasOwn(token, NG_ELEMENT_ID) ? token[NG_ELEMENT_ID] : undefined;\n if (typeof tokenId === 'number') {\n if (tokenId >= 0) {\n return tokenId & BLOOM_MASK;\n } else {\n ngDevMode && assertEqual(tokenId, -1, 'Expecting to get Special Injector Id');\n return createNodeInjector;\n }\n } else {\n return tokenId;\n }\n}\nfunction bloomHasToken(bloomHash, injectorIndex, injectorView) {\n const mask = 1 << bloomHash;\n const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)];\n return !!(value & mask);\n}\nfunction shouldSearchParent(flags, isFirstHostTNode) {\n return !(flags & 2) && !(flags & 1 && isFirstHostTNode);\n}\nfunction getNodeInjectorLView(nodeInjector) {\n return nodeInjector._lView;\n}\nfunction getNodeInjectorTNode(nodeInjector) {\n return nodeInjector._tNode;\n}\nclass NodeInjector {\n _tNode;\n _lView;\n constructor(_tNode, _lView) {\n this._tNode = _tNode;\n this._lView = _lView;\n }\n get(token, notFoundValue, flags) {\n return getOrCreateInjectable(this._tNode, this._lView, token, convertToBitFlags(flags), notFoundValue);\n }\n}\nfunction createNodeInjector() {\n return new NodeInjector(getCurrentTNode(), getLView());\n}\nfunction ษตษตgetInheritedFactory(type) {\n return noSideEffects(() => {\n const ownConstructor = type.prototype.constructor;\n const ownFactory = ownConstructor[NG_FACTORY_DEF] || getFactoryOf(ownConstructor);\n const objectPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n while (parent && parent !== objectPrototype) {\n const factory = parent[NG_FACTORY_DEF] || getFactoryOf(parent);\n if (factory && factory !== ownFactory) {\n return factory;\n }\n parent = Object.getPrototypeOf(parent);\n }\n return t => new t();\n });\n}\nfunction getFactoryOf(type) {\n if (isForwardRef(type)) {\n return () => {\n const factory = getFactoryOf(resolveForwardRef(type));\n return factory && factory();\n };\n }\n return getFactoryDef(type);\n}\nfunction lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundValue) {\n let currentTNode = tNode;\n let currentLView = lView;\n while (currentTNode !== null && currentLView !== null && currentLView[FLAGS] & 2048 && !isRootView(currentLView)) {\n ngDevMode && assertTNodeForLView(currentTNode, currentLView);\n const nodeInjectorValue = lookupTokenUsingNodeInjector(currentTNode, currentLView, token, flags | 2, NOT_FOUND);\n if (nodeInjectorValue !== NOT_FOUND) {\n return nodeInjectorValue;\n }\n flags &= -5;\n let parentTNode = currentTNode.parent;\n if (!parentTNode) {\n const embeddedViewInjector = currentLView[EMBEDDED_VIEW_INJECTOR];\n if (embeddedViewInjector) {\n const embeddedViewInjectorValue = embeddedViewInjector.get(token, NOT_FOUND, flags);\n if (embeddedViewInjectorValue !== NOT_FOUND) {\n return embeddedViewInjectorValue;\n }\n }\n parentTNode = getTNodeFromLView(currentLView);\n currentLView = currentLView[DECLARATION_VIEW];\n }\n currentTNode = parentTNode;\n }\n return notFoundValue;\n}\nfunction getTNodeFromLView(lView) {\n const tView = lView[TVIEW$1];\n const tViewType = tView.type;\n if (tViewType === 2) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode;\n } else if (tViewType === 1) {\n return lView[T_HOST];\n }\n return null;\n}\n\nfunction ษตษตinjectAttribute(attrNameToInject) {\n return injectAttributeImpl(getCurrentTNode(), attrNameToInject);\n}\n\nconst _requestIdleCallback = () => (typeof requestIdleCallback !== 'undefined' ? requestIdleCallback : cb => setTimeout(cb)).bind(globalThis);\nconst _cancelIdleCallback = () => (typeof requestIdleCallback !== 'undefined' ? cancelIdleCallback : clearTimeout).bind(globalThis);\nconst IDLE_SERVICE = /*#__PURE__*/ new InjectionToken(ngDevMode ? 'IDLE_SERVICE' : '', {\n factory: () => new RequestIdleCallbackService()\n});\nfunction provideIdleServiceWith(useExisting) {\n return makeEnvironmentProviders([{\n provide: IDLE_SERVICE,\n useExisting\n }]);\n}\nclass RequestIdleCallbackService {\n requestIdleCallback = _requestIdleCallback();\n cancelIdleCallback = _cancelIdleCallback();\n requestOnIdle(callback, options) {\n return this.requestIdleCallback(callback, options);\n }\n cancelOnIdle(id) {\n return this.cancelIdleCallback(id);\n }\n}\n\nconst ANNOTATIONS = '__annotations__';\nconst PARAMETERS = '__parameters__';\nconst PROP_METADATA = '__prop__metadata__';\nfunction makeDecorator(name, props, parentClass, additionalProcessing, typeFn) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function DecoratorFactory(...args) {\n if (this instanceof DecoratorFactory) {\n metaCtor.call(this, ...args);\n return this;\n }\n const annotationInstance = new DecoratorFactory(...args);\n return function TypeDecorator(cls) {\n if (typeFn) typeFn(cls, ...args);\n const annotations = Object.hasOwn(cls, ANNOTATIONS) ? cls[ANNOTATIONS] : Object.defineProperty(cls, ANNOTATIONS, {\n value: []\n })[ANNOTATIONS];\n annotations.push(annotationInstance);\n return cls;\n };\n }\n if (parentClass) {\n DecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n DecoratorFactory.prototype.ngMetadataName = name;\n DecoratorFactory.annotationCls = DecoratorFactory;\n return DecoratorFactory;\n });\n}\nfunction makeMetadataCtor(props) {\n return function ctor(...args) {\n if (props) {\n const values = props(...args);\n for (const propName in values) {\n this[propName] = values[propName];\n }\n }\n };\n}\nfunction makeParamDecorator(name, props, parentClass) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function ParamDecoratorFactory(...args) {\n if (this instanceof ParamDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const annotationInstance = new ParamDecoratorFactory(...args);\n ParamDecorator.annotation = annotationInstance;\n return ParamDecorator;\n function ParamDecorator(cls, unusedKey, index) {\n const parameters = Object.hasOwn(cls, PARAMETERS) ? cls[PARAMETERS] : Object.defineProperty(cls, PARAMETERS, {\n value: []\n })[PARAMETERS];\n while (parameters.length <= index) {\n parameters.push(null);\n }\n (parameters[index] = parameters[index] || []).push(annotationInstance);\n return cls;\n }\n }\n ParamDecoratorFactory.prototype.ngMetadataName = name;\n ParamDecoratorFactory.annotationCls = ParamDecoratorFactory;\n return ParamDecoratorFactory;\n });\n}\nfunction makePropDecorator(name, props, parentClass, additionalProcessing) {\n return noSideEffects(() => {\n const metaCtor = makeMetadataCtor(props);\n function PropDecoratorFactory(...args) {\n if (this instanceof PropDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const decoratorInstance = new PropDecoratorFactory(...args);\n function PropDecorator(target, name) {\n if (target === undefined) {\n throw new Error('Standard Angular field decorators are not supported in JIT mode.');\n }\n const constructor = target.constructor;\n const meta = Object.hasOwn(constructor, PROP_METADATA) ? constructor[PROP_METADATA] : Object.defineProperty(constructor, PROP_METADATA, {\n value: {}\n })[PROP_METADATA];\n meta[name] = Object.hasOwn(meta, name) && meta[name] || [];\n meta[name].unshift(decoratorInstance);\n }\n return PropDecorator;\n }\n if (parentClass) {\n PropDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n PropDecoratorFactory.prototype.ngMetadataName = name;\n PropDecoratorFactory.annotationCls = PropDecoratorFactory;\n return PropDecoratorFactory;\n });\n}\n\nfunction getCompilerFacade(request) {\n const globalNg = _global['ng'];\n if (globalNg && globalNg.ษตcompilerFacade) {\n return globalNg.ษตcompilerFacade;\n }\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n console.error(`JIT compilation failed for ${request.kind}`, request.type);\n let message = `The ${request.kind} '${request.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\\n\\n`;\n if (request.usage === 1) {\n message += `The ${request.kind} is part of a library that has been partially compiled.\\n`;\n message += `However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\\n`;\n message += '\\n';\n message += `Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\\n`;\n } else {\n message += `JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\\n`;\n }\n message += `Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\\n`;\n message += `or manually provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.`;\n throw new Error(message);\n } else {\n throw new Error('JIT compiler unavailable');\n }\n}\n\nfunction ษตษตdefineService(opts) {\n return {\n token: opts.token,\n providedIn: opts.autoProvided === false ? null : 'root',\n factory: opts.factory,\n value: undefined\n };\n}\n\nconst angularCoreDiEnv = {\n 'ษตษตdefineInjectable': __defineInjectable,\n 'ษตษตdefineInjector': __defineInjector,\n 'ษตษตdefineService': ษตษตdefineService,\n 'ษตษตinject': __inject,\n 'ษตษตinvalidFactoryDep': __invalidFactoryDep,\n 'resolveForwardRef': resolveForwardRef\n};\n\nconst Type = Function;\nfunction isType(v) {\n return typeof v === 'function';\n}\n\nconst ES5_DELEGATE_CTOR = /^function\\s+\\S+\\(\\)\\s*{[\\s\\S]+\\.apply\\(this,\\s*(arguments|(?:[^()]+\\(\\[\\],)?[^()]+\\(arguments\\).*)\\)/;\nconst ES2015_INHERITED_CLASS = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{/;\nconst ES2015_INHERITED_CLASS_WITH_CTOR = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(/;\nconst ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(\\)\\s*{[^}]*super\\(\\.\\.\\.arguments\\)/;\nfunction isDelegateCtor(typeStr) {\n return ES5_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr);\n}\nclass ReflectionCapabilities {\n _reflect;\n constructor(reflect) {\n this._reflect = reflect || _global['Reflect'];\n }\n factory(t) {\n return (...args) => new t(...args);\n }\n _zipTypesAndAnnotations(paramTypes, paramAnnotations) {\n let result;\n if (typeof paramTypes === 'undefined') {\n result = newArray(paramAnnotations.length);\n } else {\n result = newArray(paramTypes.length);\n }\n for (let i = 0; i < result.length; i++) {\n if (typeof paramTypes === 'undefined') {\n result[i] = [];\n } else if (paramTypes[i] && paramTypes[i] != Object) {\n result[i] = [paramTypes[i]];\n } else {\n result[i] = [];\n }\n if (paramAnnotations && paramAnnotations[i] != null) {\n result[i] = result[i].concat(paramAnnotations[i]);\n }\n }\n return result;\n }\n _ownParameters(type, parentCtor) {\n const typeStr = type.toString();\n if (isDelegateCtor(typeStr)) {\n return null;\n }\n if (type.parameters && type.parameters !== parentCtor.parameters) {\n return type.parameters;\n }\n const tsickleCtorParams = type.ctorParameters;\n if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {\n const ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;\n const paramTypes = ctorParameters.map(ctorParam => ctorParam && ctorParam.type);\n const paramAnnotations = ctorParameters.map(ctorParam => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n const paramAnnotations = Object.hasOwn(type, PARAMETERS) && type[PARAMETERS];\n const paramTypes = this._reflect && this._reflect.getOwnMetadata && this._reflect.getOwnMetadata('design:paramtypes', type);\n if (paramTypes || paramAnnotations) {\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n return newArray(type.length);\n }\n parameters(type) {\n if (!isType(type)) {\n return [];\n }\n const parentCtor = getParentCtor(type);\n let parameters = this._ownParameters(type, parentCtor);\n if (!parameters && parentCtor !== Object) {\n parameters = this.parameters(parentCtor);\n }\n return parameters || [];\n }\n _ownAnnotations(typeOrFunc, parentCtor) {\n if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) {\n let annotations = typeOrFunc.annotations;\n if (typeof annotations === 'function' && annotations.annotations) {\n annotations = annotations.annotations;\n }\n return annotations;\n }\n if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) {\n return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators);\n }\n if (Object.hasOwn(typeOrFunc, ANNOTATIONS)) {\n return typeOrFunc[ANNOTATIONS];\n }\n return null;\n }\n annotations(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return [];\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];\n const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];\n return parentAnnotations.concat(ownAnnotations);\n }\n _ownPropMetadata(typeOrFunc, parentCtor) {\n if (typeOrFunc.propMetadata && typeOrFunc.propMetadata !== parentCtor.propMetadata) {\n let propMetadata = typeOrFunc.propMetadata;\n if (typeof propMetadata === 'function' && propMetadata.propMetadata) {\n propMetadata = propMetadata.propMetadata;\n }\n return propMetadata;\n }\n if (typeOrFunc.propDecorators && typeOrFunc.propDecorators !== parentCtor.propDecorators) {\n const propDecorators = typeOrFunc.propDecorators;\n const propMetadata = {};\n Object.keys(propDecorators).forEach(prop => {\n propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);\n });\n return propMetadata;\n }\n if (Object.hasOwn(typeOrFunc, PROP_METADATA)) {\n return typeOrFunc[PROP_METADATA];\n }\n return null;\n }\n propMetadata(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return {};\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const propMetadata = {};\n if (parentCtor !== Object) {\n const parentPropMetadata = this.propMetadata(parentCtor);\n Object.keys(parentPropMetadata).forEach(propName => {\n propMetadata[propName] = parentPropMetadata[propName];\n });\n }\n const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);\n if (ownPropMetadata) {\n Object.keys(ownPropMetadata).forEach(propName => {\n const decorators = [];\n if (Object.hasOwn(propMetadata, propName)) {\n decorators.push(...propMetadata[propName]);\n }\n decorators.push(...ownPropMetadata[propName]);\n propMetadata[propName] = decorators;\n });\n }\n return propMetadata;\n }\n ownPropMetadata(typeOrFunc) {\n if (!isType(typeOrFunc)) {\n return {};\n }\n return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {};\n }\n hasLifecycleHook(type, lcProperty) {\n return type instanceof Type && lcProperty in type.prototype;\n }\n}\nfunction convertTsickleDecoratorIntoMetadata(decoratorInvocations) {\n if (!decoratorInvocations) {\n return [];\n }\n return decoratorInvocations.map(decoratorInvocation => {\n const decoratorType = decoratorInvocation.type;\n const annotationCls = decoratorType.annotationCls;\n const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];\n return new annotationCls(...annotationArgs);\n });\n}\nfunction getParentCtor(ctor) {\n const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;\n const parentCtor = parentProto ? parentProto.constructor : null;\n return parentCtor || Object;\n}\n\nconst Inject = /*#__PURE__*/ attachInjectFlag(/*#__PURE__*/ makeParamDecorator('Inject', token => ({\n token\n})), -1);\nconst Optional = /*#__PURE__*/ attachInjectFlag(/*#__PURE__*/ makeParamDecorator('Optional'), 8);\nconst Self = /*#__PURE__*/ attachInjectFlag(/*#__PURE__*/ makeParamDecorator('Self'), 2);\nconst SkipSelf = /*#__PURE__*/ attachInjectFlag(/*#__PURE__*/ makeParamDecorator('SkipSelf'), 4);\nconst Host = /*#__PURE__*/ attachInjectFlag(/*#__PURE__*/ makeParamDecorator('Host'), 1);\n\nconst Attribute = /*#__PURE__*/ makeParamDecorator('Attribute', attributeName => ({\n attributeName,\n __NG_ELEMENT_ID__: () => ษตษตinjectAttribute(attributeName)\n}));\n\nlet _reflect = null;\nfunction getReflect() {\n return _reflect = _reflect || new ReflectionCapabilities();\n}\nfunction reflectDependencies(type) {\n return convertDependencies(getReflect().parameters(type));\n}\nfunction convertDependencies(deps) {\n return deps.map(dep => reflectDependency(dep));\n}\nfunction reflectDependency(dep) {\n const meta = {\n token: null,\n attribute: null,\n host: false,\n optional: false,\n self: false,\n skipSelf: false\n };\n if (Array.isArray(dep) && dep.length > 0) {\n for (let j = 0; j < dep.length; j++) {\n const param = dep[j];\n if (param === undefined) {\n continue;\n }\n const proto = Object.getPrototypeOf(param);\n if (param instanceof Optional || proto.ngMetadataName === 'Optional') {\n meta.optional = true;\n } else if (param instanceof SkipSelf || proto.ngMetadataName === 'SkipSelf') {\n meta.skipSelf = true;\n } else if (param instanceof Self || proto.ngMetadataName === 'Self') {\n meta.self = true;\n } else if (param instanceof Host || proto.ngMetadataName === 'Host') {\n meta.host = true;\n } else if (param instanceof Inject) {\n meta.token = param.token;\n } else if (param instanceof Attribute) {\n if (param.attributeName === undefined) {\n throw new RuntimeError(-204, ngDevMode && `Attribute name must be defined.`);\n }\n meta.attribute = param.attributeName;\n } else {\n meta.token = param;\n }\n }\n } else if (dep === undefined || Array.isArray(dep) && dep.length === 0) {\n meta.token = null;\n } else {\n meta.token = dep;\n }\n return meta;\n}\n\nfunction compileInjectable(type, meta) {\n let ngInjectableDef = null;\n let ngFactoryDef = null;\n if (!Object.hasOwn(type, NG_PROV_DEF)) {\n Object.defineProperty(type, NG_PROV_DEF, {\n get: () => {\n if (ngInjectableDef === null) {\n const compiler = getCompilerFacade({\n usage: 0,\n kind: 'injectable',\n type\n });\n ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, `ng:///${type.name}/ษตprov.js`, getInjectableMetadata(type, meta));\n }\n return ngInjectableDef;\n }\n });\n }\n if (!Object.hasOwn(type, NG_FACTORY_DEF)) {\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (ngFactoryDef === null) {\n const compiler = getCompilerFacade({\n usage: 0,\n kind: 'injectable',\n type\n });\n ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ษตfac.js`, {\n name: type.name,\n type,\n typeArgumentCount: 0,\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Injectable\n });\n }\n return ngFactoryDef;\n },\n configurable: true\n });\n }\n}\nconst USE_VALUE = /*#__PURE__*/ getClosureSafeProperty({\n provide: String,\n useValue: getClosureSafeProperty\n});\nfunction isUseClassProvider(meta) {\n return meta.useClass !== undefined;\n}\nfunction isUseValueProvider(meta) {\n return USE_VALUE in meta;\n}\nfunction isUseFactoryProvider(meta) {\n return meta.useFactory !== undefined;\n}\nfunction isUseExistingProvider(meta) {\n return meta.useExisting !== undefined;\n}\nfunction getInjectableMetadata(type, srcMeta) {\n const meta = srcMeta || {\n providedIn: null\n };\n const compilerMeta = {\n name: type.name,\n type: type,\n typeArgumentCount: 0,\n providedIn: meta.providedIn\n };\n if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== undefined) {\n compilerMeta.deps = convertDependencies(meta.deps);\n }\n if (isUseClassProvider(meta)) {\n compilerMeta.useClass = meta.useClass;\n } else if (isUseValueProvider(meta)) {\n compilerMeta.useValue = meta.useValue;\n } else if (isUseFactoryProvider(meta)) {\n compilerMeta.useFactory = meta.useFactory;\n } else if (isUseExistingProvider(meta)) {\n compilerMeta.useExisting = meta.useExisting;\n }\n return compilerMeta;\n}\n\nconst Injectable = /*#__PURE__*/ makeDecorator('Injectable', undefined, undefined, undefined, (type, meta) => compileInjectable(type, meta));\n\nfunction compileService(type, meta) {\n let def = null;\n let factoryDef = null;\n if (!Object.hasOwn(type, NG_PROV_DEF)) {\n Object.defineProperty(type, NG_PROV_DEF, {\n get: () => {\n if (def === null) {\n const compiler = getCompilerFacade({\n usage: 0,\n kind: 'service',\n type\n });\n def = compiler.compileService(angularCoreDiEnv, `ng:///${type.name}/ษตprov.js`, getServiceMetadata(type, meta));\n }\n return def;\n }\n });\n }\n if (!Object.hasOwn(type, NG_FACTORY_DEF)) {\n Object.defineProperty(type, NG_FACTORY_DEF, {\n get: () => {\n if (factoryDef === null) {\n const compiler = getCompilerFacade({\n usage: 0,\n kind: 'service',\n type\n });\n factoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ษตfac.js`, {\n name: type.name,\n type,\n typeArgumentCount: 0,\n deps: reflectDependencies(type),\n target: compiler.FactoryTarget.Service\n });\n }\n return factoryDef;\n },\n configurable: true\n });\n }\n}\nfunction getServiceMetadata(type, srcMeta) {\n const compilerMeta = {\n name: type.name,\n type: type,\n typeArgumentCount: 0,\n autoProvided: srcMeta?.autoProvided,\n factory: srcMeta?.factory\n };\n return compilerMeta;\n}\n\nconst Service = /*#__PURE__*/ makeDecorator('Service', undefined, undefined, undefined, (type, meta) => compileService(type, meta));\n\nfunction injectElementRef() {\n return createElementRef(getCurrentTNode(), getLView());\n}\nfunction createElementRef(tNode, lView) {\n return new ElementRef(getNativeByTNode(tNode, lView));\n}\nlet ElementRef = /*#__PURE__*/ (() => {\nclass ElementRef {\n nativeElement;\n constructor(nativeElement) {\n this.nativeElement = nativeElement;\n }\n static __NG_ELEMENT_ID__ = injectElementRef;\n}\nreturn ElementRef;\n})();\nif (typeof ngDevMode === 'undefined' || ngDevMode) {\n /*#__PURE__*/ registerSpecialProvider(ElementRef);\n}\nfunction unwrapElementRef(value) {\n return value instanceof ElementRef ? value.nativeElement : value;\n}\n\nfunction symbolIterator() {\n return this._results[Symbol.iterator]();\n}\nclass QueryList {\n _emitDistinctChangesOnly;\n dirty = true;\n _onDirty = undefined;\n _results = [];\n _changesDetected = false;\n _changes = undefined;\n length = 0;\n first = undefined;\n last = undefined;\n get changes() {\n return this._changes ??= new Subject();\n }\n constructor(_emitDistinctChangesOnly = false) {\n this._emitDistinctChangesOnly = _emitDistinctChangesOnly;\n }\n get(index) {\n return this._results[index];\n }\n map(fn) {\n return this._results.map(fn);\n }\n filter(fn) {\n return this._results.filter(fn);\n }\n find(fn) {\n return this._results.find(fn);\n }\n reduce(fn, init) {\n return this._results.reduce(fn, init);\n }\n forEach(fn) {\n this._results.forEach(fn);\n }\n some(fn) {\n return this._results.some(fn);\n }\n toArray() {\n return this._results.slice();\n }\n toString() {\n return this._results.toString();\n }\n reset(resultsTree, identityAccessor) {\n this.dirty = false;\n const newResultFlat = flatten(resultsTree);\n if (this._changesDetected = !arrayEquals(this._results, newResultFlat, identityAccessor)) {\n this._results = newResultFlat;\n this.length = newResultFlat.length;\n this.last = newResultFlat[this.length - 1];\n this.first = newResultFlat[0];\n }\n }\n notifyOnChanges() {\n if (this._changes !== undefined && (this._changesDetected || !this._emitDistinctChangesOnly)) this._changes.next(this);\n }\n onDirty(cb) {\n this._onDirty = cb;\n }\n setDirty() {\n this.dirty = true;\n this._onDirty?.();\n }\n destroy() {\n if (this._changes !== undefined) {\n this._changes.complete();\n this._changes.unsubscribe();\n }\n }\n [Symbol.iterator] = (() => symbolIterator)();\n}\n\nconst SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration';\nconst SKIP_HYDRATION_ATTR_NAME_LOWER_CASE = 'ngskiphydration';\nfunction hasSkipHydrationAttrOnTNode(tNode) {\n const attrs = tNode.mergedAttrs;\n if (attrs === null) return false;\n for (let i = 0; i < attrs.length; i += 2) {\n const value = attrs[i];\n if (typeof value === 'number') return false;\n if (typeof value === 'string' && value.toLowerCase() === SKIP_HYDRATION_ATTR_NAME_LOWER_CASE) {\n return true;\n }\n }\n return false;\n}\nfunction hasSkipHydrationAttrOnRElement(rNode) {\n return rNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME);\n}\nfunction hasInSkipHydrationBlockFlag(tNode) {\n return (tNode.flags & 128) === 128;\n}\nfunction isInSkipHydrationBlock(tNode) {\n if (hasInSkipHydrationBlockFlag(tNode)) {\n return true;\n }\n let currentTNode = tNode.parent;\n while (currentTNode) {\n if (hasInSkipHydrationBlockFlag(tNode) || hasSkipHydrationAttrOnTNode(currentTNode)) {\n return true;\n }\n currentTNode = currentTNode.parent;\n }\n return false;\n}\nfunction isI18nInSkipHydrationBlock(parentTNode) {\n return hasInSkipHydrationBlockFlag(parentTNode) || hasSkipHydrationAttrOnTNode(parentTNode) || isInSkipHydrationBlock(parentTNode);\n}\n\nvar ChangeDetectionStrategy = /*#__PURE__*/ (function (ChangeDetectionStrategy) {\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"OnPush\"] = 0] = \"OnPush\";\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"Eager\"] = 1] = \"Eager\";\n ChangeDetectionStrategy[ChangeDetectionStrategy[\"Default\"] = 1] = \"Default\";\n; return ChangeDetectionStrategy;})(ChangeDetectionStrategy || {});\n\n\nconst TRACKED_LVIEWS = /*#__PURE__*/ new Map();\nlet uniqueIdCounter = 0;\nfunction getUniqueLViewId() {\n return uniqueIdCounter++;\n}\nfunction registerLView(lView) {\n ngDevMode && assertNumber(lView[ID], 'LView must have an ID in order to be registered');\n TRACKED_LVIEWS.set(lView[ID], lView);\n}\nfunction getLViewById(id) {\n ngDevMode && assertNumber(id, 'ID used for LView lookup must be a number');\n return TRACKED_LVIEWS.get(id) || null;\n}\nfunction unregisterLView(lView) {\n ngDevMode && assertNumber(lView[ID], 'Cannot stop tracking an LView that does not have an ID');\n TRACKED_LVIEWS.delete(lView[ID]);\n}\nfunction getTrackedLViews() {\n return TRACKED_LVIEWS;\n}\n\nclass LContext {\n lViewId;\n nodeIndex;\n native;\n component;\n directives;\n localRefs;\n get lView() {\n return getLViewById(this.lViewId);\n }\n constructor(lViewId, nodeIndex, native) {\n this.lViewId = lViewId;\n this.nodeIndex = nodeIndex;\n this.native = native;\n }\n}\n\nfunction getLContext(target) {\n let mpValue = readPatchedData(target);\n if (mpValue) {\n if (isLView(mpValue)) {\n const lView = mpValue;\n let nodeIndex;\n let component = undefined;\n let directives = undefined;\n if (isComponentInstance(target)) {\n nodeIndex = findViaComponent(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided component was not found in the application');\n }\n component = target;\n } else if (isDirectiveInstance(target)) {\n nodeIndex = findViaDirective(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided directive was not found in the application');\n }\n directives = getDirectivesAtNodeIndex(nodeIndex, lView);\n } else {\n nodeIndex = findViaNativeElement(lView, target);\n if (nodeIndex == -1) {\n return null;\n }\n }\n const native = unwrapRNode(lView[nodeIndex]);\n const existingCtx = readPatchedData(native);\n const context = existingCtx && !Array.isArray(existingCtx) ? existingCtx : createLContext(lView, nodeIndex, native);\n if (component && context.component === undefined) {\n context.component = component;\n attachPatchData(context.component, context);\n }\n if (directives && context.directives === undefined) {\n context.directives = directives;\n for (let i = 0; i < directives.length; i++) {\n attachPatchData(directives[i], context);\n }\n }\n attachPatchData(context.native, context);\n mpValue = context;\n }\n } else {\n const rElement = target;\n ngDevMode && assertDomNode(rElement);\n let parent = rElement;\n while (parent = parent.parentNode) {\n const parentContext = readPatchedData(parent);\n if (parentContext) {\n const lView = Array.isArray(parentContext) ? parentContext : parentContext.lView;\n if (!lView) {\n return null;\n }\n const index = findViaNativeElement(lView, rElement);\n if (index >= 0) {\n const native = unwrapRNode(lView[index]);\n const context = createLContext(lView, index, native);\n attachPatchData(native, context);\n mpValue = context;\n break;\n }\n }\n }\n }\n return mpValue || null;\n}\nfunction createLContext(lView, nodeIndex, native) {\n return new LContext(lView[ID], nodeIndex, native);\n}\nfunction getComponentViewByInstance(componentInstance) {\n let patchedData = readPatchedData(componentInstance);\n let lView;\n if (isLView(patchedData)) {\n const contextLView = patchedData;\n const nodeIndex = findViaComponent(contextLView, componentInstance);\n lView = getComponentLViewByIndex(nodeIndex, contextLView);\n const context = createLContext(contextLView, nodeIndex, lView[HOST]);\n context.component = componentInstance;\n attachPatchData(componentInstance, context);\n attachPatchData(context.native, context);\n } else {\n const context = patchedData;\n const contextLView = context.lView;\n ngDevMode && assertLView(contextLView);\n lView = getComponentLViewByIndex(context.nodeIndex, contextLView);\n }\n return lView;\n}\nconst MONKEY_PATCH_KEY_NAME = '__ngContext__';\nfunction attachPatchData(target, data) {\n ngDevMode && assertDefined(target, 'Target expected');\n if (isLView(data)) {\n target[MONKEY_PATCH_KEY_NAME] = data[ID];\n registerLView(data);\n } else {\n target[MONKEY_PATCH_KEY_NAME] = data;\n }\n}\nfunction readPatchedData(target) {\n ngDevMode && assertDefined(target, 'Target expected');\n const data = target[MONKEY_PATCH_KEY_NAME];\n return typeof data === 'number' ? getLViewById(data) : data || null;\n}\nfunction readPatchedLView(target) {\n const value = readPatchedData(target);\n if (value) {\n return isLView(value) ? value : value.lView;\n }\n return null;\n}\nfunction isComponentInstance(instance) {\n return instance && instance.constructor && instance.constructor.ษตcmp;\n}\nfunction isDirectiveInstance(instance) {\n return instance && instance.constructor && instance.constructor.ษตdir;\n}\nfunction findViaNativeElement(lView, target) {\n const tView = lView[TVIEW$1];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (unwrapRNode(lView[i]) === target) {\n return i;\n }\n }\n return -1;\n}\nfunction traverseNextElement(tNode) {\n if (tNode.child) {\n return tNode.child;\n } else if (tNode.next) {\n return tNode.next;\n } else {\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}\nfunction findViaComponent(lView, componentInstance) {\n const componentIndices = lView[TVIEW$1].components;\n if (componentIndices) {\n for (let i = 0; i < componentIndices.length; i++) {\n const elementComponentIndex = componentIndices[i];\n const componentView = getComponentLViewByIndex(elementComponentIndex, lView);\n if (componentView[CONTEXT] === componentInstance) {\n return elementComponentIndex;\n }\n }\n } else {\n const rootComponentView = getComponentLViewByIndex(HEADER_OFFSET, lView);\n const rootComponent = rootComponentView[CONTEXT];\n if (rootComponent === componentInstance) {\n return HEADER_OFFSET;\n }\n }\n return -1;\n}\nfunction findViaDirective(lView, directiveInstance) {\n let tNode = lView[TVIEW$1].firstChild;\n while (tNode) {\n const directiveIndexStart = tNode.directiveStart;\n const directiveIndexEnd = tNode.directiveEnd;\n for (let i = directiveIndexStart; i < directiveIndexEnd; i++) {\n if (lView[i] === directiveInstance) {\n return tNode.index;\n }\n }\n tNode = traverseNextElement(tNode);\n }\n return -1;\n}\nfunction getDirectivesAtNodeIndex(nodeIndex, lView) {\n const tNode = lView[TVIEW$1].data[nodeIndex];\n if (tNode.directiveStart === 0) return EMPTY_ARRAY;\n const results = [];\n for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {\n const directiveInstance = lView[i];\n if (!isComponentInstance(directiveInstance)) {\n results.push(directiveInstance);\n }\n }\n return results;\n}\nfunction getComponentAtNodeIndex(nodeIndex, lView) {\n const tNode = lView[TVIEW$1].data[nodeIndex];\n return isComponentHost(tNode) ? lView[tNode.directiveStart + tNode.componentOffset] : null;\n}\nfunction discoverLocalRefs(lView, nodeIndex) {\n const tNode = lView[TVIEW$1].data[nodeIndex];\n if (tNode && tNode.localNames) {\n const result = {};\n let localIndex = tNode.index + 1;\n for (let i = 0; i < tNode.localNames.length; i += 2) {\n result[tNode.localNames[i]] = lView[localIndex];\n localIndex++;\n }\n return result;\n }\n return null;\n}\n\nfunction getRootView(componentOrLView) {\n ngDevMode && assertDefined(componentOrLView, 'component');\n let lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView);\n while (lView && !isRootView(lView)) {\n lView = getLViewParent(lView);\n }\n ngDevMode && assertLView(lView);\n return lView;\n}\nfunction getRootContext(viewOrComponent) {\n const rootView = getRootView(viewOrComponent);\n ngDevMode && assertDefined(rootView[CONTEXT], 'Root view has no context. Perhaps it is disconnected?');\n return rootView[CONTEXT];\n}\nfunction getFirstLContainer(lView) {\n return getNearestLContainer(lView[CHILD_HEAD]);\n}\nfunction getNextLContainer(container) {\n return getNearestLContainer(container[NEXT]);\n}\nfunction getNearestLContainer(viewOrContainer) {\n while (viewOrContainer !== null && !isLContainer(viewOrContainer)) {\n viewOrContainer = viewOrContainer[NEXT];\n }\n return viewOrContainer;\n}\nfunction* walkLViewChildren(tNode, lView) {\n let child = tNode.child;\n while (child) {\n yield [child, lView];\n child = child.next;\n }\n if (tNode.componentOffset > -1) {\n const componentLView = getComponentLViewByIndex(tNode.index, lView);\n if (isLView(componentLView)) {\n const componentTView = componentLView[TVIEW$1];\n let componentChild = componentTView.firstChild;\n while (componentChild) {\n yield [componentChild, componentLView];\n componentChild = componentChild.next;\n }\n }\n }\n const slot = lView[tNode.index];\n if (isLContainer(slot)) {\n for (let i = CONTAINER_HEADER_OFFSET; i < slot.length; i++) {\n const embeddedLView = slot[i];\n const embeddedTView = embeddedLView[TVIEW$1];\n let embeddedChild = embeddedTView.firstChild;\n while (embeddedChild) {\n yield [embeddedChild, embeddedLView];\n embeddedChild = embeddedChild.next;\n }\n }\n }\n}\nfunction* walkLViewDescendants(lView) {\n const tView = lView[TVIEW$1];\n let child = tView.firstChild;\n while (child) {\n yield* walkTNodeDescendants(child, lView);\n child = child.next;\n }\n}\nfunction* walkTNodeDescendants(tNode, lView) {\n yield [tNode, lView];\n for (const [childTNode, childLView] of walkLViewChildren(tNode, lView)) {\n yield* walkTNodeDescendants(childTNode, childLView);\n }\n}\nfunction* walkLViewDirectives(lView) {\n for (const [tNode, currentLView] of walkLViewDescendants(lView)) {\n if (tNode.directiveEnd > tNode.directiveStart) {\n yield [tNode, currentLView];\n }\n }\n}\n\nfunction getComponent(element) {\n ngDevMode && assertDomElement(element);\n const context = getLContext(element);\n if (context === null) return null;\n if (context.component === undefined) {\n const lView = context.lView;\n if (lView === null) {\n return null;\n }\n context.component = getComponentAtNodeIndex(context.nodeIndex, lView);\n }\n return context.component;\n}\nfunction getContext(element) {\n assertDomElement(element);\n const context = getLContext(element);\n const lView = context ? context.lView : null;\n return lView === null ? null : lView[CONTEXT];\n}\nfunction getOwningComponent(elementOrDir) {\n const context = getLContext(elementOrDir);\n let lView = context ? context.lView : null;\n if (lView === null) return null;\n let parent;\n while (lView[TVIEW$1].type === 2 && (parent = getLViewParent(lView))) {\n lView = parent;\n }\n return isRootView(lView) ? null : lView[CONTEXT];\n}\nfunction getRootComponents(elementOrDir) {\n const lView = readPatchedLView(elementOrDir);\n return lView !== null ? [getRootContext(lView)] : [];\n}\nfunction getInjector(elementOrDir) {\n const context = getLContext(elementOrDir);\n const lView = context ? context.lView : null;\n if (lView === null) return Injector.NULL;\n const tNode = lView[TVIEW$1].data[context.nodeIndex];\n return new NodeInjector(tNode, lView);\n}\nfunction getInjectionTokens(element) {\n const context = getLContext(element);\n const lView = context ? context.lView : null;\n if (lView === null) return [];\n const tView = lView[TVIEW$1];\n const tNode = tView.data[context.nodeIndex];\n const providerTokens = [];\n const startIndex = tNode.providerIndexes & 1048575;\n const endIndex = tNode.directiveEnd;\n for (let i = startIndex; i < endIndex; i++) {\n let value = tView.data[i];\n if (isDirectiveDefHack(value)) {\n value = value.type;\n }\n providerTokens.push(value);\n }\n return providerTokens;\n}\nfunction getDirectives(node) {\n if (node instanceof Text) {\n return [];\n }\n const context = getLContext(node);\n const lView = context ? context.lView : null;\n if (lView === null) {\n return [];\n }\n const tView = lView[TVIEW$1];\n const nodeIndex = context.nodeIndex;\n if (!tView?.data[nodeIndex]) {\n return [];\n }\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(nodeIndex, lView);\n }\n return context.directives === null ? [] : [...context.directives];\n}\nvar AcxChangeDetectionStrategy = /*#__PURE__*/ (function (AcxChangeDetectionStrategy) {\n AcxChangeDetectionStrategy[AcxChangeDetectionStrategy[\"Default\"] = 0] = \"Default\";\n AcxChangeDetectionStrategy[AcxChangeDetectionStrategy[\"OnPush\"] = 1] = \"OnPush\";\n; return AcxChangeDetectionStrategy;})(AcxChangeDetectionStrategy || {});\n\nvar AcxViewEncapsulation = /*#__PURE__*/ (function (AcxViewEncapsulation) {\n AcxViewEncapsulation[AcxViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n AcxViewEncapsulation[AcxViewEncapsulation[\"None\"] = 1] = \"None\";\n; return AcxViewEncapsulation;})(AcxViewEncapsulation || {});\n\nfunction getDirectiveMetadata$1(directiveOrComponentInstance) {\n if (!directiveOrComponentInstance) {\n return null;\n }\n const {\n constructor\n } = directiveOrComponentInstance;\n if (!constructor) {\n throw new Error('Unable to find the instance constructor');\n }\n const componentDef = getComponentDef(constructor);\n if (componentDef) {\n const inputs = extractInputDebugMetadata(componentDef.inputs);\n return {\n inputs,\n outputs: componentDef.outputs,\n encapsulation: componentDef.encapsulation,\n changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush : ChangeDetectionStrategy.Eager\n };\n }\n const directiveDef = getDirectiveDef(constructor);\n if (directiveDef) {\n const inputs = extractInputDebugMetadata(directiveDef.inputs);\n return {\n inputs,\n outputs: directiveDef.outputs\n };\n }\n return null;\n}\nfunction getLocalRefs(target) {\n const context = getLContext(target);\n if (context === null) return {};\n if (context.localRefs === undefined) {\n const lView = context.lView;\n if (lView === null) {\n return {};\n }\n context.localRefs = discoverLocalRefs(lView, context.nodeIndex);\n }\n return context.localRefs || {};\n}\nfunction getHostElement(componentOrDirective) {\n return getLContext(componentOrDirective).native;\n}\nfunction getListeners(element) {\n ngDevMode && assertDomElement(element);\n const lContext = getLContext(element);\n const lView = lContext === null ? null : lContext.lView;\n if (lView === null) return [];\n const tView = lView[TVIEW$1];\n const lCleanup = lView[CLEANUP];\n const tCleanup = tView.cleanup;\n const listeners = [];\n if (tCleanup && lCleanup) {\n for (let i = 0; i < tCleanup.length;) {\n const firstParam = tCleanup[i++];\n const secondParam = tCleanup[i++];\n if (typeof firstParam === 'string') {\n const name = firstParam;\n const listenerElement = unwrapRNode(lView[secondParam]);\n const callback = lCleanup[tCleanup[i++]];\n const useCaptureOrIndx = tCleanup[i++];\n const type = typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0 ? 'dom' : 'output';\n const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;\n if (element == listenerElement) {\n listeners.push({\n element,\n name,\n callback,\n useCapture,\n type\n });\n }\n }\n }\n }\n listeners.sort(sortListeners);\n return listeners;\n}\nfunction sortListeners(a, b) {\n if (a.name == b.name) return 0;\n return a.name < b.name ? -1 : 1;\n}\nfunction isDirectiveDefHack(obj) {\n return obj.type !== undefined && obj.declaredInputs !== undefined && obj.resolveHostDirectives !== undefined;\n}\nfunction assertDomElement(value) {\n if (typeof Element !== 'undefined' && !(value instanceof Element)) {\n throw new Error('Expecting instance of DOM Element');\n }\n}\nfunction extractInputDebugMetadata(inputs) {\n const res = {};\n for (const key in inputs) {\n if (Object.hasOwn(inputs, key)) {\n const value = inputs[key];\n if (value !== undefined) {\n res[key] = value[0];\n }\n }\n }\n return res;\n}\n\nlet DOCUMENT = undefined;\nfunction setDocument(document) {\n DOCUMENT = document;\n}\nfunction getDocument() {\n if (DOCUMENT !== undefined) {\n return DOCUMENT;\n } else if (typeof document !== 'undefined') {\n return document;\n }\n throw new RuntimeError(210, (typeof ngDevMode === 'undefined' || ngDevMode) && `The document object is not available in this context. Make sure the DOCUMENT injection token is provided.`);\n}\n\nconst REFERENCE_NODE_HOST = 'h';\nconst REFERENCE_NODE_BODY = 'b';\nconst NODE_NAVIGATION_STEP_FIRST_CHILD = 'f';\nconst NODE_NAVIGATION_STEP_NEXT_SIBLING = 'n';\nconst ELEMENT_CONTAINERS = 'e';\nconst TEMPLATES = 't';\nconst CONTAINERS = 'c';\nconst MULTIPLIER = 'x';\nconst NUM_ROOT_NODES = 'r';\nconst TEMPLATE_ID = 'i';\nconst NODES = 'n';\nconst DISCONNECTED_NODES = 'd';\nconst I18N_DATA = 'l';\nconst DEFER_BLOCK_ID = 'di';\nconst DEFER_BLOCK_STATE$1 = 's';\nconst DEFER_PARENT_BLOCK_ID = 'p';\nconst DEFER_HYDRATE_TRIGGERS = 't';\n\nconst IS_HYDRATION_DOM_REUSE_ENABLED = /*#__PURE__*/ new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'IS_HYDRATION_DOM_REUSE_ENABLED' : '');\nconst PRESERVE_HOST_CONTENT_DEFAULT = false;\nconst PRESERVE_HOST_CONTENT = /*#__PURE__*/ new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'PRESERVE_HOST_CONTENT' : '', {\n factory: () => PRESERVE_HOST_CONTENT_DEFAULT\n});\nconst IS_I18N_HYDRATION_ENABLED = /*#__PURE__*/ new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'IS_I18N_HYDRATION_ENABLED' : '');\nconst IS_EVENT_REPLAY_ENABLED = /*#__PURE__*/ new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'IS_EVENT_REPLAY_ENABLED' : '');\nconst EVENT_REPLAY_ENABLED_DEFAULT = false;\nconst EVENT_REPLAY_QUEUE = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'EVENT_REPLAY_QUEUE' : '', {\n factory: () => []\n});\nconst IS_INCREMENTAL_HYDRATION_ENABLED = /*#__PURE__*/ new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'IS_INCREMENTAL_HYDRATION_ENABLED' : '');\nconst JSACTION_BLOCK_ELEMENT_MAP = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'JSACTION_BLOCK_ELEMENT_MAP' : '', {\n factory: () => new Map()\n});\nconst IS_ENABLED_BLOCKING_INITIAL_NAVIGATION = /*#__PURE__*/ new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'IS_ENABLED_BLOCKING_INITIAL_NAVIGATION' : '');\n\nconst eventListenerOptions = {\n passive: true,\n capture: true\n};\nconst hoverTriggers = /*#__PURE__*/ new WeakMap();\nconst interactionTriggers = /*#__PURE__*/ new WeakMap();\nconst viewportTriggers = /*#__PURE__*/ new WeakMap();\nconst interactionEventNames = ['click', 'keydown'];\nconst hoverEventNames = ['mouseenter', 'mouseover', 'focusin'];\nconst intersectionObservers = /*#__PURE__*/ new Map();\nclass DeferEventEntry {\n callbacks = new Set();\n listener = () => {\n for (const callback of this.callbacks) {\n callback();\n }\n };\n}\nfunction onInteraction(trigger, callback) {\n let entry = interactionTriggers.get(trigger);\n if (!entry) {\n entry = new DeferEventEntry();\n interactionTriggers.set(trigger, entry);\n for (const name of interactionEventNames) {\n trigger.addEventListener(name, entry.listener, eventListenerOptions);\n }\n }\n entry.callbacks.add(callback);\n return () => {\n const {\n callbacks,\n listener\n } = entry;\n callbacks.delete(callback);\n if (callbacks.size === 0) {\n interactionTriggers.delete(trigger);\n for (const name of interactionEventNames) {\n trigger.removeEventListener(name, listener, eventListenerOptions);\n }\n }\n };\n}\nfunction onHover(trigger, callback) {\n let entry = hoverTriggers.get(trigger);\n if (!entry) {\n entry = new DeferEventEntry();\n hoverTriggers.set(trigger, entry);\n for (const name of hoverEventNames) {\n trigger.addEventListener(name, entry.listener, eventListenerOptions);\n }\n }\n entry.callbacks.add(callback);\n return () => {\n const {\n callbacks,\n listener\n } = entry;\n callbacks.delete(callback);\n if (callbacks.size === 0) {\n for (const name of hoverEventNames) {\n trigger.removeEventListener(name, listener, eventListenerOptions);\n }\n hoverTriggers.delete(trigger);\n }\n };\n}\nfunction createIntersectionObserver(options) {\n const key = getIntersectionObserverKey(options);\n return new IntersectionObserver(entries => {\n for (const current of entries) {\n if (current.isIntersecting && viewportTriggers.has(current.target)) {\n viewportTriggers.get(current.target)?.get(key)?.listener();\n }\n }\n }, options);\n}\nfunction onViewport(trigger, callback, observerFactoryFn, options) {\n const key = getIntersectionObserverKey(options);\n let entry = viewportTriggers.get(trigger)?.get(key);\n if (!intersectionObservers.has(key)) {\n intersectionObservers.set(key, {\n observer: observerFactoryFn(options),\n count: 0\n });\n }\n const config = intersectionObservers.get(key);\n if (!entry) {\n entry = new DeferEventEntry();\n config.observer.observe(trigger);\n let triggerConfig = viewportTriggers.get(trigger);\n if (triggerConfig) {\n triggerConfig.set(key, entry);\n } else {\n triggerConfig = new Map();\n viewportTriggers.set(trigger, triggerConfig);\n }\n triggerConfig.set(key, entry);\n config.count++;\n }\n entry.callbacks.add(callback);\n return () => {\n if (!viewportTriggers.get(trigger)?.has(key)) {\n return;\n }\n entry.callbacks.delete(callback);\n if (entry.callbacks.size === 0) {\n config.observer.unobserve(trigger);\n config.count--;\n const triggerConfig = viewportTriggers.get(trigger);\n if (triggerConfig) {\n triggerConfig.delete(key);\n if (triggerConfig.size === 0) {\n viewportTriggers.delete(trigger);\n }\n }\n }\n if (config.count === 0) {\n config.observer.disconnect();\n intersectionObservers.delete(key);\n }\n };\n}\nfunction getIntersectionObserverKey(options) {\n if (!options) {\n return '';\n }\n return `${options.rootMargin}/${typeof options.threshold === 'number' ? options.threshold : options.threshold?.join('\\n')}`;\n}\n\nconst DEFER_BLOCK_SSR_ID_ATTRIBUTE = 'ngb';\nfunction setJSActionAttributes(nativeElement, eventTypes, parentDeferBlockId = null) {\n if (eventTypes.length === 0 || nativeElement.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n const existingAttr = nativeElement.getAttribute(Attribute$1.JSACTION);\n const parts = eventTypes.reduce((prev, curr) => {\n return (existingAttr?.indexOf(curr) ?? -1) === -1 ? prev + curr + ':;' : prev;\n }, '');\n nativeElement.setAttribute(Attribute$1.JSACTION, `${existingAttr ?? ''}${parts}`);\n const blockName = parentDeferBlockId ?? '';\n if (blockName !== '' && parts.length > 0) {\n nativeElement.setAttribute(DEFER_BLOCK_SSR_ID_ATTRIBUTE, blockName);\n }\n}\nconst sharedStashFunction = (rEl, eventType, listenerFn) => {\n const el = rEl;\n const eventListenerMap = el.__jsaction_fns ?? new Map();\n const eventListeners = eventListenerMap.get(eventType) ?? [];\n eventListeners.push(listenerFn);\n eventListenerMap.set(eventType, eventListeners);\n el.__jsaction_fns = eventListenerMap;\n};\nconst sharedMapFunction = (rEl, jsActionMap) => {\n const el = rEl;\n let blockName = el.getAttribute(DEFER_BLOCK_SSR_ID_ATTRIBUTE) ?? '';\n const blockSet = jsActionMap.get(blockName) ?? new Set();\n if (!blockSet.has(el)) {\n blockSet.add(el);\n }\n jsActionMap.set(blockName, blockSet);\n};\nfunction removeListenersFromBlocks(blockNames, jsActionMap) {\n if (blockNames.length > 0) {\n let blockList = [];\n for (let blockName of blockNames) {\n if (jsActionMap.has(blockName)) {\n blockList = [...blockList, ...jsActionMap.get(blockName)];\n }\n }\n const replayList = new Set(blockList);\n replayList.forEach(removeListeners);\n }\n}\nconst removeListeners = el => {\n el.removeAttribute(Attribute$1.JSACTION);\n el.removeAttribute(DEFER_BLOCK_SSR_ID_ATTRIBUTE);\n el.__jsaction_fns = undefined;\n};\nconst JSACTION_EVENT_CONTRACT = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'EVENT_CONTRACT_DETAILS' : '', {\n factory: () => ({})\n});\nconst handledEventElements = /*#__PURE__*/ new WeakMap();\nfunction markEventHandledForElement(event, element) {\n if (event == null || typeof event !== 'object') return;\n let elements = handledEventElements.get(event);\n if (!elements) {\n elements = new WeakSet();\n handledEventElements.set(event, elements);\n }\n elements.add(element);\n}\nfunction invokeListeners(event, currentTarget) {\n const handlerFns = currentTarget?.__jsaction_fns?.get(event.type);\n if (!handlerFns || !currentTarget?.isConnected) {\n return;\n }\n if (currentTarget && handledEventElements.get(event)?.has(currentTarget)) {\n return;\n }\n for (const handler of handlerFns) {\n handler(event);\n }\n}\nconst stashEventListeners = /*#__PURE__*/ new Map();\nfunction setStashFn(appId, fn) {\n stashEventListeners.set(appId, fn);\n return () => stashEventListeners.delete(appId);\n}\nlet isStashEventListenerImplEnabled = false;\nlet _stashEventListenerImpl = (lView, target, eventName, wrappedListener) => {};\nfunction stashEventListenerImpl(lView, target, eventName, wrappedListener) {\n _stashEventListenerImpl(lView, target, eventName, wrappedListener);\n}\nfunction enableStashEventListenerImpl() {\n if (!isStashEventListenerImplEnabled) {\n _stashEventListenerImpl = (lView, target, eventName, wrappedListener) => {\n const appId = lView[INJECTOR].get(APP_ID);\n const stashEventListener = stashEventListeners.get(appId);\n stashEventListener?.(target, eventName, wrappedListener);\n };\n isStashEventListenerImplEnabled = true;\n }\n}\n\nconst DEHYDRATED_BLOCK_REGISTRY = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'DEHYDRATED_BLOCK_REGISTRY' : '');\nlet DehydratedBlockRegistry = /*#__PURE__*/ (() => {\nclass DehydratedBlockRegistry {\n registry = new Map();\n cleanupFns = new Map();\n jsActionMap = inject(JSACTION_BLOCK_ELEMENT_MAP);\n contract = inject(JSACTION_EVENT_CONTRACT);\n add(blockId, info) {\n this.registry.set(blockId, info);\n if (this.awaitingCallbacks.has(blockId)) {\n const awaitingCallbacks = this.awaitingCallbacks.get(blockId);\n for (const cb of awaitingCallbacks) {\n cb();\n }\n }\n }\n get(blockId) {\n return this.registry.get(blockId) ?? null;\n }\n has(blockId) {\n return this.registry.has(blockId);\n }\n cleanup(hydratedBlocks) {\n removeListenersFromBlocks(hydratedBlocks, this.jsActionMap);\n for (let blockId of hydratedBlocks) {\n this.registry.delete(blockId);\n this.jsActionMap.delete(blockId);\n this.invokeTriggerCleanupFns(blockId);\n this.hydrating.delete(blockId);\n this.awaitingCallbacks.delete(blockId);\n }\n if (this.size === 0) {\n this.contract.instance?.cleanUp();\n }\n }\n get size() {\n return this.registry.size;\n }\n addCleanupFn(blockId, fn) {\n let cleanupFunctions = [];\n if (this.cleanupFns.has(blockId)) {\n cleanupFunctions = this.cleanupFns.get(blockId);\n }\n cleanupFunctions.push(fn);\n this.cleanupFns.set(blockId, cleanupFunctions);\n }\n invokeTriggerCleanupFns(blockId) {\n const fns = this.cleanupFns.get(blockId) ?? [];\n for (let fn of fns) {\n fn();\n }\n this.cleanupFns.delete(blockId);\n }\n hydrating = new Map();\n awaitingCallbacks = new Map();\n awaitParentBlock(topmostParentBlock, callback) {\n const parentBlockAwaitCallbacks = this.awaitingCallbacks.get(topmostParentBlock) ?? [];\n parentBlockAwaitCallbacks.push(callback);\n this.awaitingCallbacks.set(topmostParentBlock, parentBlockAwaitCallbacks);\n }\n static ษตprov =\n /* @__PURE__ */\n __defineInjectable({\n token: DehydratedBlockRegistry,\n providedIn: null,\n factory: () => new DehydratedBlockRegistry()\n });\n}\nreturn DehydratedBlockRegistry;\n})();\n\nfunction isDetachedByI18n(tNode) {\n return (tNode.flags & 32) === 32;\n}\n\nconst TRANSFER_STATE_TOKEN_ID = '__nghData__';\nconst NGH_DATA_KEY = /*#__PURE__*/ makeStateKey(TRANSFER_STATE_TOKEN_ID);\nconst TRANSFER_STATE_DEFER_BLOCKS_INFO = '__nghDeferData__';\nconst NGH_DEFER_BLOCKS_KEY = /*#__PURE__*/ makeStateKey(TRANSFER_STATE_DEFER_BLOCKS_INFO);\nfunction isInternalHydrationTransferStateKey(key) {\n return key === TRANSFER_STATE_TOKEN_ID || key === TRANSFER_STATE_DEFER_BLOCKS_INFO;\n}\nconst NGH_ATTR_NAME = 'ngh';\nconst SSR_CONTENT_INTEGRITY_MARKER = 'nghm';\nlet _retrieveHydrationInfoImpl = () => null;\nfunction retrieveHydrationInfoImpl(rNode, injector, isRootView = false) {\n let nghAttrValue = rNode.getAttribute(NGH_ATTR_NAME);\n if (nghAttrValue == null) return null;\n const [componentViewNgh, rootViewNgh] = nghAttrValue.split('|');\n nghAttrValue = isRootView ? rootViewNgh : componentViewNgh;\n if (!nghAttrValue) return null;\n const rootNgh = rootViewNgh ? `|${rootViewNgh}` : '';\n const remainingNgh = isRootView ? componentViewNgh : rootNgh;\n let data = {};\n if (nghAttrValue !== '') {\n const transferState = injector.get(TransferState, null, {\n optional: true\n });\n if (transferState !== null) {\n const nghData = transferState.get(NGH_DATA_KEY, []);\n data = nghData[Number(nghAttrValue)];\n ngDevMode && assertDefined(data, 'Unable to retrieve hydration info from the TransferState.');\n }\n }\n const dehydratedView = {\n data,\n firstChild: rNode.firstChild ?? null\n };\n if (isRootView) {\n dehydratedView.firstChild = rNode;\n setSegmentHead(dehydratedView, 0, rNode.nextSibling);\n }\n if (remainingNgh) {\n rNode.setAttribute(NGH_ATTR_NAME, remainingNgh);\n } else {\n rNode.removeAttribute(NGH_ATTR_NAME);\n }\n ngDevMode && markRNodeAsClaimedByHydration(rNode, false);\n ngDevMode && ngDevMode.hydratedComponents++;\n return dehydratedView;\n}\nfunction enableRetrieveHydrationInfoImpl() {\n _retrieveHydrationInfoImpl = retrieveHydrationInfoImpl;\n}\nfunction retrieveHydrationInfo(rNode, injector, isRootView = false) {\n return _retrieveHydrationInfoImpl(rNode, injector, isRootView);\n}\nfunction getLNodeForHydration(viewRef) {\n let lView = viewRef._lView;\n const tView = lView[TVIEW$1];\n if (tView.type === 2) {\n return null;\n }\n if (isRootView(lView)) {\n lView = lView[HEADER_OFFSET];\n }\n return lView;\n}\nfunction getTextNodeContent(node) {\n return node.textContent?.replace(/\\s/gm, '');\n}\nfunction processTextNodeMarkersBeforeHydration(node) {\n const doc = getDocument();\n const commentNodesIterator = doc.createNodeIterator(node, NodeFilter.SHOW_COMMENT, {\n acceptNode(node) {\n const content = getTextNodeContent(node);\n const isTextNodeMarker = content === \"ngetn\" || content === \"ngtns\";\n return isTextNodeMarker ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;\n }\n });\n let currentNode;\n const nodes = [];\n while (currentNode = commentNodesIterator.nextNode()) {\n nodes.push(currentNode);\n }\n for (const node of nodes) {\n if (node.textContent === \"ngetn\") {\n node.replaceWith(doc.createTextNode(''));\n } else {\n node.remove();\n }\n }\n}\nvar HydrationStatus = /*#__PURE__*/ (function (HydrationStatus) {\n HydrationStatus[\"Hydrated\"] = \"hydrated\";\n HydrationStatus[\"Skipped\"] = \"skipped\";\n HydrationStatus[\"Mismatched\"] = \"mismatched\";\n; return HydrationStatus;})(HydrationStatus || {});\n\nconst HYDRATION_INFO_KEY = '__ngDebugHydrationInfo__';\nfunction patchHydrationInfo(node, info) {\n node[HYDRATION_INFO_KEY] = info;\n}\nfunction readHydrationInfo(node) {\n return node[HYDRATION_INFO_KEY] ?? null;\n}\nfunction markRNodeAsClaimedByHydration(node, checkIfAlreadyClaimed = true) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsClaimedByHydration` in prod mode ' + 'is not supported and likely a mistake.');\n }\n if (checkIfAlreadyClaimed && isRNodeClaimedForHydration(node)) {\n throw new Error('Trying to claim a node, which was claimed already.');\n }\n patchHydrationInfo(node, {\n status: HydrationStatus.Hydrated\n });\n ngDevMode.hydratedNodes++;\n}\nfunction markRNodeAsSkippedByHydration(node) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsSkippedByHydration` in prod mode ' + 'is not supported and likely a mistake.');\n }\n patchHydrationInfo(node, {\n status: HydrationStatus.Skipped\n });\n ngDevMode.componentsSkippedHydration++;\n}\nfunction countBlocksSkippedByHydration(injector) {\n const transferState = injector.get(TransferState);\n const nghDeferData = transferState.get(NGH_DEFER_BLOCKS_KEY, {});\n if (ngDevMode) {\n ngDevMode.deferBlocksWithIncrementalHydration = Object.keys(nghDeferData).length;\n }\n}\nfunction markRNodeAsHavingHydrationMismatch(node, expectedNodeDetails = null, actualNodeDetails = null) {\n if (!ngDevMode) {\n throw new Error('Calling `markRNodeAsMismatchedByHydration` in prod mode ' + 'is not supported and likely a mistake.');\n }\n while (node && !getComponent(node)) {\n node = node?.parentNode;\n }\n if (node) {\n patchHydrationInfo(node, {\n status: HydrationStatus.Mismatched,\n expectedNodeDetails,\n actualNodeDetails\n });\n }\n}\nfunction isRNodeClaimedForHydration(node) {\n return readHydrationInfo(node)?.status === HydrationStatus.Hydrated;\n}\nfunction setSegmentHead(hydrationInfo, index, node) {\n hydrationInfo.segmentHeads ??= {};\n hydrationInfo.segmentHeads[index] = node;\n}\nfunction getSegmentHead(hydrationInfo, index) {\n return hydrationInfo.segmentHeads?.[index] ?? null;\n}\nfunction isIncrementalHydrationEnabled(injector) {\n return injector.get(IS_INCREMENTAL_HYDRATION_ENABLED, false, {\n optional: true\n });\n}\nlet incrementalHydrationEnabledWarned = false;\nfunction resetIncrementalHydrationEnabledWarnedForTests() {\n incrementalHydrationEnabledWarned = false;\n}\nfunction warnIncrementalHydrationNotConfigured() {\n if (!incrementalHydrationEnabledWarned) {\n incrementalHydrationEnabledWarned = true;\n console.warn(formatRuntimeError(508, 'Angular has detected that some `@defer` blocks use `hydrate` triggers, ' + 'but incremental hydration was not enabled. Incremental hydration is enabled by default ' + 'with `provideClientHydration()`. Make sure `provideClientHydration()` is included in ' + 'your application config and that you have not opted out using `withNoIncrementalHydration()`.'));\n }\n}\nfunction assertSsrIdDefined(ssrUniqueId) {\n assertDefined(ssrUniqueId, 'Internal error: expecting an SSR id for a defer block that should be hydrated, but the id is not present');\n}\nfunction getNgContainerSize(hydrationInfo, index) {\n const data = hydrationInfo.data;\n let size = data[ELEMENT_CONTAINERS]?.[index] ?? null;\n if (size === null && data[CONTAINERS]?.[index]) {\n size = calcSerializedContainerSize(hydrationInfo, index);\n }\n return size;\n}\nfunction isSerializedElementContainer(hydrationInfo, index) {\n return hydrationInfo.data[ELEMENT_CONTAINERS]?.[index] !== undefined;\n}\nfunction getSerializedContainerViews(hydrationInfo, index) {\n return hydrationInfo.data[CONTAINERS]?.[index] ?? null;\n}\nfunction calcSerializedContainerSize(hydrationInfo, index) {\n const views = getSerializedContainerViews(hydrationInfo, index) ?? [];\n let numNodes = 0;\n for (let view of views) {\n numNodes += view[NUM_ROOT_NODES] * (view[MULTIPLIER] ?? 1);\n }\n return numNodes;\n}\nfunction initDisconnectedNodes(hydrationInfo) {\n if (typeof hydrationInfo.disconnectedNodes === 'undefined') {\n const nodeIds = hydrationInfo.data[DISCONNECTED_NODES];\n hydrationInfo.disconnectedNodes = nodeIds ? new Set(nodeIds) : null;\n }\n return hydrationInfo.disconnectedNodes;\n}\nfunction isDisconnectedNode$1(hydrationInfo, index) {\n if (typeof hydrationInfo.disconnectedNodes === 'undefined') {\n const nodeIds = hydrationInfo.data[DISCONNECTED_NODES];\n hydrationInfo.disconnectedNodes = nodeIds ? new Set(nodeIds) : null;\n }\n return !!initDisconnectedNodes(hydrationInfo)?.has(index);\n}\nfunction canHydrateNode(lView, tNode) {\n const hydrationInfo = lView[HYDRATION];\n return hydrationInfo !== null && !isInSkipHydrationBlock$1() && !isDetachedByI18n(tNode) && !isDisconnectedNode$1(hydrationInfo, tNode.index - HEADER_OFFSET);\n}\nfunction processTextNodeBeforeSerialization(context, node) {\n const el = node;\n const corruptedTextNodes = context.corruptedTextNodes;\n if (el.textContent === '') {\n corruptedTextNodes.set(el, \"ngetn\");\n } else if (el.nextSibling?.nodeType === Node.TEXT_NODE) {\n corruptedTextNodes.set(el, \"ngtns\");\n }\n}\nfunction convertHydrateTriggersToJsAction(triggers) {\n let actionList = [];\n if (triggers !== null) {\n if (triggers.has(4)) {\n actionList.push(...hoverEventNames);\n }\n if (triggers.has(3)) {\n actionList.push(...interactionEventNames);\n }\n }\n return actionList;\n}\nfunction getParentBlockHydrationQueue(deferBlockId, injector) {\n const dehydratedBlockRegistry = injector.get(DEHYDRATED_BLOCK_REGISTRY);\n const transferState = injector.get(TransferState);\n const deferBlockParents = transferState.get(NGH_DEFER_BLOCKS_KEY, {});\n let isTopMostDeferBlock = false;\n let currentBlockId = deferBlockId;\n let parentBlockPromise = null;\n const hydrationQueue = [];\n while (!isTopMostDeferBlock && currentBlockId) {\n ngDevMode && assertEqual(hydrationQueue.indexOf(currentBlockId), -1, 'Internal error: defer block hierarchy has a cycle.');\n isTopMostDeferBlock = dehydratedBlockRegistry.has(currentBlockId);\n const hydratingParentBlock = dehydratedBlockRegistry.hydrating.get(currentBlockId);\n if (parentBlockPromise === null && hydratingParentBlock != null) {\n parentBlockPromise = hydratingParentBlock.promise;\n break;\n }\n hydrationQueue.unshift(currentBlockId);\n currentBlockId = deferBlockParents[currentBlockId][DEFER_PARENT_BLOCK_ID];\n }\n return {\n parentBlockPromise,\n hydrationQueue\n };\n}\nfunction gatherDeferBlocksByJSActionAttribute(doc) {\n const jsactionNodes = doc.body.querySelectorAll('[jsaction]');\n const blockMap = new Set();\n const eventTypes = [hoverEventNames.join(':;'), interactionEventNames.join(':;')].join('|');\n for (let node of jsactionNodes) {\n const attr = node.getAttribute('jsaction');\n const blockId = node.getAttribute('ngb');\n if (attr?.match(eventTypes) && blockId !== null) {\n blockMap.add(node);\n }\n }\n return blockMap;\n}\nfunction appendDeferBlocksToJSActionMap(doc, injector) {\n const blockMap = gatherDeferBlocksByJSActionAttribute(doc);\n const jsActionMap = injector.get(JSACTION_BLOCK_ELEMENT_MAP);\n for (let rNode of blockMap) {\n sharedMapFunction(rNode, jsActionMap);\n }\n}\nlet _retrieveDeferBlockDataImpl = () => {\n return {};\n};\nfunction retrieveDeferBlockDataImpl(injector) {\n const transferState = injector.get(TransferState, null, {\n optional: true\n });\n if (transferState !== null) {\n const nghDeferData = transferState.get(NGH_DEFER_BLOCKS_KEY, {});\n ngDevMode && assertDefined(nghDeferData, 'Unable to retrieve defer block info from the TransferState.');\n return nghDeferData;\n }\n return {};\n}\nfunction enableRetrieveDeferBlockDataImpl() {\n _retrieveDeferBlockDataImpl = retrieveDeferBlockDataImpl;\n}\nfunction retrieveDeferBlockData(injector) {\n return _retrieveDeferBlockDataImpl(injector);\n}\nfunction isTimerTrigger(triggerInfo) {\n return typeof triggerInfo === 'object' && triggerInfo.trigger === 5;\n}\nfunction getHydrateTimerTrigger(blockData) {\n const trigger = blockData[DEFER_HYDRATE_TRIGGERS]?.find(t => isTimerTrigger(t));\n return trigger?.delay ?? null;\n}\nfunction getHydrateViewportTrigger(blockData) {\n const details = blockData[DEFER_HYDRATE_TRIGGERS];\n if (details) {\n for (const current of details) {\n if (current === 2) {\n return true;\n } else if (typeof current === 'object' && current.trigger === 2) {\n return current.intersectionObserverOptions || true;\n }\n }\n }\n return null;\n}\nfunction hasHydrateTrigger(blockData, trigger) {\n return blockData[DEFER_HYDRATE_TRIGGERS]?.includes(trigger) ?? false;\n}\nfunction createBlockSummary(blockInfo) {\n return {\n data: blockInfo,\n hydrate: {\n idle: hasHydrateTrigger(blockInfo, 0),\n immediate: hasHydrateTrigger(blockInfo, 1),\n timer: getHydrateTimerTrigger(blockInfo),\n viewport: getHydrateViewportTrigger(blockInfo)\n }\n };\n}\nfunction processBlockData(injector) {\n const blockData = retrieveDeferBlockData(injector);\n let blockDetails = new Map();\n for (let blockId in blockData) {\n blockDetails.set(blockId, createBlockSummary(blockData[blockId]));\n }\n return blockDetails;\n}\nfunction isSsrContentsIntegrity(node) {\n return !!node && node.nodeType === Node.COMMENT_NODE && node.textContent?.trim() === SSR_CONTENT_INTEGRITY_MARKER;\n}\nfunction skipTextNodes(node) {\n while (node && node.nodeType === Node.TEXT_NODE) {\n node = node.previousSibling;\n }\n return node;\n}\nfunction verifySsrContentsIntegrity(doc) {\n for (const node of doc.body.childNodes) {\n if (isSsrContentsIntegrity(node)) {\n return;\n }\n }\n const beforeBody = skipTextNodes(doc.body.previousSibling);\n if (isSsrContentsIntegrity(beforeBody)) {\n return;\n }\n let endOfHead = skipTextNodes(doc.head.lastChild);\n if (isSsrContentsIntegrity(endOfHead)) {\n return;\n }\n throw new RuntimeError(-507, typeof ngDevMode !== 'undefined' && ngDevMode && 'Angular hydration logic detected that HTML content of this page was modified after it ' + 'was produced during server side rendering. Make sure that there are no optimizations ' + 'that remove comment nodes from HTML enabled on your CDN. Angular hydration ' + 'relies on HTML produced by the server, including whitespaces and comment nodes.');\n}\n\nfunction refreshContentQueries(tView, lView) {\n const contentQueries = tView.contentQueries;\n if (contentQueries !== null) {\n const prevConsumer = setActiveConsumer(null);\n try {\n for (let i = 0; i < contentQueries.length; i += 2) {\n const queryStartIdx = contentQueries[i];\n const directiveDefIdx = contentQueries[i + 1];\n if (directiveDefIdx !== -1) {\n const directiveDef = tView.data[directiveDefIdx];\n ngDevMode && assertDefined(directiveDef, 'DirectiveDef not found.');\n ngDevMode && assertDefined(directiveDef.contentQueries, 'contentQueries function should be defined');\n setCurrentQueryIndex(queryStartIdx);\n directiveDef.contentQueries(2, lView[directiveDefIdx], directiveDefIdx);\n }\n }\n } finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\nfunction executeViewQueryFn(flags, viewQueryFn, component) {\n ngDevMode && assertDefined(viewQueryFn, 'View queries function to execute must be defined.');\n setCurrentQueryIndex(0);\n const prevConsumer = setActiveConsumer(null);\n try {\n viewQueryFn(flags, component);\n } finally {\n setActiveConsumer(prevConsumer);\n }\n}\nfunction executeContentQueries(tView, tNode, lView) {\n if (isContentQueryHost(tNode)) {\n const prevConsumer = setActiveConsumer(null);\n try {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n for (let directiveIndex = start; directiveIndex < end; directiveIndex++) {\n const def = tView.data[directiveIndex];\n if (def.contentQueries) {\n const directiveInstance = lView[directiveIndex];\n ngDevMode && assertDefined(directiveIndex, 'Incorrect reference to a directive defining a content query');\n def.contentQueries(1, directiveInstance, directiveIndex);\n }\n }\n } finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\n\nvar ViewEncapsulation = /*#__PURE__*/ (function (ViewEncapsulation) {\n ViewEncapsulation[ViewEncapsulation[\"Emulated\"] = 0] = \"Emulated\";\n ViewEncapsulation[ViewEncapsulation[\"None\"] = 2] = \"None\";\n ViewEncapsulation[ViewEncapsulation[\"ShadowDom\"] = 3] = \"ShadowDom\";\n ViewEncapsulation[ViewEncapsulation[\"ExperimentalIsolatedShadowDom\"] = 4] = \"ExperimentalIsolatedShadowDom\";\n; return ViewEncapsulation;})(ViewEncapsulation || {});\n\n\nclass SafeValueImpl {\n changingThisBreaksApplicationSecurity;\n constructor(changingThisBreaksApplicationSecurity) {\n this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;\n }\n toString() {\n return `SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` + (ngDevMode ? ` (see ${XSS_SECURITY_URL})` : '');\n }\n}\nclass SafeHtmlImpl extends SafeValueImpl {\n getTypeName() {\n return \"HTML\";\n }\n}\nclass SafeStyleImpl extends SafeValueImpl {\n getTypeName() {\n return \"Style\";\n }\n}\nclass SafeScriptImpl extends SafeValueImpl {\n getTypeName() {\n return \"Script\";\n }\n}\nclass SafeUrlImpl extends SafeValueImpl {\n getTypeName() {\n return \"URL\";\n }\n}\nclass SafeResourceUrlImpl extends SafeValueImpl {\n getTypeName() {\n return \"ResourceURL\";\n }\n}\nfunction unwrapSafeValue(value) {\n return value instanceof SafeValueImpl ? value.changingThisBreaksApplicationSecurity : value;\n}\nfunction allowSanitizationBypassAndThrow(value, type) {\n const actualType = getSanitizationBypassType(value);\n if (actualType != null && actualType !== type) {\n if (actualType === \"ResourceURL\" && type === \"URL\") return true;\n throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`);\n }\n return actualType === type;\n}\nfunction getSanitizationBypassType(value) {\n return value instanceof SafeValueImpl && value.getTypeName() || null;\n}\nfunction bypassSanitizationTrustHtml(trustedHtml) {\n return new SafeHtmlImpl(trustedHtml);\n}\nfunction bypassSanitizationTrustStyle(trustedStyle) {\n return new SafeStyleImpl(trustedStyle);\n}\nfunction bypassSanitizationTrustScript(trustedScript) {\n return new SafeScriptImpl(trustedScript);\n}\nfunction bypassSanitizationTrustUrl(trustedUrl) {\n return new SafeUrlImpl(trustedUrl);\n}\nfunction bypassSanitizationTrustResourceUrl(trustedResourceUrl) {\n return new SafeResourceUrlImpl(trustedResourceUrl);\n}\n\nconst CUSTOM_ELEMENTS_SCHEMA = {\n name: 'custom-elements'\n};\nconst NO_ERRORS_SCHEMA = {\n name: 'no-errors-schema'\n};\n\nlet shouldThrowErrorOnUnknownElement = false;\nfunction ษตsetUnknownElementStrictMode(shouldThrow) {\n shouldThrowErrorOnUnknownElement = shouldThrow;\n}\nfunction ษตgetUnknownElementStrictMode() {\n return shouldThrowErrorOnUnknownElement;\n}\nlet shouldThrowErrorOnUnknownProperty = false;\nfunction ษตsetUnknownPropertyStrictMode(shouldThrow) {\n shouldThrowErrorOnUnknownProperty = shouldThrow;\n}\nfunction ษตgetUnknownPropertyStrictMode() {\n return shouldThrowErrorOnUnknownProperty;\n}\nfunction validateElementIsKnown(lView, tNode) {\n const tView = lView[TVIEW$1];\n if (tView.schemas === null) return;\n const tagName = tNode.value;\n if (!isDirectiveHost(tNode) && tagName !== null) {\n const isUnknown = typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement && getNativeByTNode(tNode, lView) instanceof HTMLUnknownElement || typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 && !customElements.get(tagName);\n if (isUnknown && !matchingSchemas(tView.schemas, tagName)) {\n const isHostStandalone = isHostComponentStandalone(lView);\n const templateLocation = getTemplateLocationDetails(lView);\n const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;\n let message = `'${tagName}' is not a known element${templateLocation}:\\n`;\n message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone ? \"included in the '@Component.imports' of this component\" : 'a part of an @NgModule where this component is declared'}.\\n`;\n if (tagName && tagName.indexOf('-') > -1) {\n message += `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;\n } else {\n message += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;\n }\n if (shouldThrowErrorOnUnknownElement) {\n throw new RuntimeError(304, message);\n } else {\n console.error(formatRuntimeError(304, message));\n }\n }\n }\n}\nfunction isPropertyValid(element, propName, tagName, schemas) {\n if (schemas === null) return true;\n if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {\n return true;\n }\n return typeof Node === 'undefined' || Node === null || !(element instanceof Node);\n}\nfunction handleUnknownPropertyError(propName, tagName, nodeType, lView) {\n if (!tagName && nodeType === 4) {\n tagName = 'ng-template';\n }\n const isHostStandalone = isHostComponentStandalone(lView);\n const templateLocation = getTemplateLocationDetails(lView);\n let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;\n const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;\n const importLocation = isHostStandalone ? \"included in the '@Component.imports' of this component\" : 'a part of an @NgModule where this component is declared';\n if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {\n const correspondingImport = KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName);\n message += `\\nIf the '${propName}' is an Angular control flow directive, ` + `please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`;\n } else {\n message += `\\n1. If '${tagName}' is an Angular component and it has the ` + `'${propName}' input, then verify that it is ${importLocation}.`;\n if (tagName && tagName.indexOf('-') > -1) {\n message += `\\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' ` + `to the ${schemas} of this component to suppress this message.`;\n message += `\\n3. To allow any property add 'NO_ERRORS_SCHEMA' to ` + `the ${schemas} of this component.`;\n } else {\n message += `\\n2. To allow any property add 'NO_ERRORS_SCHEMA' to ` + `the ${schemas} of this component.`;\n }\n }\n reportUnknownPropertyError(message);\n}\nfunction reportUnknownPropertyError(message) {\n if (shouldThrowErrorOnUnknownProperty) {\n throw new RuntimeError(303, message);\n } else {\n console.error(formatRuntimeError(303, message));\n }\n}\nfunction getDeclarationComponentDef(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const declarationLView = lView[DECLARATION_COMPONENT_VIEW];\n const context = declarationLView[CONTEXT];\n if (!context) return null;\n return context.constructor ? getComponentDef(context.constructor) : null;\n}\nfunction isHostComponentStandalone(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const componentDef = getDeclarationComponentDef(lView);\n return !!componentDef?.standalone;\n}\nfunction getTemplateLocationDetails(lView) {\n !ngDevMode && throwError('Must never be called in production mode');\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n return componentClassName ? ` (used in the '${componentClassName}' component template)` : '';\n}\nconst KNOWN_CONTROL_FLOW_DIRECTIVES = /*#__PURE__*/ new Map([['ngIf', 'NgIf'], ['ngFor', 'NgFor'], ['ngSwitchCase', 'NgSwitchCase'], ['ngSwitchDefault', 'NgSwitchDefault']]);\nfunction matchingSchemas(schemas, tagName) {\n if (schemas !== null) {\n for (let i = 0; i < schemas.length; i++) {\n const schema = schemas[i];\n if (schema === NO_ERRORS_SCHEMA || schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1) {\n return true;\n }\n }\n }\n return false;\n}\n\nconst NAMESPACE_URIS = {\n 'http://www.w3.org/2000/svg': SVG_NAMESPACE,\n 'http://www.w3.org/1998/Math/MathML': MATH_ML_NAMESPACE\n};\n\nlet policy$1;\nfunction getPolicy$1() {\n if (policy$1 === undefined) {\n policy$1 = null;\n if (_global.trustedTypes) {\n try {\n policy$1 = _global.trustedTypes.createPolicy('angular', {\n createHTML: s => s,\n createScript: s => s,\n createScriptURL: s => s\n });\n } catch {}\n }\n }\n return policy$1;\n}\nfunction trustedHTMLFromString(html) {\n return getPolicy$1()?.createHTML(html) || html;\n}\nfunction trustedScriptURLFromString(url) {\n return getPolicy$1()?.createScriptURL(url) || url;\n}\n\nlet policy;\nfunction getPolicy() {\n if (policy === undefined) {\n policy = null;\n if (_global.trustedTypes) {\n try {\n policy = _global.trustedTypes.createPolicy('angular#unsafe-bypass', {\n createHTML: s => s,\n createScript: s => s,\n createScriptURL: s => s\n });\n } catch {}\n }\n }\n return policy;\n}\nfunction trustedHTMLFromStringBypass(html) {\n return getPolicy()?.createHTML(html) || html;\n}\nfunction trustedScriptFromStringBypass(script) {\n return getPolicy()?.createScript(script) || script;\n}\nfunction trustedScriptURLFromStringBypass(url) {\n return getPolicy()?.createScriptURL(url) || url;\n}\n\nfunction getInertBodyHelper(defaultDoc) {\n const inertDocumentHelper = new InertDocumentHelper(defaultDoc);\n return isDOMParserAvailable() ? new DOMParserHelper(inertDocumentHelper) : inertDocumentHelper;\n}\nclass DOMParserHelper {\n inertDocumentHelper;\n constructor(inertDocumentHelper) {\n this.inertDocumentHelper = inertDocumentHelper;\n }\n getInertBodyElement(html) {\n html = '' + html;\n try {\n const body = new window.DOMParser().parseFromString(trustedHTMLFromString(html), 'text/html').body;\n if (body === null) {\n return this.inertDocumentHelper.getInertBodyElement(html);\n }\n body.firstChild?.remove();\n return body;\n } catch {\n return null;\n }\n }\n}\nclass InertDocumentHelper {\n defaultDoc;\n inertDocument;\n constructor(defaultDoc) {\n this.defaultDoc = defaultDoc;\n this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');\n }\n getInertBodyElement(html) {\n const templateEl = this.inertDocument.createElement('template');\n templateEl.innerHTML = trustedHTMLFromString(html);\n return templateEl;\n }\n}\nfunction isDOMParserAvailable() {\n try {\n return !!new window.DOMParser().parseFromString(trustedHTMLFromString(''), 'text/html');\n } catch {\n return false;\n }\n}\n\nconst SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\\/?#]*(?:[\\/?#]|$))/i;\nfunction _sanitizeUrl(url) {\n url = String(url);\n if (url.match(SAFE_URL_PATTERN)) return url;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${XSS_SECURITY_URL})`);\n }\n return 'unsafe:' + url;\n}\n\nfunction tagSet(tags) {\n const res = Object.create(null);\n for (const t of tags.split(',')) res[t] = true;\n return res;\n}\nfunction merge(...sets) {\n const res = Object.create(null);\n for (const s of sets) {\n for (const v in s) {\n if (Object.hasOwn(s, v)) res[v] = true;\n }\n }\n return res;\n}\nconst VOID_ELEMENTS = /*#__PURE__*/ tagSet('area,br,col,hr,img,wbr');\nconst OPTIONAL_END_TAG_BLOCK_ELEMENTS = /*#__PURE__*/ tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');\nconst OPTIONAL_END_TAG_INLINE_ELEMENTS = /*#__PURE__*/ tagSet('rp,rt');\nconst OPTIONAL_END_TAG_ELEMENTS = /*#__PURE__*/ merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);\nconst BLOCK_ELEMENTS = /*#__PURE__*/ merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, /*#__PURE__*/ tagSet('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'));\nconst INLINE_ELEMENTS = /*#__PURE__*/ merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, /*#__PURE__*/ tagSet('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'));\nconst VALID_ELEMENTS = /*#__PURE__*/ merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);\nconst URI_ATTRS = /*#__PURE__*/ tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');\nconst HTML_ATTRS = /*#__PURE__*/ tagSet('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');\nconst ARIA_ATTRS = /*#__PURE__*/ tagSet('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');\nconst VALID_ATTRS = /*#__PURE__*/ merge(URI_ATTRS, HTML_ATTRS, ARIA_ATTRS);\nconst SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = /*#__PURE__*/ tagSet('script,style,template');\nclass SanitizingHtmlSerializer {\n sanitizedSomething = false;\n buf = [];\n sanitizeChildren(el) {\n let current = el.firstChild;\n let traverseContent = true;\n let parentNodes = [];\n while (current) {\n if (current.nodeType === Node.ELEMENT_NODE) {\n traverseContent = this.startElement(current);\n } else if (current.nodeType === Node.TEXT_NODE) {\n this.chars(current.nodeValue);\n } else {\n this.sanitizedSomething = true;\n }\n if (traverseContent && current.firstChild) {\n parentNodes.push(current);\n current = getFirstChild(current);\n continue;\n }\n while (current) {\n if (current.nodeType === Node.ELEMENT_NODE) {\n this.endElement(current);\n }\n let next = getNextSibling(current);\n if (next) {\n current = next;\n break;\n }\n current = parentNodes.pop();\n }\n }\n return this.buf.join('');\n }\n startElement(element) {\n const tagName = getNodeName(element).toLowerCase();\n if (!Object.hasOwn(VALID_ELEMENTS, tagName)) {\n this.sanitizedSomething = true;\n return !Object.hasOwn(SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS, tagName);\n }\n this.buf.push('<');\n this.buf.push(tagName);\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const elAttr = elAttrs.item(i);\n const attrName = elAttr.name;\n const lower = attrName.toLowerCase();\n if (!Object.hasOwn(VALID_ATTRS, lower)) {\n this.sanitizedSomething = true;\n continue;\n }\n let value = elAttr.value;\n if (URI_ATTRS[lower]) value = _sanitizeUrl(value);\n this.buf.push(' ', attrName, '=\"', encodeEntities(value), '\"');\n }\n this.buf.push('>');\n return true;\n }\n endElement(current) {\n const tagName = getNodeName(current).toLowerCase();\n if (Object.hasOwn(VALID_ELEMENTS, tagName) && !Object.hasOwn(VOID_ELEMENTS, tagName)) {\n this.buf.push('');\n }\n }\n chars(chars) {\n this.buf.push(encodeEntities(chars));\n }\n}\nfunction isClobberedElement(parentNode, childNode) {\n return (parentNode.compareDocumentPosition(childNode) & Node.DOCUMENT_POSITION_CONTAINED_BY) !== Node.DOCUMENT_POSITION_CONTAINED_BY;\n}\nfunction getNextSibling(node) {\n const nextSibling = node.nextSibling;\n if (nextSibling && node !== nextSibling.previousSibling) {\n throw clobberedElementError(nextSibling);\n }\n return nextSibling;\n}\nfunction getFirstChild(node) {\n const firstChild = node.firstChild;\n if (firstChild && isClobberedElement(node, firstChild)) {\n throw clobberedElementError(firstChild);\n }\n return firstChild;\n}\nfunction getNodeName(node) {\n const nodeName = node.nodeName;\n return typeof nodeName === 'string' ? nodeName : 'FORM';\n}\nfunction clobberedElementError(node) {\n return new Error(`Failed to sanitize html because the element is clobbered: ${node.outerHTML}`);\n}\nconst SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\nconst NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\nfunction encodeEntities(value) {\n return value.replace(/&/g, '&').replace(SURROGATE_PAIR_REGEXP, function (match) {\n const hi = match.charCodeAt(0);\n const low = match.charCodeAt(1);\n return '&#' + ((hi - 0xd800) * 0x400 + (low - 0xdc00) + 0x10000) + ';';\n }).replace(NON_ALPHANUMERIC_REGEXP, function (match) {\n return '&#' + match.charCodeAt(0) + ';';\n }).replace(//g, '>');\n}\nlet inertBodyHelper;\nfunction _sanitizeHtml(defaultDoc, unsafeHtmlInput) {\n let inertBodyElement = null;\n try {\n inertBodyHelper = inertBodyHelper || getInertBodyHelper(defaultDoc);\n let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n let mXSSAttempts = 5;\n let parsedHtml = unsafeHtml;\n do {\n if (mXSSAttempts === 0) {\n throw new Error('Failed to sanitize html because the input is unstable');\n }\n mXSSAttempts--;\n unsafeHtml = parsedHtml;\n parsedHtml = inertBodyElement.innerHTML;\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n } while (unsafeHtml !== parsedHtml);\n const sanitizer = new SanitizingHtmlSerializer();\n const safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement);\n if ((typeof ngDevMode === 'undefined' || ngDevMode) && sanitizer.sanitizedSomething) {\n console.warn(`WARNING: sanitizing HTML stripped some content, see ${XSS_SECURITY_URL}`);\n }\n return trustedHTMLFromString(safeHtml);\n } finally {\n if (inertBodyElement) {\n const parent = getTemplateContent(inertBodyElement) || inertBodyElement;\n while (parent.firstChild) {\n parent.firstChild.remove();\n }\n }\n }\n}\nfunction getTemplateContent(el) {\n return 'content' in el && isTemplateElement(el) ? el.content : null;\n}\nfunction isTemplateElement(el) {\n return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE';\n}\n\nconst COMMENT_DISALLOWED = /^>|^->||--!>|)/g;\nconst COMMENT_DELIMITER_ESCAPED = '\\u200B$1\\u200B';\nfunction escapeCommentText(value) {\n return value.replace(COMMENT_DISALLOWED, text => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));\n}\n\nfunction createTextNode(renderer, value) {\n return renderer.createText(value);\n}\nfunction updateTextNode(renderer, rNode, value) {\n renderer.setValue(rNode, value);\n}\nfunction createCommentNode(renderer, value) {\n return renderer.createComment(escapeCommentText(value));\n}\nfunction createElementNode(renderer, name, namespace) {\n return renderer.createElement(name, namespace);\n}\nfunction nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {\n renderer.insertBefore(parent, child, beforeNode, isMove);\n}\nfunction nativeAppendChild(renderer, parent, child) {\n ngDevMode && assertDefined(parent, 'parent node must be defined');\n renderer.appendChild(parent, child);\n}\nfunction nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {\n if (beforeNode !== null) {\n nativeInsertBefore(renderer, parent, child, beforeNode, isMove);\n } else {\n nativeAppendChild(renderer, parent, child);\n }\n}\nfunction nativeRemoveNode(renderer, rNode, isHostElement, requireSynchronousElementRemoval) {\n renderer.removeChild(null, rNode, isHostElement, requireSynchronousElementRemoval);\n}\nfunction clearElementContents(rElement) {\n rElement.textContent = '';\n}\nfunction writeDirectStyle(renderer, element, newValue) {\n ngDevMode && assertString(newValue, \"'newValue' should be a string\");\n renderer.setAttribute(element, 'style', newValue);\n}\nfunction writeDirectClass(renderer, element, newValue) {\n ngDevMode && assertString(newValue, \"'newValue' should be a string\");\n if (newValue === '') {\n renderer.removeAttribute(element, 'class');\n } else {\n renderer.setAttribute(element, 'class', newValue);\n }\n}\nfunction setupStaticAttributes(renderer, element, tNode) {\n const {\n mergedAttrs,\n classes,\n styles\n } = tNode;\n if (mergedAttrs !== null) {\n setUpAttributes(renderer, element, mergedAttrs);\n }\n if (classes !== null) {\n writeDirectClass(renderer, element, classes);\n }\n if (styles !== null) {\n writeDirectStyle(renderer, element, styles);\n }\n}\n\nfunction enforceIframeSecurity(iframe) {\n const lView = getLView();\n iframe.src = '';\n iframe.srcdoc = trustedHTMLFromString('');\n nativeRemoveNode(lView[RENDERER], iframe);\n}\n\nfunction splitNsName(elementName, fatal = true) {\n if (elementName[0] != ':') {\n return [null, elementName];\n }\n const colonIndex = elementName.indexOf(':', 1);\n if (colonIndex === -1) {\n if (fatal) {\n throw new Error(`Unsupported format \"${elementName}\" expecting \":namespace:name\"`);\n } else {\n return [null, elementName];\n }\n }\n return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];\n}\n\nfunction ษตษตsanitizeHtml(unsafeHtml, tagName, propName) {\n if (tagName !== undefined && propName !== undefined && getSecurityContext(tagName, propName) !== SecurityContext.HTML) {\n return unsafeHtml;\n }\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedHTMLFromStringBypass(sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeHtml, \"HTML\")) {\n return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml));\n }\n return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml));\n}\nfunction ษตษตsanitizeStyle(unsafeStyle) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || '';\n }\n if (allowSanitizationBypassAndThrow(unsafeStyle, \"Style\")) {\n return unwrapSafeValue(unsafeStyle);\n }\n return renderStringify(unsafeStyle);\n}\nfunction ษตษตsanitizeUrl(unsafeUrl) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || '';\n }\n if (allowSanitizationBypassAndThrow(unsafeUrl, \"URL\")) {\n return unwrapSafeValue(unsafeUrl);\n }\n return _sanitizeUrl(renderStringify(unsafeUrl));\n}\nfunction ษตษตsanitizeResourceUrl(unsafeResourceUrl) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedScriptURLFromStringBypass(sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeResourceUrl, \"ResourceURL\")) {\n return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));\n }\n throw new RuntimeError(-904, ngDevMode && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);\n}\nfunction ษตษตsanitizeScript(unsafeScript) {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return trustedScriptFromStringBypass(sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || '');\n }\n if (allowSanitizationBypassAndThrow(unsafeScript, \"Script\")) {\n return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));\n }\n throw new RuntimeError(905, ngDevMode && 'unsafe value used in a script context');\n}\nfunction ษตษตtrustConstantHtml(html) {\n if (ngDevMode && (!Array.isArray(html) || !Array.isArray(html.raw) || html.length !== 1)) {\n throw new Error(`Unexpected interpolation in trusted HTML constant: ${html.join('?')}`);\n }\n return trustedHTMLFromString(html[0]);\n}\nfunction ษตษตtrustConstantResourceUrl(url) {\n if (ngDevMode && (!Array.isArray(url) || !Array.isArray(url.raw) || url.length !== 1)) {\n throw new Error(`Unexpected interpolation in trusted URL constant: ${url.join('?')}`);\n }\n return trustedScriptURLFromString(url[0]);\n}\nfunction getUrlSanitizer(tag, prop) {\n switch (getSecurityContext(tag, prop)) {\n case SecurityContext.RESOURCE_URL:\n return ษตษตsanitizeResourceUrl;\n case SecurityContext.URL:\n return ษตษตsanitizeUrl;\n default:\n return null;\n }\n}\nfunction ษตษตsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {\n return getUrlSanitizer(tag, prop)?.(unsafeUrl) ?? unsafeUrl;\n}\nfunction validateAgainstEventProperties(name) {\n if (name.toLowerCase().startsWith('on')) {\n const errorMessage = `Binding to event property '${name}' is disallowed for security reasons, ` + `please use (${name.slice(2)})=...` + `\\nIf '${name}' is a directive input, make sure the directive is imported by the` + ` current module.`;\n throw new RuntimeError(306, errorMessage);\n }\n}\nfunction getSanitizer() {\n const lView = getLView();\n return lView && lView[ENVIRONMENT].sanitizer;\n}\nfunction getSecurityContext(tagName, propName) {\n const [namespace, resolvedTagName] = resolveElement(tagName);\n return checkSecurityContext(resolvedTagName, propName, namespace);\n}\nfunction resolveElement(tagName) {\n tagName = tagName.toLowerCase();\n const splitResult = splitNsName(tagName, false);\n if (splitResult[0]) {\n return splitResult;\n }\n const index = getSelectedIndex();\n const tNode = index === -1 ? null : getSelectedTNode();\n let namespace = tNode?.namespace;\n if (tagName === \"#host\" && tNode?.type === 2) {\n const element = getNativeByTNode(tNode, getLView());\n if (element.tagName) {\n tagName = element.tagName.toLowerCase();\n }\n if (namespace == null) {\n const namespaceURI = element.namespaceURI;\n namespace = namespaceURI && NAMESPACE_URIS[namespaceURI];\n }\n }\n return [namespace, tagName];\n}\nconst SECURITY_SENSITIVE_ATTRIBUTE_NAMES = /*#__PURE__*/ new Set(['href', 'xlink:href']);\nconst SVG_ANIMATION_SENSITIVE_STATIC_VALUES = {\n 'animate': {\n 'to': SECURITY_SENSITIVE_ATTRIBUTE_NAMES,\n 'values': SECURITY_SENSITIVE_ATTRIBUTE_NAMES,\n 'from': SECURITY_SENSITIVE_ATTRIBUTE_NAMES\n },\n 'set': {\n 'to': SECURITY_SENSITIVE_ATTRIBUTE_NAMES\n }\n};\nfunction ษตษตvalidateAttribute(value, tagName, attributeName) {\n const index = getSelectedIndex();\n const tNode = index === -1 ? null : getSelectedTNode();\n if (tNode && tNode.type !== 2) {\n return value;\n }\n const [namespace, resolvedTagName] = resolveElement(tagName);\n const securityContext = checkSecurityContext(resolvedTagName, attributeName, namespace);\n if (securityContext !== SecurityContext.ATTRIBUTE_NO_BINDING) {\n return value;\n }\n const lView = getLView();\n if (tNode) {\n if (resolvedTagName === 'iframe') {\n const element = getNativeByTNode(tNode, lView);\n enforceIframeSecurity(element);\n } else if (namespace === SVG_NAMESPACE || !namespace) {\n const config = SVG_ANIMATION_SENSITIVE_STATIC_VALUES[resolvedTagName]?.[attributeName.toLowerCase()];\n if (config) {\n const element = getNativeByTNode(tNode, lView);\n const attributeNameValue = getSecuritySensitiveSVGAnimationAttributeName(element, config);\n if (attributeNameValue) {\n const errorMessage = ngDevMode && `Angular has detected that the \\`${attributeName}\\` was applied ` + `as a binding to the <${resolvedTagName}> element${getTemplateLocationDetails(lView)}. ` + `For security reasons, the \\`${attributeName}\\` can be set on the <${resolvedTagName}> element ` + `as a static attribute only when the \"attributeName\" is set to \\'${attributeNameValue}\\'. \\n` + `To fix this, switch the \\`${attributeNameValue}\\` binding to a static attribute ` + `in a template or in host bindings section.`;\n throw new RuntimeError(-910, errorMessage);\n }\n return value;\n }\n }\n }\n const errorMessage = ngDevMode && `Angular has detected that the \\`${attributeName}\\` was applied ` + `as a binding to the <${resolvedTagName}> element${tNode ? getTemplateLocationDetails(lView) : ''}. ` + `For security reasons, the \\`${attributeName}\\` can be set on the <${resolvedTagName}> element ` + `as a static attribute only. \\n` + `To fix this, switch the \\`${attributeName}\\` binding to a static attribute ` + `in a template or in host bindings section.`;\n throw new RuntimeError(-910, errorMessage);\n}\nfunction getSecuritySensitiveSVGAnimationAttributeName(element, validationConfig) {\n for (const attributeName of element.getAttributeNames()) {\n if (attributeName.toLowerCase() !== 'attributename') {\n continue;\n }\n const attributeNameValue = element.getAttribute(attributeName);\n if (attributeNameValue !== null && validationConfig.has(attributeNameValue.toLowerCase())) {\n return attributeNameValue;\n }\n }\n return null;\n}\n\nconst NG_REFLECT_ATTRS_FLAG_DEFAULT = false;\nconst NG_REFLECT_ATTRS_FLAG = /*#__PURE__*/ new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'NG_REFLECT_FLAG' : '', {\n factory: () => NG_REFLECT_ATTRS_FLAG_DEFAULT\n});\nfunction provideNgReflectAttributes() {\n const providers = typeof ngDevMode === 'undefined' || ngDevMode ? [{\n provide: NG_REFLECT_ATTRS_FLAG,\n useValue: true\n }] : [];\n return makeEnvironmentProviders(providers);\n}\nfunction normalizeDebugBindingName(name) {\n name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));\n return `ng-reflect-${name}`;\n}\nconst CAMEL_CASE_REGEXP = /([A-Z])/g;\nfunction camelCaseToDashCase(input) {\n return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());\n}\nfunction normalizeDebugBindingValue(value) {\n try {\n return value != null ? value.toString().slice(0, 30) : value;\n } catch (e) {\n return '[ERROR] Exception while trying to serialize the value';\n }\n}\n\nfunction ษตษตresolveWindow(element) {\n return element.ownerDocument.defaultView;\n}\nfunction ษตษตresolveDocument(element) {\n return element.ownerDocument;\n}\nfunction ษตษตresolveBody(element) {\n return element.ownerDocument.body;\n}\nconst INTERPOLATION_DELIMITER = `๏ฟฝ`;\nfunction maybeUnwrapFn(value) {\n if (value instanceof Function) {\n return value();\n } else {\n return value;\n }\n}\n\nconst VALUE_STRING_LENGTH_LIMIT = 200;\nfunction assertStandaloneComponentType(type) {\n assertComponentDef(type);\n const componentDef = getComponentDef(type);\n if (!componentDef.standalone) {\n throw new RuntimeError(907, `The ${stringifyForError(type)} component is not marked as standalone, ` + `but Angular expects to have a standalone component here. ` + `Please make sure the ${stringifyForError(type)} component does not have ` + `the \\`standalone: false\\` flag in the decorator.`);\n }\n}\nfunction assertComponentDef(type) {\n if (!getComponentDef(type)) {\n throw new RuntimeError(906, `The ${stringifyForError(type)} is not an Angular component, ` + `make sure it has the \\`@Component\\` decorator.`);\n }\n}\nfunction throwMultipleComponentError(tNode, first, second) {\n throw new RuntimeError(-300, `Multiple components match node with tagname ${tNode.value}: ` + `${stringifyForError(first)} and ` + `${stringifyForError(second)}`);\n}\nfunction throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName, lView) {\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n const field = propName ? ` for '${propName}'` : '';\n let msg = `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value${field}: '${formatValue(oldValue)}'. Current value: '${formatValue(currValue)}'.${componentClassName ? ` Expression location: ${componentClassName} component` : ''}`;\n if (creationMode) {\n msg += ` It seems like the view has been created after its parent and its children have been dirty checked.` + ` Has it been created in a change detection hook?`;\n }\n throw new RuntimeError(-100, msg);\n}\nfunction formatValue(value) {\n let strValue = String(value);\n try {\n if (Array.isArray(value) || strValue === '[object Object]') {\n strValue = JSON.stringify(value);\n }\n } catch (error) {}\n return strValue.length > VALUE_STRING_LENGTH_LIMIT ? strValue.substring(0, VALUE_STRING_LENGTH_LIMIT) + 'โ€ฆ' : strValue;\n}\nfunction constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) {\n const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER);\n let oldValue = prefix,\n newValue = prefix;\n for (let i = 0; i < chunks.length; i++) {\n const slotIdx = rootIndex + i;\n oldValue += `${lView[slotIdx]}${chunks[i]}`;\n newValue += `${slotIdx === expressionIndex ? changedValue : lView[slotIdx]}${chunks[i]}`;\n }\n return {\n propName,\n oldValue,\n newValue\n };\n}\nfunction getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValue) {\n const tData = lView[TVIEW$1].data;\n const metadata = tData[bindingIndex];\n if (typeof metadata === 'string') {\n if (metadata.indexOf(INTERPOLATION_DELIMITER) > -1) {\n return constructDetailsForInterpolation(lView, bindingIndex, bindingIndex, metadata, newValue);\n }\n return {\n propName: metadata,\n oldValue,\n newValue\n };\n }\n if (metadata === null) {\n let idx = bindingIndex - 1;\n while (typeof tData[idx] !== 'string' && tData[idx + 1] === null) {\n idx--;\n }\n const meta = tData[idx];\n if (typeof meta === 'string') {\n const matches = meta.match(new RegExp(INTERPOLATION_DELIMITER, 'g'));\n if (matches && matches.length - 1 > bindingIndex - idx) {\n return constructDetailsForInterpolation(lView, idx, bindingIndex, meta, newValue);\n }\n }\n }\n return {\n propName: undefined,\n oldValue,\n newValue\n };\n}\n\nfunction classIndexOf(className, classToSearch, startingIndex) {\n ngDevMode && assertNotEqual(classToSearch, '', 'can not look for \"\" string.');\n let end = className.length;\n while (true) {\n const foundIndex = className.indexOf(classToSearch, startingIndex);\n if (foundIndex === -1) return foundIndex;\n if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= 32) {\n const length = classToSearch.length;\n if (foundIndex + length === end || className.charCodeAt(foundIndex + length) <= 32) {\n return foundIndex;\n }\n }\n startingIndex = foundIndex + 1;\n }\n}\n\nconst NG_TEMPLATE_SELECTOR = 'ng-template';\nfunction isCssClassMatching(tNode, attrs, cssClassToMatch, isProjectionMode) {\n ngDevMode && assertEqual(cssClassToMatch, cssClassToMatch.toLowerCase(), 'Class name expected to be lowercase.');\n let i = 0;\n if (isProjectionMode) {\n for (; i < attrs.length && typeof attrs[i] === 'string'; i += 2) {\n if (attrs[i] === 'class' && classIndexOf(attrs[i + 1].toLowerCase(), cssClassToMatch, 0) !== -1) {\n return true;\n }\n }\n } else if (isInlineTemplate(tNode)) {\n return false;\n }\n i = attrs.indexOf(1, i);\n if (i > -1) {\n let item;\n while (++i < attrs.length && typeof (item = attrs[i]) === 'string') {\n if (item.toLowerCase() === cssClassToMatch) {\n return true;\n }\n }\n }\n return false;\n}\nfunction isInlineTemplate(tNode) {\n return tNode.type === 4 && tNode.value !== NG_TEMPLATE_SELECTOR;\n}\nfunction hasTagAndTypeMatch(tNode, currentSelector, isProjectionMode) {\n const tagNameToCompare = tNode.type === 4 && !isProjectionMode ? NG_TEMPLATE_SELECTOR : tNode.value;\n return currentSelector === tagNameToCompare;\n}\nfunction isNodeMatchingSelector(tNode, selector, isProjectionMode) {\n ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');\n let mode = 4;\n const nodeAttrs = tNode.attrs;\n const nameOnlyMarkerIdx = nodeAttrs !== null ? getNameOnlyMarkerIndex(nodeAttrs) : 0;\n let skipToNextSelector = false;\n for (let i = 0; i < selector.length; i++) {\n const current = selector[i];\n if (typeof current === 'number') {\n if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) {\n return false;\n }\n if (skipToNextSelector && isPositive(current)) continue;\n skipToNextSelector = false;\n mode = current | mode & 1;\n continue;\n }\n if (skipToNextSelector) continue;\n if (mode & 4) {\n mode = 2 | mode & 1;\n if (current !== '' && !hasTagAndTypeMatch(tNode, current, isProjectionMode) || current === '' && selector.length === 1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n } else if (mode & 8) {\n if (nodeAttrs === null || !isCssClassMatching(tNode, nodeAttrs, current, isProjectionMode)) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n } else {\n const selectorAttrValue = selector[++i];\n const attrIndexInNode = findAttrIndexInNode(current, nodeAttrs, isInlineTemplate(tNode), isProjectionMode);\n if (attrIndexInNode === -1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n continue;\n }\n if (selectorAttrValue !== '') {\n let nodeAttrValue;\n if (attrIndexInNode > nameOnlyMarkerIdx) {\n nodeAttrValue = '';\n } else {\n ngDevMode && assertNotEqual(nodeAttrs[attrIndexInNode], 0, 'We do not match directives on namespaced attributes');\n nodeAttrValue = nodeAttrs[attrIndexInNode + 1].toLowerCase();\n }\n if (mode & 2 && selectorAttrValue !== nodeAttrValue) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n }\n }\n }\n return isPositive(mode) || skipToNextSelector;\n}\nfunction isPositive(mode) {\n return (mode & 1) === 0;\n}\nfunction findAttrIndexInNode(name, attrs, isInlineTemplate, isProjectionMode) {\n if (attrs === null) return -1;\n let i = 0;\n if (isProjectionMode || !isInlineTemplate) {\n let bindingsMode = false;\n while (i < attrs.length) {\n const maybeAttrName = attrs[i];\n if (maybeAttrName === name) {\n return i;\n } else if (maybeAttrName === 3 || maybeAttrName === 6) {\n bindingsMode = true;\n } else if (maybeAttrName === 1 || maybeAttrName === 2) {\n let value = attrs[++i];\n while (typeof value === 'string') {\n value = attrs[++i];\n }\n continue;\n } else if (maybeAttrName === 4) {\n break;\n } else if (maybeAttrName === 0) {\n i += 4;\n continue;\n }\n i += bindingsMode ? 1 : 2;\n }\n return -1;\n } else {\n return matchTemplateAttribute(attrs, name);\n }\n}\nfunction isNodeMatchingSelectorList(tNode, selector, isProjectionMode = false) {\n for (let i = 0; i < selector.length; i++) {\n if (isNodeMatchingSelector(tNode, selector[i], isProjectionMode)) {\n return true;\n }\n }\n return false;\n}\nfunction getProjectAsAttrValue(tNode) {\n const nodeAttrs = tNode.attrs;\n if (nodeAttrs != null) {\n const ngProjectAsAttrIdx = nodeAttrs.indexOf(5);\n if ((ngProjectAsAttrIdx & 1) === 0) {\n return nodeAttrs[ngProjectAsAttrIdx + 1];\n }\n }\n return null;\n}\nfunction getNameOnlyMarkerIndex(nodeAttrs) {\n for (let i = 0; i < nodeAttrs.length; i++) {\n const nodeAttr = nodeAttrs[i];\n if (isNameOnlyAttributeMarker(nodeAttr)) {\n return i;\n }\n }\n return nodeAttrs.length;\n}\nfunction matchTemplateAttribute(attrs, name) {\n let i = attrs.indexOf(4);\n if (i > -1) {\n i++;\n while (i < attrs.length) {\n const attr = attrs[i];\n if (typeof attr === 'number') return -1;\n if (attr === name) return i;\n i++;\n }\n }\n return -1;\n}\nfunction isSelectorInSelectorList(selector, list) {\n selectorListLoop: for (let i = 0; i < list.length; i++) {\n const currentSelectorInList = list[i];\n if (selector.length !== currentSelectorInList.length) {\n continue;\n }\n for (let j = 0; j < selector.length; j++) {\n if (selector[j] !== currentSelectorInList[j]) {\n continue selectorListLoop;\n }\n }\n return true;\n }\n return false;\n}\nfunction maybeWrapInNotSelector(isNegativeMode, chunk) {\n return isNegativeMode ? ':not(' + chunk.trim() + ')' : chunk;\n}\nfunction stringifyCSSSelector(selector) {\n let result = selector[0];\n let i = 1;\n let mode = 2;\n let currentChunk = '';\n let isNegativeMode = false;\n while (i < selector.length) {\n let valueOrMarker = selector[i];\n if (typeof valueOrMarker === 'string') {\n if (mode & 2) {\n const attrValue = selector[++i];\n currentChunk += '[' + valueOrMarker + (attrValue.length > 0 ? '=\"' + attrValue + '\"' : '') + ']';\n } else if (mode & 8) {\n currentChunk += '.' + valueOrMarker;\n } else if (mode & 4) {\n currentChunk += ' ' + valueOrMarker;\n }\n } else {\n if (currentChunk !== '' && !isPositive(valueOrMarker)) {\n result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n currentChunk = '';\n }\n mode = valueOrMarker;\n isNegativeMode = isNegativeMode || !isPositive(mode);\n }\n i++;\n }\n if (currentChunk !== '') {\n result += maybeWrapInNotSelector(isNegativeMode, currentChunk);\n }\n return result;\n}\nfunction stringifyCSSSelectorList(selectorList) {\n return selectorList.map(stringifyCSSSelector).join(',');\n}\nfunction extractAttrsAndClassesFromSelector(selector) {\n const attrs = [];\n const classes = [];\n let i = 1;\n let mode = 2;\n while (i < selector.length) {\n let valueOrMarker = selector[i];\n if (typeof valueOrMarker === 'string') {\n if (mode === 2) {\n if (valueOrMarker !== '') {\n attrs.push(valueOrMarker, selector[++i]);\n }\n } else if (mode === 8) {\n classes.push(valueOrMarker);\n }\n } else {\n if (!isPositive(mode)) break;\n mode = valueOrMarker;\n }\n i++;\n }\n if (classes.length) {\n attrs.push(1, ...classes);\n }\n return attrs;\n}\n\nconst NO_CHANGE = typeof ngDevMode === 'undefined' || ngDevMode ? {\n __brand__: 'NO_CHANGE'\n} : {};\n\nvar RendererStyleFlags2 = /*#__PURE__*/ (function (RendererStyleFlags2) {\n RendererStyleFlags2[RendererStyleFlags2[\"Important\"] = 1] = \"Important\";\n RendererStyleFlags2[RendererStyleFlags2[\"DashCase\"] = 2] = \"DashCase\";\n; return RendererStyleFlags2;})(RendererStyleFlags2 || {});\n\n\nlet _icuContainerIterate;\nfunction icuContainerIterate(tIcuContainerNode, lView) {\n return _icuContainerIterate(tIcuContainerNode, lView);\n}\nfunction ensureIcuContainerVisitorLoaded(loader) {\n if (_icuContainerIterate === undefined) {\n _icuContainerIterate = loader();\n }\n}\n\nconst ANIMATIONS_DISABLED = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AnimationsDisabled' : '', {\n factory: () => false\n});\nconst MAX_ANIMATION_TIMEOUT = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'MaxAnimationTimeout' : '', {\n factory: () => MAX_ANIMATION_TIMEOUT_DEFAULT\n});\nconst MAX_ANIMATION_TIMEOUT_DEFAULT = 4000;\n\nfunction parseCssTimeUnitsToMs(value) {\n if (!value) return 0;\n const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000;\n return parseFloat(value) * multiplier;\n}\nfunction parseCssPropertyValue(computedStyle, name) {\n const value = computedStyle.getPropertyValue(name);\n return value.split(',').map(part => part.trim());\n}\nfunction getLongestComputedTransition(computedStyle) {\n const transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property');\n const rawDurations = parseCssPropertyValue(computedStyle, 'transition-duration');\n const rawDelays = parseCssPropertyValue(computedStyle, 'transition-delay');\n const longest = {\n propertyName: '',\n duration: 0,\n animationName: undefined\n };\n for (let i = 0; i < transitionedProperties.length; i++) {\n const duration = parseCssTimeUnitsToMs(rawDelays[i]) + parseCssTimeUnitsToMs(rawDurations[i]);\n if (duration > longest.duration) {\n longest.propertyName = transitionedProperties[i];\n longest.duration = duration;\n }\n }\n return longest;\n}\nfunction getLongestComputedAnimation(computedStyle) {\n const rawNames = parseCssPropertyValue(computedStyle, 'animation-name');\n const rawDelays = parseCssPropertyValue(computedStyle, 'animation-delay');\n const rawDurations = parseCssPropertyValue(computedStyle, 'animation-duration');\n const rawIterationCounts = parseCssPropertyValue(computedStyle, 'animation-iteration-count');\n const longest = {\n animationName: '',\n propertyName: undefined,\n duration: 0\n };\n for (let i = 0; i < rawNames.length; i++) {\n const duration = parseCssTimeUnitsToMs(rawDelays[i]) + parseCssTimeUnitsToMs(rawDurations[i]);\n const iterationCount = rawIterationCounts[i];\n if (duration > longest.duration && iterationCount !== 'infinite') {\n longest.animationName = rawNames[i];\n longest.duration = duration;\n }\n }\n return longest;\n}\nfunction isShorterThanExistingAnimation(existing, longest) {\n return existing !== undefined && existing.duration > longest.duration;\n}\nfunction longestExists(longest) {\n return (longest.animationName != undefined || longest.propertyName != undefined) && longest.duration > 0;\n}\nfunction getAnimationDuration(animation) {\n const timing = animation.effect?.getTiming();\n if (timing === undefined) return undefined;\n const animationDuration = typeof timing.duration === 'number' ? timing.duration : 0;\n let duration = (timing.delay ?? 0) + animationDuration;\n const playbackRate = animation.playbackRate;\n if (playbackRate !== undefined && playbackRate !== 0 && playbackRate !== 1) {\n duration /= Math.abs(playbackRate);\n }\n return duration;\n}\nfunction determineLongestAnimationFromComputedStyles(el, animationsMap) {\n const computedStyle = getComputedStyle(el);\n const longestAnimation = getLongestComputedAnimation(computedStyle);\n const longestTransition = getLongestComputedTransition(computedStyle);\n const longest = longestAnimation.duration > longestTransition.duration ? longestAnimation : longestTransition;\n if (isShorterThanExistingAnimation(animationsMap.get(el), longest)) return;\n if (longestExists(longest)) {\n animationsMap.set(el, longest);\n }\n}\nfunction determineLongestAnimation(el, animationsMap, areAnimationSupported) {\n if (!areAnimationSupported) return;\n const animations = el.getAnimations();\n return animations.length === 0 ? determineLongestAnimationFromComputedStyles(el, animationsMap) : determineLongestAnimationFromElementAnimations(el, animationsMap, animations);\n}\nfunction determineLongestAnimationFromElementAnimations(el, animationsMap, animations) {\n let longest = {\n animationName: undefined,\n propertyName: undefined,\n duration: 0\n };\n for (const animation of animations) {\n const timing = animation.effect?.getTiming();\n if (timing?.iterations === Infinity) {\n continue;\n }\n const duration = getAnimationDuration(animation) ?? 0;\n let propertyName;\n let animationName;\n if (animation.animationName) {\n animationName = animation.animationName;\n } else {\n propertyName = animation.transitionProperty;\n }\n if (duration >= longest.duration) {\n longest = {\n animationName,\n propertyName,\n duration\n };\n }\n }\n if (isShorterThanExistingAnimation(animationsMap.get(el), longest)) return;\n if (longestExists(longest)) {\n animationsMap.set(el, longest);\n }\n}\nconst allLeavingAnimations = /*#__PURE__*/ new Set();\n\nconst DEFAULT_ANIMATIONS_DISABLED = false;\nconst ANIMATION_DURATION_TOLERANCE_MS = 1;\nconst areAnimationSupported = (typeof ngServerMode === 'undefined' || !ngServerMode) && typeof document !== 'undefined' && typeof document?.documentElement?.getAnimations === 'function';\nfunction areAnimationsDisabled(lView) {\n const injector = lView[INJECTOR];\n return injector.get(ANIMATIONS_DISABLED, DEFAULT_ANIMATIONS_DISABLED);\n}\nfunction assertAnimationTypes(value, instruction) {\n if (value == null || typeof value !== 'string' && typeof value !== 'function') {\n throw new RuntimeError(650, `'${instruction}' value must be a string of CSS classes or an animation function, got ${stringify(value)}`);\n }\n}\nfunction assertElementNodes(nativeElement, instruction) {\n if (nativeElement.nodeType !== Node.ELEMENT_NODE) {\n throw new RuntimeError(650, `'${instruction}' can only be used on an element node, got ${stringify(nativeElement.nodeType)}`);\n }\n}\nfunction trackEnterClasses(el, classList, cleanupFns) {\n const elementData = enterClassMap.get(el);\n if (elementData) {\n for (const klass of classList) {\n elementData.classList.push(klass);\n }\n for (const fn of cleanupFns) {\n elementData.cleanupFns.push(fn);\n }\n } else {\n enterClassMap.set(el, {\n classList,\n cleanupFns\n });\n }\n}\nfunction cleanupEnterClassData(element) {\n const elementData = enterClassMap.get(element);\n if (elementData) {\n for (const fn of elementData.cleanupFns) {\n fn();\n }\n enterClassMap.delete(element);\n }\n longestAnimations.delete(element);\n}\nconst noOpAnimationComplete = () => {};\nconst enterClassMap = /*#__PURE__*/ new WeakMap();\nconst longestAnimations = /*#__PURE__*/ new WeakMap();\nconst leavingNodes = /*#__PURE__*/ new WeakMap();\nfunction getDeclarationView(lView) {\n if (!lView) return null;\n return lView[DECLARATION_VIEW] ?? lView;\n}\nconst reusedNodes = /*#__PURE__*/ new WeakSet();\nfunction clearLeavingNodes(tNode, el) {\n const nodes = leavingNodes.get(tNode);\n if (nodes && nodes.length > 0) {\n const ix = nodes.findIndex(node => node.el === el);\n if (ix > -1) nodes.splice(ix, 1);\n }\n if (nodes?.length === 0) {\n leavingNodes.delete(tNode);\n }\n}\nfunction cancelLeavingNodes(tNode, newElement, newLView) {\n const nodes = leavingNodes.get(tNode);\n if (!nodes || nodes.length === 0) return;\n const newParent = newElement.parentNode;\n const prevSibling = newElement.previousSibling;\n const newDeclarationView = getDeclarationView(newLView);\n for (let i = nodes.length - 1; i >= 0; i--) {\n const {\n el: leavingEl,\n declarationView: leavingDeclarationView\n } = nodes[i];\n const leavingParent = leavingEl.parentNode;\n if (leavingEl === newElement) {\n nodes.splice(i, 1);\n reusedNodes.add(leavingEl);\n leavingEl.dispatchEvent(new CustomEvent('animationend', {\n detail: {\n cancel: true\n }\n }));\n } else if (prevSibling && leavingEl === prevSibling) {\n nodes.splice(i, 1);\n leavingEl.dispatchEvent(new CustomEvent('animationend', {\n detail: {\n cancel: true\n }\n }));\n leavingEl.parentNode?.removeChild(leavingEl);\n } else if (leavingParent && newParent && leavingParent !== newParent) {\n const sameLogicalView = newDeclarationView === null || leavingDeclarationView === null || newDeclarationView === leavingDeclarationView;\n if (sameLogicalView) {\n nodes.splice(i, 1);\n leavingEl.dispatchEvent(new CustomEvent('animationend', {\n detail: {\n cancel: true\n }\n }));\n leavingEl.parentNode?.removeChild(leavingEl);\n }\n }\n }\n}\nfunction trackLeavingNodes(tNode, el, lView) {\n const declarationView = getDeclarationView(lView);\n const nodes = leavingNodes.get(tNode);\n if (nodes) {\n if (!nodes.some(node => node.el === el)) {\n nodes.push({\n el,\n declarationView\n });\n }\n } else {\n leavingNodes.set(tNode, [{\n el,\n declarationView\n }]);\n }\n}\nfunction getLViewEnterAnimations(lView) {\n const animationData = lView[ANIMATIONS] ??= {};\n return animationData.enter ??= new Map();\n}\nfunction getLViewLeaveAnimations(lView) {\n const animationData = lView[ANIMATIONS] ??= {};\n return animationData.leave ??= new Map();\n}\nfunction getClassListFromValue(value) {\n let classes = typeof value === 'function' ? value() : value;\n while (typeof classes === 'function') {\n classes = classes();\n }\n let classList = Array.isArray(classes) ? classes : null;\n if (typeof classes === 'string') {\n classList = classes.trim().split(/\\s+/).filter(k => k);\n }\n return classList;\n}\nfunction removeClasses(renderer, el, classList) {\n for (const item of classList) {\n renderer.removeClass(el, item);\n }\n}\nfunction addClasses(renderer, el, classList) {\n for (const item of classList) {\n renderer.addClass(el, item);\n }\n}\nfunction cancelAnimationsIfRunning(element, renderer) {\n if (!areAnimationSupported) return;\n const elementData = enterClassMap.get(element);\n if (elementData && elementData.classList.length > 0 && elementHasClassList(element, elementData.classList)) {\n removeClasses(renderer, element, elementData.classList);\n }\n cleanupEnterClassData(element);\n}\nfunction elementHasClassList(element, classList) {\n for (const className of classList) {\n if (element.classList.contains(className)) return true;\n }\n return false;\n}\nfunction getEventTarget(event) {\n return event.composedPath ? event.composedPath()[0] : event.target;\n}\nfunction isLongestAnimation(event, nativeElement) {\n const longestAnimation = longestAnimations.get(nativeElement);\n if (longestAnimation === undefined) return true;\n if (nativeElement !== getEventTarget(event)) return false;\n const eventAnimation = event.animation;\n if (eventAnimation) {\n const eventAnimationDuration = getAnimationDuration(eventAnimation);\n if (eventAnimationDuration !== undefined && eventAnimationDuration + ANIMATION_DURATION_TOLERANCE_MS < longestAnimation.duration) {\n return false;\n }\n }\n if (longestAnimation.animationName !== undefined) {\n return event.animationName === longestAnimation.animationName;\n }\n if (longestAnimation.propertyName !== undefined) {\n return longestAnimation.propertyName === 'all' || event.propertyName === longestAnimation.propertyName;\n }\n return false;\n}\nfunction addAnimationToLView(animations, tNode, fn) {\n const nodeAnimations = animations.get(tNode.index) ?? {\n animateFns: []\n };\n nodeAnimations.animateFns.push(fn);\n animations.set(tNode.index, nodeAnimations);\n}\nfunction cleanupAfterLeaveAnimations(resolvers, cleanupFns) {\n if (resolvers) {\n for (const fn of resolvers) {\n fn();\n }\n }\n for (const fn of cleanupFns) {\n fn();\n }\n}\nfunction clearLViewNodeAnimationResolvers(lView, tNode) {\n const nodeAnimations = getLViewLeaveAnimations(lView).get(tNode.index);\n if (nodeAnimations) nodeAnimations.resolvers = undefined;\n}\nfunction leaveAnimationFunctionCleanup(lView, tNode, nativeElement, resolvers, cleanupFns) {\n clearLeavingNodes(tNode, nativeElement);\n cleanupAfterLeaveAnimations(resolvers, cleanupFns);\n clearLViewNodeAnimationResolvers(lView, tNode);\n}\n\nvar TracingAction = /*#__PURE__*/ (function (TracingAction) {\n TracingAction[TracingAction[\"CHANGE_DETECTION\"] = 0] = \"CHANGE_DETECTION\";\n TracingAction[TracingAction[\"AFTER_NEXT_RENDER\"] = 1] = \"AFTER_NEXT_RENDER\";\n; return TracingAction;})(TracingAction || {});\n\nconst TracingService = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'TracingService' : '');\n\nconst markedFeatures = /*#__PURE__*/ new Set();\nfunction performanceMarkFeature(feature) {\n if (markedFeatures.has(feature)) {\n return;\n }\n markedFeatures.add(feature);\n performance?.mark?.('mark_feature_usage', {\n detail: {\n feature\n }\n });\n}\n\nlet AfterRenderManager = /*#__PURE__*/ (() => {\nclass AfterRenderManager {\n impl = null;\n execute() {\n this.impl?.execute();\n }\n static ษตprov =\n /* @__PURE__ */\n __defineInjectable({\n token: AfterRenderManager,\n providedIn: 'root',\n factory: () => new AfterRenderManager()\n });\n}\nreturn AfterRenderManager;\n})();\nconst AFTER_RENDER_PHASES = /* @__PURE__ **/(() => [0, 1, 2, 3])();\nlet AfterRenderImpl = /*#__PURE__*/ (() => {\nclass AfterRenderImpl {\n ngZone = inject(NgZone);\n scheduler = inject(ChangeDetectionScheduler);\n errorHandler = inject(ErrorHandler, {\n optional: true\n });\n sequences = new Set();\n deferredRegistrations = new Set();\n executing = false;\n constructor() {\n inject(TracingService, {\n optional: true\n });\n }\n execute() {\n const hasSequencesToExecute = this.sequences.size > 0;\n if (hasSequencesToExecute) {\n profiler(ProfilerEvent.AfterRenderHooksStart);\n }\n this.executing = true;\n for (const phase of AFTER_RENDER_PHASES) {\n for (const sequence of this.sequences) {\n if (sequence.erroredOrDestroyed || !sequence.hooks[phase]) {\n continue;\n }\n try {\n sequence.pipelinedValue = this.ngZone.runOutsideAngular(() => this.maybeTrace(() => {\n const hookFn = sequence.hooks[phase];\n const value = hookFn(sequence.pipelinedValue);\n return value;\n }, sequence.snapshot));\n } catch (err) {\n sequence.erroredOrDestroyed = true;\n this.errorHandler?.handleError(err);\n }\n }\n }\n this.executing = false;\n for (const sequence of this.sequences) {\n sequence.afterRun();\n if (sequence.once) {\n this.sequences.delete(sequence);\n sequence.destroy();\n }\n }\n for (const sequence of this.deferredRegistrations) {\n this.sequences.add(sequence);\n }\n if (this.deferredRegistrations.size > 0) {\n this.scheduler.notify(7);\n }\n this.deferredRegistrations.clear();\n if (hasSequencesToExecute) {\n profiler(ProfilerEvent.AfterRenderHooksEnd);\n }\n }\n register(sequence) {\n const {\n view\n } = sequence;\n if (view !== undefined) {\n (view[AFTER_RENDER_SEQUENCES_TO_ADD] ??= []).push(sequence);\n markAncestorsForTraversal(view);\n view[FLAGS] |= 8192;\n } else {\n this.addSequence(sequence);\n }\n }\n addSequence(sequence) {\n if (this.executing) {\n this.deferredRegistrations.add(sequence);\n } else {\n this.sequences.add(sequence);\n }\n this.scheduler.notify(7);\n }\n unregister(sequence) {\n if (this.executing && this.sequences.has(sequence)) {\n sequence.erroredOrDestroyed = true;\n sequence.pipelinedValue = undefined;\n sequence.once = true;\n } else {\n this.sequences.delete(sequence);\n this.deferredRegistrations.delete(sequence);\n }\n }\n maybeTrace(fn, snapshot) {\n return snapshot ? snapshot.run(TracingAction.AFTER_NEXT_RENDER, fn) : fn();\n }\n static ษตprov =\n /* @__PURE__ */\n __defineInjectable({\n token: AfterRenderImpl,\n providedIn: 'root',\n factory: () => new AfterRenderImpl()\n });\n}\nreturn AfterRenderImpl;\n})();\nclass AfterRenderSequence {\n impl;\n hooks;\n view;\n once;\n snapshot;\n erroredOrDestroyed = false;\n pipelinedValue = undefined;\n unregisterOnDestroy;\n constructor(impl, hooks, view, once, destroyRef, snapshot = null) {\n this.impl = impl;\n this.hooks = hooks;\n this.view = view;\n this.once = once;\n this.snapshot = snapshot;\n this.unregisterOnDestroy = destroyRef?.onDestroy(() => this.destroy());\n }\n afterRun() {\n this.erroredOrDestroyed = false;\n this.pipelinedValue = undefined;\n this.snapshot?.dispose();\n this.snapshot = null;\n }\n destroy() {\n this.impl.unregister(this);\n this.unregisterOnDestroy?.();\n const scheduled = this.view?.[AFTER_RENDER_SEQUENCES_TO_ADD];\n if (scheduled) {\n this.view[AFTER_RENDER_SEQUENCES_TO_ADD] = scheduled.filter(s => s !== this);\n }\n }\n}\n\nfunction afterEveryRender(callbackOrSpec, options) {\n ngDevMode && assertNotInReactiveContext(afterEveryRender, 'Call `afterEveryRender` outside of a reactive context. For example, schedule the render ' + 'callback inside the component constructor`.');\n if (ngDevMode && !options?.injector) {\n assertInInjectionContext(afterEveryRender);\n }\n const injector = options?.injector ?? inject(Injector);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n return NOOP_AFTER_RENDER_REF;\n }\n performanceMarkFeature('NgAfterRender');\n return afterEveryRenderImpl(callbackOrSpec, injector, options, false);\n}\nfunction afterNextRender(callbackOrSpec, options) {\n if (ngDevMode && !options?.injector) {\n assertInInjectionContext(afterNextRender);\n }\n const injector = options?.injector ?? inject(Injector);\n if (typeof ngServerMode !== 'undefined' && ngServerMode) {\n return NOOP_AFTER_RENDER_REF;\n }\n performanceMarkFeature('NgAfterNextRender');\n return afterEveryRenderImpl(callbackOrSpec, injector, options, true);\n}\nfunction getHooks(callbackOrSpec) {\n if (callbackOrSpec instanceof Function) {\n return [undefined, undefined, callbackOrSpec, undefined];\n } else {\n return [callbackOrSpec.earlyRead, callbackOrSpec.write, callbackOrSpec.mixedReadWrite, callbackOrSpec.read];\n }\n}\nfunction afterEveryRenderImpl(callbackOrSpec, injector, options, once) {\n const manager = injector.get(AfterRenderManager);\n manager.impl ??= injector.get(AfterRenderImpl);\n const tracing = injector.get(TracingService, null, {\n optional: true\n });\n const destroyRef = options?.manualCleanup !== true ? injector.get(DestroyRef) : null;\n const viewContext = injector.get(ViewContext, null, {\n optional: true\n });\n const sequence = new AfterRenderSequence(manager.impl, getHooks(callbackOrSpec), viewContext?.view, once, destroyRef, tracing?.snapshot(null));\n manager.impl.register(sequence);\n return sequence;\n}\nconst NOOP_AFTER_RENDER_REF = {\n destroy() {}\n};\n\nconst ANIMATION_QUEUE = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AnimationQueue' : '', {\n factory: () => {\n const injector = inject(EnvironmentInjector);\n const queue = new Set();\n injector.onDestroy(() => queue.clear());\n return {\n queue,\n isScheduled: false,\n scheduler: null,\n injector\n };\n }\n});\nfunction addToAnimationQueue(animationQueue, injector, animationFns, animationData) {\n if (Array.isArray(animationFns)) {\n for (const animateFn of animationFns) {\n animationQueue.queue.add(animateFn);\n animationData?.detachedLeaveAnimationFns?.push(animateFn);\n }\n } else {\n animationQueue.queue.add(animationFns);\n animationData?.detachedLeaveAnimationFns?.push(animationFns);\n }\n animationQueue.scheduler && animationQueue.scheduler(injector);\n}\nfunction removeAnimationsFromQueue(animationQueue, animationFns) {\n if (Array.isArray(animationFns)) {\n for (const animateFn of animationFns) {\n animationQueue.queue.delete(animateFn);\n }\n } else {\n animationQueue.queue.delete(animationFns);\n }\n}\nfunction removeFromAnimationQueue(injector, animationData) {\n const animationQueue = injector.get(ANIMATION_QUEUE);\n if (animationData.detachedLeaveAnimationFns) {\n for (const animationFn of animationData.detachedLeaveAnimationFns) {\n animationQueue.queue.delete(animationFn);\n }\n animationData.detachedLeaveAnimationFns = undefined;\n }\n}\nfunction scheduleAnimationQueue(injector) {\n const animationQueue = injector.get(ANIMATION_QUEUE);\n if (!animationQueue.isScheduled) {\n afterNextRender(() => {\n animationQueue.isScheduled = false;\n for (let animateFn of animationQueue.queue) {\n animateFn();\n }\n animationQueue.queue.clear();\n }, {\n injector: animationQueue.injector\n });\n animationQueue.isScheduled = true;\n }\n}\nfunction initializeAnimationQueueScheduler(injector) {\n const animationQueue = injector.get(ANIMATION_QUEUE);\n animationQueue.scheduler = scheduleAnimationQueue;\n animationQueue.scheduler(injector);\n}\nfunction queueEnterAnimations(injector, enterAnimations) {\n const queue = injector.get(ANIMATION_QUEUE);\n for (const [_, nodeAnimations] of enterAnimations) {\n addToAnimationQueue(queue, injector, nodeAnimations.animateFns);\n }\n}\n\nlet nodeAnimationRuntime = null;\nlet viewDetachAnimationRuntime = null;\nfunction maybeQueueEnterAnimation(parentLView, parent, tNode, injector) {\n nodeAnimationRuntime?.maybeQueueEnterAnimation(parentLView, parent, tNode, injector);\n}\nfunction runLeaveAnimationsWithCallback(lView, tNode, injector, callback) {\n if (nodeAnimationRuntime === null) {\n callback(false);\n } else {\n nodeAnimationRuntime.runLeaveAnimationsWithCallback(lView, tNode, injector, callback);\n }\n}\nfunction initViewDetachAnimations(view) {\n viewDetachAnimationRuntime?.initViewDetachAnimations(view);\n}\nfunction clearViewDetachAnimations(view) {\n viewDetachAnimationRuntime?.clearViewDetachAnimations(view);\n}\nfunction enableAnimationRuntimeSupport() {\n nodeAnimationRuntime ??= {\n maybeQueueEnterAnimation: maybeQueueEnterAnimationImpl,\n runLeaveAnimationsWithCallback: runLeaveAnimationsWithCallbackImpl\n };\n}\nfunction enableViewDetachAnimationsSupport() {\n viewDetachAnimationRuntime ??= {\n initViewDetachAnimations: initViewDetachAnimationsImpl,\n clearViewDetachAnimations: clearViewDetachAnimationsImpl\n };\n}\nfunction maybeQueueEnterAnimationImpl(parentLView, parent, tNode, injector) {\n const enterAnimations = parentLView?.[ANIMATIONS]?.enter;\n if (parent !== null && enterAnimations && enterAnimations.has(tNode.index)) {\n queueEnterAnimations(injector, enterAnimations);\n }\n}\nfunction runLeaveAnimationsWithCallbackImpl(lView, tNode, injector, callback) {\n let animationQueue;\n try {\n animationQueue = injector.get(ANIMATION_QUEUE);\n } catch {\n return callback(false);\n }\n const animations = lView ? lView[ANIMATIONS] ??= {} : undefined;\n if (animations?.enter?.has(tNode.index)) {\n removeAnimationsFromQueue(animationQueue, animations.enter.get(tNode.index).animateFns);\n }\n const nodesWithExitAnimations = aggregateDescendantAnimations(lView, tNode, animations);\n if (nodesWithExitAnimations.size === 0) {\n const hasNestedAnimations = lView ? hasNestedViewAnimations(lView, tNode) : false;\n if (!hasNestedAnimations) {\n return callback(false);\n }\n }\n if (lView) allLeavingAnimations.add(lView[ID]);\n addToAnimationQueue(animationQueue, injector, () => executeLeaveAnimations(lView, tNode, animations, nodesWithExitAnimations, callback), animations);\n}\nfunction aggregateDescendantAnimations(lView, tNode, animations) {\n const nodesWithExitAnimations = new Map();\n const leaveAnimations = animations?.leave;\n if (leaveAnimations && leaveAnimations.has(tNode.index)) {\n nodesWithExitAnimations.set(tNode.index, leaveAnimations.get(tNode.index));\n }\n if (lView && leaveAnimations) {\n for (const [index, animationData] of leaveAnimations) {\n if (nodesWithExitAnimations.has(index)) continue;\n const nestedTNode = lView[TVIEW$1].data[index];\n let parent = nestedTNode.parent;\n while (parent) {\n if (parent === tNode) {\n nodesWithExitAnimations.set(index, animationData);\n break;\n }\n parent = parent.parent;\n }\n }\n }\n return nodesWithExitAnimations;\n}\nfunction executeLeaveAnimations(lView, tNode, animations, nodesWithExitAnimations, callback) {\n const runningAnimations = [];\n if (animations && animations.leave) {\n for (const [index] of nodesWithExitAnimations) {\n if (!animations.leave.has(index)) continue;\n const currentAnimationData = animations.leave.get(index);\n for (const animationFn of currentAnimationData.animateFns) {\n const {\n promise\n } = animationFn();\n runningAnimations.push(promise);\n }\n animations.detachedLeaveAnimationFns = undefined;\n }\n }\n if (lView) {\n collectNestedViewAnimations(lView, tNode, runningAnimations);\n }\n if (runningAnimations.length > 0) {\n const currentAnimations = animations || lView?.[ANIMATIONS];\n if (currentAnimations) {\n const prevRunning = currentAnimations.running;\n if (prevRunning) {\n runningAnimations.push(prevRunning);\n }\n currentAnimations.running = Promise.allSettled(runningAnimations);\n runAfterLeaveAnimations(lView, currentAnimations.running, callback);\n } else {\n Promise.allSettled(runningAnimations).then(() => {\n if (lView) allLeavingAnimations.delete(lView[ID]);\n callback(true);\n });\n }\n } else {\n if (lView) allLeavingAnimations.delete(lView[ID]);\n callback(false);\n }\n}\nfunction hasNestedViewAnimations(lView, tNode) {\n if (tNode.type & 12) {\n const lContainer = lView[tNode.index];\n if (isLContainer(lContainer)) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const subView = lContainer[i];\n if (subView[TVIEW$1].type === 2) {\n if (hasViewLeaveAnimations(subView)) {\n return true;\n }\n }\n }\n }\n }\n let child = tNode.child;\n while (child) {\n if (hasNestedViewAnimations(lView, child)) {\n return true;\n }\n child = child.next;\n }\n return false;\n}\nfunction hasViewLeaveAnimations(view) {\n const animations = view[ANIMATIONS];\n if (animations?.leave && animations.leave.size > 0) {\n return true;\n }\n let child = view[TVIEW$1].firstChild;\n while (child) {\n if (hasNestedViewAnimations(view, child)) {\n return true;\n }\n child = child.next;\n }\n return false;\n}\nfunction collectNestedViewAnimations(lView, tNode, collectedPromises) {\n if (tNode.type & 12) {\n const lContainer = lView[tNode.index];\n if (isLContainer(lContainer)) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const subView = lContainer[i];\n if (subView[TVIEW$1].type === 2) {\n collectAllViewLeaveAnimations(subView, collectedPromises);\n }\n }\n }\n }\n let child = tNode.child;\n while (child) {\n collectNestedViewAnimations(lView, child, collectedPromises);\n child = child.next;\n }\n}\nfunction collectAllViewLeaveAnimations(view, collectedPromises) {\n const animations = view[ANIMATIONS];\n if (animations && animations.leave) {\n for (const animationData of animations.leave.values()) {\n for (const animationFn of animationData.animateFns) {\n const {\n promise\n } = animationFn();\n collectedPromises.push(promise);\n }\n }\n }\n let child = view[TVIEW$1].firstChild;\n while (child) {\n collectNestedViewAnimations(view, child, collectedPromises);\n child = child.next;\n }\n}\nfunction runAfterLeaveAnimations(lView, runningAnimations, callback) {\n runningAnimations.then(() => {\n if (lView[ANIMATIONS]?.running === runningAnimations) {\n lView[ANIMATIONS].running = undefined;\n allLeavingAnimations.delete(lView[ID]);\n }\n callback(true);\n });\n}\nfunction initViewDetachAnimationsImpl(view) {\n const animations = view[ANIMATIONS] ??= {};\n animations.detachedLeaveAnimationFns = [];\n let child = view[TVIEW$1].firstChild;\n while (child) {\n initNestedViewDetachAnimations(view, child);\n child = child.next;\n }\n}\nfunction initNestedViewDetachAnimations(lView, tNode) {\n if (tNode.type & 12) {\n const lContainer = lView[tNode.index];\n if (isLContainer(lContainer)) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const subView = lContainer[i];\n if (subView[TVIEW$1].type === 2) {\n initViewDetachAnimationsImpl(subView);\n }\n }\n }\n }\n let child = tNode.child;\n while (child) {\n initNestedViewDetachAnimations(lView, child);\n child = child.next;\n }\n}\nfunction clearViewDetachAnimationsImpl(view) {\n const animations = view[ANIMATIONS];\n if (animations && animations.detachedLeaveAnimationFns && animations.detachedLeaveAnimationFns.length > 0) {\n const injector = view[INJECTOR];\n removeFromAnimationQueue(injector, animations);\n allLeavingAnimations.delete(view[ID]);\n animations.detachedLeaveAnimationFns = undefined;\n } else if (animations) {\n animations.detachedLeaveAnimationFns = undefined;\n }\n let child = view[TVIEW$1].firstChild;\n while (child) {\n clearNestedViewDetachAnimations(view, child);\n child = child.next;\n }\n}\nfunction clearNestedViewDetachAnimations(lView, tNode) {\n if (tNode.type & 12) {\n const lContainer = lView[tNode.index];\n if (isLContainer(lContainer)) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const subView = lContainer[i];\n if (subView[TVIEW$1].type === 2) {\n clearViewDetachAnimationsImpl(subView);\n }\n }\n }\n }\n let child = tNode.child;\n while (child) {\n clearNestedViewDetachAnimations(lView, child);\n child = child.next;\n }\n}\n\nfunction applyToElementOrContainer(action, renderer, injector, parent, lNodeToHandle, tNode, beforeNode, parentLView) {\n if (lNodeToHandle != null) {\n let lContainer;\n let isComponent = false;\n if (isLContainer(lNodeToHandle)) {\n lContainer = lNodeToHandle;\n } else if (isLView(lNodeToHandle)) {\n isComponent = true;\n ngDevMode && assertDefined(lNodeToHandle[HOST], 'HOST must be defined for a component LView');\n lNodeToHandle = lNodeToHandle[HOST];\n }\n const rNode = unwrapRNode(lNodeToHandle);\n if (action === 0 && parent !== null) {\n maybeQueueEnterAnimation(parentLView, parent, tNode, injector);\n if (beforeNode == null) {\n nativeAppendChild(renderer, parent, rNode);\n } else {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n }\n } else if (action === 1 && parent !== null) {\n nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true);\n cancelLeavingNodes(tNode, rNode, parentLView);\n if (!reusedNodes.has(rNode)) {\n maybeQueueEnterAnimation(parentLView, parent, tNode, injector);\n }\n } else if (action === 2) {\n if (parentLView?.[ANIMATIONS]?.leave?.has(tNode.index)) {\n trackLeavingNodes(tNode, rNode, parentLView);\n }\n reusedNodes.delete(rNode);\n runLeaveAnimationsWithCallback(parentLView, tNode, injector, nodeHasLeaveAnimations => {\n if (reusedNodes.has(rNode)) {\n reusedNodes.delete(rNode);\n return;\n }\n nativeRemoveNode(renderer, rNode, isComponent, nodeHasLeaveAnimations);\n });\n } else if (action === 3) {\n reusedNodes.delete(rNode);\n runLeaveAnimationsWithCallback(parentLView, tNode, injector, () => {\n renderer.destroyNode(rNode);\n });\n }\n if (lContainer != null) {\n applyContainer(renderer, action, injector, lContainer, tNode, parent, beforeNode);\n }\n }\n}\nfunction removeViewFromDOM(tView, lView) {\n detachViewFromDOM(tView, lView);\n lView[HOST] = null;\n lView[T_HOST] = null;\n}\nfunction addViewToDOM(tView, parentTNode, renderer, lView, parentNativeNode, beforeNode) {\n lView[HOST] = parentNativeNode;\n lView[T_HOST] = parentTNode;\n applyView(tView, lView, renderer, 1, parentNativeNode, beforeNode);\n}\nfunction detachViewFromDOM(tView, lView) {\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(9);\n applyView(tView, lView, lView[RENDERER], 2, null, null);\n}\nfunction destroyViewTree(rootView) {\n let lViewOrLContainer = rootView[CHILD_HEAD];\n if (!lViewOrLContainer) {\n return cleanUpView(rootView[TVIEW$1], rootView);\n }\n while (lViewOrLContainer) {\n let next = null;\n if (isLView(lViewOrLContainer)) {\n next = lViewOrLContainer[CHILD_HEAD];\n } else {\n ngDevMode && assertLContainer(lViewOrLContainer);\n const firstView = lViewOrLContainer[CONTAINER_HEADER_OFFSET];\n if (firstView) next = firstView;\n }\n if (!next) {\n while (lViewOrLContainer && !lViewOrLContainer[NEXT] && lViewOrLContainer !== rootView) {\n if (isLView(lViewOrLContainer)) {\n cleanUpView(lViewOrLContainer[TVIEW$1], lViewOrLContainer);\n }\n lViewOrLContainer = lViewOrLContainer[PARENT];\n }\n if (lViewOrLContainer === null) lViewOrLContainer = rootView;\n if (isLView(lViewOrLContainer)) {\n cleanUpView(lViewOrLContainer[TVIEW$1], lViewOrLContainer);\n }\n next = lViewOrLContainer && lViewOrLContainer[NEXT];\n }\n lViewOrLContainer = next;\n }\n}\nfunction detachMovedView(declarationContainer, lView) {\n ngDevMode && assertLContainer(declarationContainer);\n ngDevMode && assertDefined(declarationContainer[MOVED_VIEWS], 'A projected view should belong to a non-empty projected views collection');\n const movedViews = declarationContainer[MOVED_VIEWS];\n const declarationViewIndex = movedViews.indexOf(lView);\n movedViews.splice(declarationViewIndex, 1);\n}\nfunction destroyLView(tView, lView) {\n if (isDestroyed(lView)) {\n return;\n }\n const renderer = lView[RENDERER];\n if (renderer.destroyNode) {\n applyView(tView, lView, renderer, 3, null, null);\n }\n destroyViewTree(lView);\n}\nfunction cleanUpView(tView, lView) {\n if (isDestroyed(lView)) {\n return;\n }\n const prevConsumer = setActiveConsumer(null);\n try {\n lView[FLAGS] &= ~128;\n lView[FLAGS] |= 256;\n lView[REACTIVE_TEMPLATE_CONSUMER] && consumerDestroy(lView[REACTIVE_TEMPLATE_CONSUMER]);\n executeOnDestroys(tView, lView);\n processCleanups(tView, lView);\n if (lView[TVIEW$1].type === 1) {\n lView[RENDERER].destroy();\n }\n const declarationContainer = lView[DECLARATION_LCONTAINER];\n if (declarationContainer !== null && isLContainer(lView[PARENT])) {\n if (declarationContainer !== lView[PARENT]) {\n detachMovedView(declarationContainer, lView);\n }\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(tView);\n }\n }\n unregisterLView(lView);\n } finally {\n setActiveConsumer(prevConsumer);\n }\n}\nfunction processCleanups(tView, lView) {\n ngDevMode && assertNotReactive(processCleanups.name);\n const tCleanup = tView.cleanup;\n const lCleanup = lView[CLEANUP];\n if (tCleanup !== null) {\n for (let i = 0; i < tCleanup.length - 1; i += 2) {\n if (typeof tCleanup[i] === 'string') {\n const targetIdx = tCleanup[i + 3];\n ngDevMode && assertNumber(targetIdx, 'cleanup target must be a number');\n if (targetIdx >= 0) {\n lCleanup[targetIdx]();\n } else {\n lCleanup[-targetIdx].unsubscribe();\n }\n i += 2;\n } else {\n const context = lCleanup[tCleanup[i + 1]];\n tCleanup[i].call(context);\n }\n }\n }\n if (lCleanup !== null) {\n lView[CLEANUP] = null;\n }\n const destroyHooks = lView[ON_DESTROY_HOOKS];\n if (destroyHooks !== null) {\n lView[ON_DESTROY_HOOKS] = null;\n for (let i = 0; i < destroyHooks.length; i++) {\n const destroyHooksFn = destroyHooks[i];\n ngDevMode && assertFunction(destroyHooksFn, 'Expecting destroy hook to be a function.');\n destroyHooksFn();\n }\n }\n const effects = lView[EFFECTS];\n if (effects !== null) {\n lView[EFFECTS] = null;\n for (const effect of effects) {\n effect.destroy();\n }\n }\n}\nfunction executeOnDestroys(tView, lView) {\n ngDevMode && assertNotReactive(executeOnDestroys.name);\n let destroyHooks;\n if (tView != null && (destroyHooks = tView.destroyHooks) != null) {\n for (let i = 0; i < destroyHooks.length; i += 2) {\n const context = lView[destroyHooks[i]];\n if (!(context instanceof NodeInjectorFactory)) {\n const toCall = destroyHooks[i + 1];\n if (Array.isArray(toCall)) {\n for (let j = 0; j < toCall.length; j += 2) {\n const callContext = context[toCall[j]];\n const hook = toCall[j + 1];\n profiler(ProfilerEvent.LifecycleHookStart, callContext, hook);\n try {\n hook.call(callContext);\n } finally {\n profiler(ProfilerEvent.LifecycleHookEnd, callContext, hook);\n }\n }\n } else {\n profiler(ProfilerEvent.LifecycleHookStart, context, toCall);\n try {\n toCall.call(context);\n } finally {\n profiler(ProfilerEvent.LifecycleHookEnd, context, toCall);\n }\n }\n }\n }\n }\n}\nfunction getParentRElement(tView, tNode, lView) {\n if (tNode === null) {\n throw new RuntimeError(510, ngDevMode && 'getParentRElement() was called with a null TNode, so no parent element could be resolved. This usually means a TNode was never created for this node, or was already destroyed.');\n }\n return getClosestRElement(tView, tNode.parent, lView);\n}\nfunction getClosestRElement(tView, tNode, lView) {\n let parentTNode = tNode;\n while (parentTNode !== null && parentTNode.type & (8 | 32 | 128)) {\n tNode = parentTNode;\n parentTNode = tNode.parent;\n }\n if (parentTNode === null) {\n return lView[HOST];\n } else {\n ngDevMode && assertTNodeType(parentTNode, 3 | 4);\n if (isComponentHost(parentTNode)) {\n ngDevMode && assertTNodeForLView(parentTNode, lView);\n const {\n encapsulation\n } = tView.data[parentTNode.directiveStart + parentTNode.componentOffset];\n if (encapsulation === ViewEncapsulation.None || encapsulation === ViewEncapsulation.Emulated) {\n return null;\n }\n }\n return getNativeByTNode(parentTNode, lView);\n }\n}\nfunction getInsertInFrontOfRNode(parentTNode, currentTNode, lView) {\n return _getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView);\n}\nfunction getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView) {\n if (parentTNode.type & (8 | 32)) {\n return getNativeByTNode(parentTNode, lView);\n }\n return null;\n}\nlet _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithNoI18n;\nlet _processI18nInsertBefore;\nfunction setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore) {\n _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithI18n;\n _processI18nInsertBefore = processI18nInsertBefore;\n}\nfunction appendChild(tView, lView, childRNode, childTNode) {\n const parentRNode = getParentRElement(tView, childTNode, lView);\n const renderer = lView[RENDERER];\n const parentTNode = childTNode.parent || lView[T_HOST];\n const anchorNode = getInsertInFrontOfRNode(parentTNode, childTNode, lView);\n if (parentRNode != null) {\n if (Array.isArray(childRNode)) {\n for (let i = 0; i < childRNode.length; i++) {\n nativeAppendOrInsertBefore(renderer, parentRNode, childRNode[i], anchorNode, false);\n }\n } else {\n nativeAppendOrInsertBefore(renderer, parentRNode, childRNode, anchorNode, false);\n }\n }\n _processI18nInsertBefore !== undefined && _processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRNode);\n}\nfunction getFirstNativeNode(lView, tNode) {\n if (tNode !== null) {\n ngDevMode && assertTNodeType(tNode, 3 | 12 | 32 | 16 | 128);\n const tNodeType = tNode.type;\n if (tNodeType & 3) {\n return getNativeByTNode(tNode, lView);\n } else if (tNodeType & 4) {\n return getBeforeNodeForView(-1, lView[tNode.index]);\n } else if (tNodeType & 8) {\n const elIcuContainerChild = tNode.child;\n if (elIcuContainerChild !== null) {\n return getFirstNativeNode(lView, elIcuContainerChild);\n } else {\n const rNodeOrLContainer = lView[tNode.index];\n if (isLContainer(rNodeOrLContainer)) {\n return getBeforeNodeForView(-1, rNodeOrLContainer);\n } else {\n return unwrapRNode(rNodeOrLContainer);\n }\n }\n } else if (tNodeType & 128) {\n return getFirstNativeNode(lView, tNode.next);\n } else if (tNodeType & 32) {\n let nextRNode = icuContainerIterate(tNode, lView);\n let rNode = nextRNode();\n return rNode || unwrapRNode(lView[tNode.index]);\n } else {\n const projectionNodes = getProjectionNodes(lView, tNode);\n if (projectionNodes !== null) {\n if (Array.isArray(projectionNodes)) {\n return projectionNodes[0];\n }\n const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);\n ngDevMode && assertParentView(parentView);\n return getFirstNativeNode(parentView, projectionNodes);\n } else {\n return getFirstNativeNode(lView, tNode.next);\n }\n }\n }\n return null;\n}\nfunction getProjectionNodes(lView, tNode) {\n if (tNode !== null) {\n const componentView = lView[DECLARATION_COMPONENT_VIEW];\n const componentHost = componentView[T_HOST];\n const slotIdx = tNode.projection;\n ngDevMode && assertProjectionSlots(lView);\n return componentHost.projection[slotIdx];\n }\n return null;\n}\nfunction getBeforeNodeForView(viewIndexInContainer, lContainer) {\n const nextViewIndex = CONTAINER_HEADER_OFFSET + viewIndexInContainer + 1;\n if (nextViewIndex < lContainer.length) {\n const lView = lContainer[nextViewIndex];\n const firstTNodeOfView = lView[TVIEW$1].firstChild;\n if (firstTNodeOfView !== null) {\n return getFirstNativeNode(lView, firstTNodeOfView);\n }\n }\n return lContainer[NATIVE];\n}\nfunction applyNodes(renderer, action, tNode, lView, parentRElement, beforeNode, isProjection) {\n while (tNode != null) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n const injector = lView[INJECTOR];\n if (tNode.type === 128) {\n tNode = tNode.next;\n continue;\n }\n ngDevMode && assertTNodeType(tNode, 3 | 12 | 16 | 32);\n const rawSlotValue = lView[tNode.index];\n const tNodeType = tNode.type;\n if (isProjection) {\n if (action === 0) {\n rawSlotValue && attachPatchData(unwrapRNode(rawSlotValue), lView);\n tNode.flags |= 2;\n }\n }\n if (!isDetachedByI18n(tNode)) {\n if (tNodeType & 8) {\n applyNodes(renderer, action, tNode.child, lView, parentRElement, beforeNode, false);\n applyToElementOrContainer(action, renderer, injector, parentRElement, rawSlotValue, tNode, beforeNode, lView);\n } else if (tNodeType & 32) {\n const nextRNode = icuContainerIterate(tNode, lView);\n let rNode;\n while (rNode = nextRNode()) {\n applyToElementOrContainer(action, renderer, injector, parentRElement, rNode, tNode, beforeNode, lView);\n }\n applyToElementOrContainer(action, renderer, injector, parentRElement, rawSlotValue, tNode, beforeNode, lView);\n } else if (tNodeType & 16) {\n applyProjectionRecursive(renderer, action, lView, tNode, parentRElement, beforeNode);\n } else {\n ngDevMode && assertTNodeType(tNode, 3 | 4);\n applyToElementOrContainer(action, renderer, injector, parentRElement, rawSlotValue, tNode, beforeNode, lView);\n }\n }\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n }\n}\nfunction applyView(tView, lView, renderer, action, parentRElement, beforeNode) {\n if (tView.type === 3) {\n applyForeignNodes(renderer, action, lView, parentRElement, beforeNode);\n } else {\n applyNodes(renderer, action, tView.firstChild, lView, parentRElement, beforeNode, false);\n }\n}\nfunction applyForeignNodes(renderer, action, lView, parent, beforeNode) {\n const tView = lView[TVIEW$1];\n const headTNode = tView.firstChild;\n const tailTNode = headTNode.next;\n const head = unwrapRNode(lView[headTNode.index]);\n const tail = unwrapRNode(lView[tailTNode.index]);\n const fragmentSlotIndex = tailTNode.index + 1;\n let fragment = lView[fragmentSlotIndex];\n if (action === 1 || action === 0) {\n if (parent !== null) {\n if (fragment && fragment.hasChildNodes()) {\n nativeInsertBefore(renderer, parent, fragment, beforeNode, true);\n } else {\n nativeInsertBefore(renderer, parent, head, beforeNode, true);\n nativeInsertBefore(renderer, parent, tail, beforeNode, true);\n }\n }\n } else if (action === 2) {\n if (!fragment) {\n fragment = document.createDocumentFragment();\n lView[fragmentSlotIndex] = fragment;\n }\n if (head && head.parentNode === fragment) {\n return;\n }\n let current = head;\n while (current !== null) {\n const next = current.nextSibling;\n fragment.appendChild(current);\n if (current === tail) break;\n current = next;\n }\n }\n}\nfunction applyProjection(tView, lView, tProjectionNode) {\n const renderer = lView[RENDERER];\n const parentRNode = getParentRElement(tView, tProjectionNode, lView);\n const parentTNode = tProjectionNode.parent || lView[T_HOST];\n let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView);\n applyProjectionRecursive(renderer, 0, lView, tProjectionNode, parentRNode, beforeNode);\n}\nfunction applyProjectionRecursive(renderer, action, lView, tProjectionNode, parentRElement, beforeNode) {\n const componentLView = lView[DECLARATION_COMPONENT_VIEW];\n const componentNode = componentLView[T_HOST];\n ngDevMode && assertEqual(typeof tProjectionNode.projection, 'number', 'expecting projection index');\n const nodeToProjectOrRNodes = componentNode.projection[tProjectionNode.projection];\n if (Array.isArray(nodeToProjectOrRNodes)) {\n for (let i = 0; i < nodeToProjectOrRNodes.length; i++) {\n const rNode = nodeToProjectOrRNodes[i];\n applyToElementOrContainer(action, renderer, lView[INJECTOR], parentRElement, rNode, tProjectionNode, beforeNode, lView);\n }\n } else {\n let nodeToProject = nodeToProjectOrRNodes;\n const projectedComponentLView = componentLView[PARENT];\n if (hasInSkipHydrationBlockFlag(tProjectionNode)) {\n nodeToProject.flags |= 128;\n }\n applyNodes(renderer, action, nodeToProject, projectedComponentLView, parentRElement, beforeNode, true);\n }\n}\nfunction applyContainer(renderer, action, injector, lContainer, tNode, parentRElement, beforeNode) {\n ngDevMode && assertLContainer(lContainer);\n const anchor = lContainer[NATIVE];\n const native = unwrapRNode(lContainer);\n if (anchor !== native) {\n applyToElementOrContainer(action, renderer, injector, parentRElement, anchor, tNode, beforeNode);\n }\n if ((lContainer[FLAGS] & 4) !== 0) {\n return;\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lView = lContainer[i];\n applyView(lView[TVIEW$1], lView, renderer, action, parentRElement, anchor);\n }\n}\nfunction applyStyling(renderer, isClassBased, rNode, prop, value) {\n if (isClassBased) {\n if (!value) {\n renderer.removeClass(rNode, prop);\n } else {\n renderer.addClass(rNode, prop);\n }\n } else {\n let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;\n if (value == null) {\n renderer.removeStyle(rNode, prop, flags);\n } else {\n const isImportant = typeof value === 'string' ? value.endsWith('!important') : false;\n if (isImportant) {\n value = value.slice(0, -10);\n flags |= RendererStyleFlags2.Important;\n }\n renderer.setStyle(rNode, prop, value, flags);\n }\n }\n}\n\nfunction createTView(type, declTNode, templateFn, decls, vars, directives, pipes, viewQuery, schemas, constsOrFactory, ssrId) {\n const bindingStartIndex = HEADER_OFFSET + decls;\n const initialViewLength = bindingStartIndex + vars;\n const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);\n const consts = typeof constsOrFactory === 'function' ? constsOrFactory() : constsOrFactory;\n const tView = blueprint[TVIEW$1] = {\n type: type,\n blueprint: blueprint,\n template: templateFn,\n queries: null,\n viewQuery: viewQuery,\n declTNode: declTNode,\n data: blueprint.slice().fill(null, bindingStartIndex),\n bindingStartIndex: bindingStartIndex,\n expandoStartIndex: initialViewLength,\n hostBindingOpCodes: null,\n firstCreatePass: true,\n firstUpdatePass: true,\n staticViewQueries: false,\n staticContentQueries: false,\n preOrderHooks: null,\n preOrderCheckHooks: null,\n contentHooks: null,\n contentCheckHooks: null,\n viewHooks: null,\n viewCheckHooks: null,\n destroyHooks: null,\n cleanup: null,\n contentQueries: null,\n components: null,\n directiveRegistry: typeof directives === 'function' ? directives() : directives,\n pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,\n firstChild: null,\n schemas: schemas,\n consts: consts,\n incompleteFirstPass: false,\n ssrId\n };\n if (ngDevMode) {\n Object.seal(tView);\n }\n return tView;\n}\nfunction createViewBlueprint(bindingStartIndex, initialViewLength) {\n const blueprint = [];\n for (let i = 0; i < initialViewLength; i++) {\n blueprint.push(i < bindingStartIndex ? null : NO_CHANGE);\n }\n return blueprint;\n}\nfunction getOrCreateComponentTView(def) {\n const tView = def.tView;\n if (tView === null || tView.incompleteFirstPass) {\n const declTNode = null;\n return def.tView = createTView(1, declTNode, def.template, def.decls, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery, def.schemas, def.consts, def.id);\n }\n return tView;\n}\nfunction createLView(parentLView, tView, context, flags, host, tHostNode, environment, renderer, injector, embeddedViewInjector, hydrationInfo) {\n const lView = tView.blueprint.slice();\n lView[HOST] = host;\n lView[FLAGS] = flags | 4 | 128 | 8 | 64 | 1024;\n if (embeddedViewInjector !== null || parentLView && parentLView[FLAGS] & 2048) {\n lView[FLAGS] |= 2048;\n }\n resetPreOrderHookFlags(lView);\n ngDevMode && tView.declTNode && parentLView && assertTNodeForLView(tView.declTNode, parentLView);\n lView[PARENT] = lView[DECLARATION_VIEW] = parentLView;\n lView[CONTEXT] = context;\n lView[ENVIRONMENT] = environment || parentLView && parentLView[ENVIRONMENT];\n ngDevMode && assertDefined(lView[ENVIRONMENT], 'LViewEnvironment is required');\n lView[RENDERER] = renderer || parentLView && parentLView[RENDERER];\n ngDevMode && assertDefined(lView[RENDERER], 'Renderer is required');\n lView[INJECTOR] = injector || parentLView && parentLView[INJECTOR] || null;\n lView[T_HOST] = tHostNode;\n lView[ID] = getUniqueLViewId();\n lView[HYDRATION] = hydrationInfo;\n lView[EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector;\n ngDevMode && assertEqual(tView.type == 2 ? parentLView !== null : true, true, 'Embedded views must have parentLView');\n lView[DECLARATION_COMPONENT_VIEW] = tView.type == 2 ? parentLView[DECLARATION_COMPONENT_VIEW] : lView;\n return lView;\n}\nfunction createComponentLView(lView, hostTNode, def) {\n const native = getNativeByTNode(hostTNode, lView);\n const tView = getOrCreateComponentTView(def);\n const rendererFactory = lView[ENVIRONMENT].rendererFactory;\n const componentView = addToEndOfViewTree(lView, createLView(lView, tView, null, getInitialLViewFlagsFromDef(def), native, hostTNode, null, rendererFactory.createRenderer(native, def), null, null, null));\n return lView[hostTNode.index] = componentView;\n}\nfunction getInitialLViewFlagsFromDef(def) {\n let flags = 16;\n if (def.signals) {\n flags = 4096;\n } else if (def.onPush) {\n flags = 64;\n }\n return flags;\n}\nfunction allocExpando(tView, lView, numSlotsToAlloc, initialValue) {\n if (numSlotsToAlloc === 0) return -1;\n if (ngDevMode) {\n assertFirstCreatePass(tView);\n assertSame(tView, lView[TVIEW$1], '`LView` must be associated with `TView`!');\n assertEqual(tView.data.length, lView.length, 'Expecting LView to be same size as TView');\n assertEqual(tView.data.length, tView.blueprint.length, 'Expecting Blueprint to be same size as TView');\n assertFirstUpdatePass(tView);\n }\n const allocIdx = lView.length;\n for (let i = 0; i < numSlotsToAlloc; i++) {\n lView.push(initialValue);\n tView.blueprint.push(initialValue);\n tView.data.push(null);\n }\n return allocIdx;\n}\nfunction addToEndOfViewTree(lView, lViewOrLContainer) {\n if (lView[CHILD_HEAD]) {\n lView[CHILD_TAIL][NEXT] = lViewOrLContainer;\n } else {\n lView[CHILD_HEAD] = lViewOrLContainer;\n }\n lView[CHILD_TAIL] = lViewOrLContainer;\n return lViewOrLContainer;\n}\n\nfunction ษตษตadvance(delta = 1) {\n ngDevMode && assertGreaterThan(delta, 0, 'Can only advance forward');\n selectIndexInternal(getTView(), getLView(), getSelectedIndex() + delta, !!ngDevMode && isInCheckNoChangesMode());\n}\nfunction selectIndexInternal(tView, lView, index, checkNoChangesMode) {\n ngDevMode && assertIndexInDeclRange(lView[TVIEW$1], index);\n if (!checkNoChangesMode) {\n const hooksInitPhaseCompleted = (lView[FLAGS] & 3) === 3;\n if (hooksInitPhaseCompleted) {\n const preOrderCheckHooks = tView.preOrderCheckHooks;\n if (preOrderCheckHooks !== null) {\n executeCheckHooks(lView, preOrderCheckHooks, index);\n }\n } else {\n const preOrderHooks = tView.preOrderHooks;\n if (preOrderHooks !== null) {\n executeInitAndCheckHooks(lView, preOrderHooks, 0, index);\n }\n }\n }\n setSelectedIndex(index);\n}\n\nvar InputFlags = /*#__PURE__*/ (function (InputFlags) {\n InputFlags[InputFlags[\"None\"] = 0] = \"None\";\n InputFlags[InputFlags[\"SignalBased\"] = 1] = \"SignalBased\";\n InputFlags[InputFlags[\"HasDecoratorInputTransform\"] = 2] = \"HasDecoratorInputTransform\";\n; return InputFlags;})(InputFlags || {});\n\n\nfunction writeToDirectiveInput(def, instance, publicName, value) {\n const prevConsumer = setActiveConsumer(null);\n try {\n if (ngDevMode) {\n if (!Object.hasOwn(def.inputs, publicName)) {\n throw new Error(`ASSERTION ERROR: Directive ${def.type.name} does not have an input with a public name of \"${publicName}\"`);\n }\n if (instance instanceof NodeInjectorFactory) {\n throw new Error(`ASSERTION ERROR: Cannot write input to factory for type ${def.type.name}. Directive has not been created yet.`);\n }\n }\n const [privateName, flags, transform] = def.inputs[publicName];\n let inputSignalNode = null;\n if ((flags & InputFlags.SignalBased) !== 0) {\n const field = instance[privateName];\n inputSignalNode = field[SIGNAL];\n }\n if (inputSignalNode !== null && inputSignalNode.transformFn !== undefined) {\n value = inputSignalNode.transformFn(value);\n } else if (transform !== null) {\n value = transform.call(instance, value);\n }\n if (def.setInput !== null) {\n def.setInput(instance, inputSignalNode, value, publicName, privateName);\n } else {\n applyValueToInputField(instance, inputSignalNode, privateName, value);\n }\n } finally {\n setActiveConsumer(prevConsumer);\n }\n}\n\nfunction executeTemplate(tView, lView, templateFn, rf, context) {\n const prevSelectedIndex = getSelectedIndex();\n const isUpdatePhase = rf & 2;\n try {\n setSelectedIndex(-1);\n if (isUpdatePhase && lView.length > HEADER_OFFSET) {\n selectIndexInternal(tView, lView, HEADER_OFFSET, !!ngDevMode && isInCheckNoChangesMode());\n }\n const preHookType = isUpdatePhase ? ProfilerEvent.TemplateUpdateStart : ProfilerEvent.TemplateCreateStart;\n profiler(preHookType, context, templateFn);\n templateFn(rf, context);\n } finally {\n setSelectedIndex(prevSelectedIndex);\n const postHookType = isUpdatePhase ? ProfilerEvent.TemplateUpdateEnd : ProfilerEvent.TemplateCreateEnd;\n profiler(postHookType, context, templateFn);\n }\n}\nfunction createDirectivesInstances(tView, lView, tNode) {\n instantiateAllDirectives(tView, lView, tNode);\n if ((tNode.flags & 64) === 64) {\n invokeDirectivesHostBindings(tView, lView, tNode);\n }\n}\nfunction saveResolvedLocalsInData(viewData, tNode, localRefExtractor = getNativeByTNode) {\n const localNames = tNode.localNames;\n if (localNames !== null) {\n let localIndex = tNode.index + 1;\n for (let i = 0; i < localNames.length; i += 2) {\n const index = localNames[i + 1];\n const value = index === -1 ? localRefExtractor(tNode, viewData) : viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}\nfunction locateHostElement(renderer, elementOrSelector, encapsulation, injector) {\n const preserveHostContent = injector.get(PRESERVE_HOST_CONTENT, PRESERVE_HOST_CONTENT_DEFAULT);\n const preserveContent = preserveHostContent || encapsulation === ViewEncapsulation.ShadowDom || encapsulation === ViewEncapsulation.ExperimentalIsolatedShadowDom;\n const rootElement = renderer.selectRootElement(elementOrSelector, preserveContent);\n applyRootElementTransform(rootElement);\n return rootElement;\n}\nfunction applyRootElementTransform(rootElement) {\n _applyRootElementTransformImpl(rootElement);\n}\nlet _applyRootElementTransformImpl = () => null;\nfunction applyRootElementTransformImpl(rootElement) {\n if (hasSkipHydrationAttrOnRElement(rootElement)) {\n clearElementContents(rootElement);\n } else {\n processTextNodeMarkersBeforeHydration(rootElement);\n }\n}\nfunction enableApplyRootElementTransformImpl() {\n _applyRootElementTransformImpl = applyRootElementTransformImpl;\n}\nfunction mapPropName(name) {\n if (name === 'class') return 'className';\n if (name === 'for') return 'htmlFor';\n if (name === 'formaction') return 'formAction';\n if (name === 'innerHtml') return 'innerHTML';\n if (name === 'readonly') return 'readOnly';\n if (name === 'tabindex') return 'tabIndex';\n return name;\n}\nfunction setPropertyAndInputs(tNode, lView, propName, value, renderer, sanitizer) {\n ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n const tView = lView[TVIEW$1];\n const hasSetInput = setAllInputsForProperty(tNode, tView, lView, propName, value);\n if (hasSetInput) {\n isComponentHost(tNode) && markDirtyIfOnPush(lView, tNode.index);\n ngDevMode && setNgReflectProperties(lView, tView, tNode, propName, value);\n return;\n }\n if (tNode.type & 3) {\n propName = mapPropName(propName);\n }\n setDomProperty(tNode, lView, propName, value, renderer, sanitizer);\n}\nfunction setDomProperty(tNode, lView, propName, value, renderer, sanitizer) {\n if (tNode.type & 3) {\n const element = getNativeByTNode(tNode, lView);\n if (ngDevMode) {\n if (lView[TVIEW$1].firstUpdatePass) {\n validateAgainstEventProperties(propName);\n }\n if (!isPropertyValid(element, propName, tNode.value, lView[TVIEW$1].schemas)) {\n handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);\n }\n }\n value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value;\n value = unwrapImgVideoSrcValue(propName, element, value);\n renderer.setProperty(element, propName, value);\n } else if (tNode.type & 12) {\n if (ngDevMode && !matchingSchemas(lView[TVIEW$1].schemas, tNode.value)) {\n handleUnknownPropertyError(propName, tNode.value, tNode.type, lView);\n }\n }\n}\nfunction unwrapImgVideoSrcValue(propName, element, value) {\n if (propName === 'src' && (element.tagName === 'IMG' || element.tagName === 'VIDEO')) {\n if (value == null) {\n return '';\n }\n return unwrapSafeValue(value);\n }\n return value;\n}\nfunction markDirtyIfOnPush(lView, viewIndex) {\n ngDevMode && assertLView(lView);\n const childComponentLView = getComponentLViewByIndex(viewIndex, lView);\n if (!(childComponentLView[FLAGS] & 16)) {\n childComponentLView[FLAGS] |= 64;\n }\n}\nfunction setNgReflectProperty(lView, tNode, attrName, value) {\n const environment = lView[ENVIRONMENT];\n if (!environment.ngReflect) {\n return;\n }\n const element = getNativeByTNode(tNode, lView);\n const renderer = lView[RENDERER];\n attrName = normalizeDebugBindingName(attrName);\n const debugValue = normalizeDebugBindingValue(value);\n if (tNode.type & 3) {\n if (value == null) {\n renderer.removeAttribute(element, attrName);\n } else {\n renderer.setAttribute(element, attrName, debugValue);\n }\n } else {\n const textContent = escapeCommentText(`bindings=${JSON.stringify({\n [attrName]: debugValue\n }, null, 2)}`);\n renderer.setValue(element, textContent);\n }\n}\nfunction setNgReflectProperties(lView, tView, tNode, publicName, value) {\n const environment = lView[ENVIRONMENT];\n if (!environment.ngReflect || !(tNode.type & (3 | 4))) {\n return;\n }\n const inputConfig = tNode.inputs?.[publicName];\n const hostInputConfig = tNode.hostDirectiveInputs?.[publicName];\n if (hostInputConfig) {\n for (let i = 0; i < hostInputConfig.length; i += 2) {\n const index = hostInputConfig[i];\n const publicName = hostInputConfig[i + 1];\n const def = tView.data[index];\n setNgReflectProperty(lView, tNode, def.inputs[publicName][0], value);\n }\n }\n if (inputConfig) {\n for (const index of inputConfig) {\n const def = tView.data[index];\n setNgReflectProperty(lView, tNode, def.inputs[publicName][0], value);\n }\n }\n}\nfunction instantiateAllDirectives(tView, lView, tNode) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n if (isComponentHost(tNode)) {\n ngDevMode && assertTNodeType(tNode, 3);\n createComponentLView(lView, tNode, tView.data[start + tNode.componentOffset]);\n }\n if (!tView.firstCreatePass) {\n getOrCreateNodeInjectorForNode(tNode, lView);\n }\n const initialInputs = tNode.initialInputs;\n for (let i = start; i < end; i++) {\n const def = tView.data[i];\n const directive = getNodeInjectable(lView, tView, i, tNode);\n attachPatchData(directive, lView);\n if (initialInputs !== null) {\n setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs);\n }\n if (isComponentDef(def)) {\n const componentView = getComponentLViewByIndex(tNode.index, lView);\n componentView[CONTEXT] = getNodeInjectable(lView, tView, i, tNode);\n }\n }\n}\nfunction invokeDirectivesHostBindings(tView, lView, tNode) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n const elementIndex = tNode.index;\n const currentDirectiveIndex = getCurrentDirectiveIndex();\n try {\n setSelectedIndex(elementIndex);\n for (let dirIndex = start; dirIndex < end; dirIndex++) {\n const def = tView.data[dirIndex];\n const directive = lView[dirIndex];\n setCurrentDirectiveIndex(dirIndex);\n if (def.hostBindings !== null || def.hostVars !== 0 || def.hostAttrs !== null) {\n invokeHostBindingsInCreationMode(def, directive);\n }\n }\n } finally {\n setSelectedIndex(-1);\n setCurrentDirectiveIndex(currentDirectiveIndex);\n }\n}\nfunction invokeHostBindingsInCreationMode(def, directive) {\n if (def.hostBindings !== null) {\n def.hostBindings(1, directive);\n }\n}\nfunction findDirectiveDefMatches(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertTNodeType(tNode, 3 | 12);\n const registry = tView.directiveRegistry;\n let matches = null;\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors, false)) {\n matches ??= [];\n if (isComponentDef(def)) {\n if (ngDevMode) {\n assertTNodeType(tNode, 2, `\"${tNode.value}\" tags cannot be used as component hosts. ` + `Please use a different tag to activate the ${stringify(def.type)} component.`);\n if (matches.length && isComponentDef(matches[0])) {\n throwMultipleComponentError(tNode, matches.find(isComponentDef).type, def.type);\n }\n }\n matches.unshift(def);\n } else {\n matches.push(def);\n }\n }\n }\n }\n return matches;\n}\nfunction elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace) {\n if (ngDevMode) {\n assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n assertTNodeType(tNode, 2, `Attempted to set attribute \\`${name}\\` on a container node. ` + `Host bindings are not valid on ng-container or ng-template.`);\n }\n const element = getNativeByTNode(tNode, lView);\n value = unwrapImgVideoSrcValue(name, element, value);\n setElementAttribute(lView[RENDERER], element, namespace, tNode.value, name, value, sanitizer);\n}\nfunction setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {\n if (value == null) {\n if (sanitizer != null) {\n sanitizer(value, tagName || '', name);\n }\n renderer.removeAttribute(element, name, namespace);\n } else {\n const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);\n renderer.setAttribute(element, name, strValue, namespace);\n }\n}\nfunction setInputsFromAttrs(lView, directiveIndex, instance, def, tNode, initialInputData) {\n const initialInputs = initialInputData[directiveIndex];\n if (initialInputs !== null) {\n for (let i = 0; i < initialInputs.length; i += 2) {\n const lookupName = initialInputs[i];\n const value = initialInputs[i + 1];\n writeToDirectiveInput(def, instance, lookupName, value);\n if (ngDevMode) {\n setNgReflectProperty(lView, tNode, def.inputs[lookupName][0], value);\n }\n }\n }\n}\nfunction elementLikeStartShared(tNode, lView, index, name, locateOrCreateNativeNode) {\n const adjustedIndex = HEADER_OFFSET + index;\n const tView = lView[TVIEW$1];\n const native = locateOrCreateNativeNode(tView, lView, tNode, name, index);\n lView[adjustedIndex] = native;\n setCurrentTNode(tNode, true);\n const isElement = tNode.type === 2;\n if (isElement) {\n setupStaticAttributes(lView[RENDERER], native, tNode);\n if (getElementDepthCount() === 0 || isDirectiveHost(tNode)) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n } else {\n attachPatchData(native, lView);\n }\n if (wasLastNodeCreated() && (!isElement || !isDetachedByI18n(tNode))) {\n appendChild(tView, lView, native, tNode);\n }\n return tNode;\n}\nfunction elementLikeEndShared(tNode) {\n let currentTNode = tNode;\n if (isCurrentTNodeParent()) {\n setCurrentTNodeAsNotParent();\n } else {\n ngDevMode && assertHasParent(getCurrentTNode());\n currentTNode = currentTNode.parent;\n setCurrentTNode(currentTNode, false);\n }\n return currentTNode;\n}\nfunction storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex, ...interpolationParts) {\n if (tData[bindingIndex] === null) {\n if (!tNode.inputs?.[propertyName] && !tNode.hostDirectiveInputs?.[propertyName]) {\n const propBindingIdxs = tNode.propertyBindings || (tNode.propertyBindings = []);\n propBindingIdxs.push(bindingIndex);\n let bindingMetadata = propertyName;\n if (interpolationParts.length > 0) {\n bindingMetadata += INTERPOLATION_DELIMITER + interpolationParts.join(INTERPOLATION_DELIMITER);\n }\n tData[bindingIndex] = bindingMetadata;\n }\n }\n}\nfunction loadComponentRenderer(currentDef, tNode, lView) {\n if (currentDef === null || isComponentDef(currentDef)) {\n lView = unwrapLView(lView[tNode.index]);\n }\n return lView[RENDERER];\n}\nfunction handleUncaughtError(lView, error) {\n const injector = lView[INJECTOR];\n if (!injector) {\n return;\n }\n let errorHandler;\n try {\n errorHandler = injector.get(INTERNAL_APPLICATION_ERROR_HANDLER, null);\n } catch {\n errorHandler = null;\n }\n errorHandler?.(error);\n}\nfunction setAllInputsForProperty(tNode, tView, lView, publicName, value) {\n const inputs = tNode.inputs?.[publicName];\n const hostDirectiveInputs = tNode.hostDirectiveInputs?.[publicName];\n let hasMatch = false;\n if (hostDirectiveInputs) {\n for (let i = 0; i < hostDirectiveInputs.length; i += 2) {\n const index = hostDirectiveInputs[i];\n ngDevMode && assertIndexInRange(lView, index);\n const publicName = hostDirectiveInputs[i + 1];\n const def = tView.data[index];\n writeToDirectiveInput(def, lView[index], publicName, value);\n hasMatch = true;\n }\n }\n if (inputs) {\n for (const index of inputs) {\n ngDevMode && assertIndexInRange(lView, index);\n const instance = lView[index];\n const def = tView.data[index];\n writeToDirectiveInput(def, instance, publicName, value);\n hasMatch = true;\n }\n }\n return hasMatch;\n}\nfunction setDirectiveInput(tNode, tView, lView, target, publicName, value) {\n let hostIndex = null;\n let hostDirectivesStart = null;\n let hostDirectivesEnd = null;\n let hasSet = false;\n if (ngDevMode && !tNode.directiveToIndex?.has(target.type)) {\n throw new Error(`Node does not have a directive with type ${target.type.name}`);\n }\n const data = tNode.directiveToIndex.get(target.type);\n if (typeof data === 'number') {\n hostIndex = data;\n } else {\n [hostIndex, hostDirectivesStart, hostDirectivesEnd] = data;\n }\n if (hostDirectivesStart !== null && hostDirectivesEnd !== null && tNode.hostDirectiveInputs && Object.hasOwn(tNode.hostDirectiveInputs, publicName)) {\n const hostDirectiveInputs = tNode.hostDirectiveInputs[publicName];\n for (let i = 0; i < hostDirectiveInputs.length; i += 2) {\n const index = hostDirectiveInputs[i];\n if (index >= hostDirectivesStart && index <= hostDirectivesEnd) {\n ngDevMode && assertIndexInRange(lView, index);\n const def = tView.data[index];\n const hostDirectivePublicName = hostDirectiveInputs[i + 1];\n writeToDirectiveInput(def, lView[index], hostDirectivePublicName, value);\n hasSet = true;\n } else if (index > hostDirectivesEnd) {\n break;\n }\n }\n }\n if (hostIndex !== null && Object.hasOwn(target.inputs, publicName)) {\n ngDevMode && assertIndexInRange(lView, hostIndex);\n writeToDirectiveInput(target, lView[hostIndex], publicName, value);\n hasSet = true;\n }\n return hasSet;\n}\n\nfunction renderComponent(hostLView, componentHostIdx) {\n ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');\n const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);\n const componentTView = componentView[TVIEW$1];\n syncViewWithBlueprint(componentTView, componentView);\n const hostRNode = componentView[HOST];\n if (hostRNode !== null && componentView[HYDRATION] === null) {\n componentView[HYDRATION] = retrieveHydrationInfo(hostRNode, componentView[INJECTOR]);\n }\n profiler(ProfilerEvent.ComponentStart);\n try {\n renderView(componentTView, componentView, componentView[CONTEXT]);\n } finally {\n profiler(ProfilerEvent.ComponentEnd, componentView[CONTEXT]);\n }\n}\nfunction syncViewWithBlueprint(tView, lView) {\n for (let i = lView.length; i < tView.blueprint.length; i++) {\n lView.push(tView.blueprint[i]);\n }\n}\nfunction renderView(tView, lView, context) {\n ngDevMode && assertEqual(isCreationMode(lView), true, 'Should be run in creation mode');\n ngDevMode && assertNotReactive(renderView.name);\n enterView(lView);\n try {\n const viewQuery = tView.viewQuery;\n if (viewQuery !== null) {\n executeViewQueryFn(1, viewQuery, context);\n }\n const templateFn = tView.template;\n if (templateFn !== null) {\n executeTemplate(tView, lView, templateFn, 1, context);\n }\n if (tView.firstCreatePass) {\n tView.firstCreatePass = false;\n }\n lView[QUERIES]?.finishViewCreation(tView);\n if (tView.staticContentQueries) {\n refreshContentQueries(tView, lView);\n }\n if (tView.staticViewQueries) {\n executeViewQueryFn(2, tView.viewQuery, context);\n }\n const components = tView.components;\n if (components !== null) {\n renderChildComponents(lView, components);\n }\n } catch (error) {\n if (tView.firstCreatePass) {\n tView.incompleteFirstPass = true;\n tView.firstCreatePass = false;\n }\n throw error;\n } finally {\n lView[FLAGS] &= -5;\n leaveView();\n }\n}\nfunction renderChildComponents(hostLView, components) {\n for (let i = 0; i < components.length; i++) {\n renderComponent(hostLView, components[i]);\n }\n}\n\nfunction createAndRenderEmbeddedLView(declarationLView, templateTNode, context, options) {\n const prevConsumer = setActiveConsumer(null);\n try {\n const embeddedTView = templateTNode.tView;\n ngDevMode && assertDefined(embeddedTView, 'TView must be defined for a template node.');\n ngDevMode && assertTNodeForLView(templateTNode, declarationLView);\n const isSignalView = declarationLView[FLAGS] & 4096;\n const viewFlags = isSignalView ? 4096 : 16;\n const embeddedLView = createLView(declarationLView, embeddedTView, context, viewFlags, null, templateTNode, null, null, options?.injector ?? null, options?.embeddedViewInjector ?? null, options?.dehydratedView ?? null);\n const declarationLContainer = declarationLView[templateTNode.index];\n ngDevMode && assertLContainer(declarationLContainer);\n embeddedLView[DECLARATION_LCONTAINER] = declarationLContainer;\n const declarationViewLQueries = declarationLView[QUERIES];\n if (declarationViewLQueries !== null) {\n embeddedLView[QUERIES] = declarationViewLQueries.createEmbeddedView(embeddedTView);\n }\n renderView(embeddedTView, embeddedLView, context);\n return embeddedLView;\n } finally {\n setActiveConsumer(prevConsumer);\n }\n}\nfunction shouldAddViewToDom(tNode, dehydratedView) {\n return !dehydratedView || dehydratedView.firstChild === null || hasInSkipHydrationBlockFlag(tNode);\n}\n\nconst USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT = false;\nconst UseExhaustiveCheckNoChanges = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'exhaustive checkNoChanges' : '');\n\nfunction collectNativeNodes(tView, lView, tNode, result, isProjection = false) {\n if (tView.type === 3) {\n const headTNode = tView.firstChild;\n const tailTNode = headTNode.next;\n const head = unwrapRNode(lView[headTNode.index]);\n const tail = unwrapRNode(lView[tailTNode.index]);\n let current = head;\n while (current !== null) {\n result.push(current);\n if (current === tail) break;\n current = current.nextSibling;\n }\n return result;\n }\n while (tNode !== null) {\n if (tNode.type === 128) {\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n continue;\n }\n ngDevMode && assertTNodeType(tNode, 3 | 12 | 16 | 32);\n const lNode = lView[tNode.index];\n if (lNode !== null) {\n if (isLContainer(lNode)) {\n const anchor = lNode[NATIVE];\n if (anchor !== lNode[HOST]) {\n result.push(unwrapRNode(lNode));\n }\n if (!(lNode[FLAGS] & 4)) {\n collectNativeNodesInLContainer(lNode, result);\n }\n result.push(anchor);\n } else {\n result.push(unwrapRNode(lNode));\n }\n }\n const tNodeType = tNode.type;\n if (tNodeType & 8) {\n collectNativeNodes(tView, lView, tNode.child, result);\n } else if (tNodeType & 32) {\n const nextRNode = icuContainerIterate(tNode, lView);\n let rNode;\n while (rNode = nextRNode()) {\n result.push(rNode);\n }\n } else if (tNodeType & 16) {\n const nodesInSlot = getProjectionNodes(lView, tNode);\n if (Array.isArray(nodesInSlot)) {\n result.push(...nodesInSlot);\n } else {\n const parentView = getLViewParent(lView[DECLARATION_COMPONENT_VIEW]);\n ngDevMode && assertParentView(parentView);\n collectNativeNodes(parentView[TVIEW$1], parentView, nodesInSlot, result, true);\n }\n }\n tNode = isProjection ? tNode.projectionNext : tNode.next;\n }\n return result;\n}\nfunction collectNativeNodesInLContainer(lContainer, result) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const lViewInAContainer = lContainer[i];\n const lViewFirstChildTNode = lViewInAContainer[TVIEW$1].firstChild;\n if (lViewFirstChildTNode !== null) {\n collectNativeNodes(lViewInAContainer[TVIEW$1], lViewInAContainer, lViewFirstChildTNode, result);\n }\n }\n}\n\nfunction addAfterRenderSequencesForView(lView) {\n if (lView[AFTER_RENDER_SEQUENCES_TO_ADD] !== null) {\n for (const sequence of lView[AFTER_RENDER_SEQUENCES_TO_ADD]) {\n sequence.impl.addSequence(sequence);\n }\n lView[AFTER_RENDER_SEQUENCES_TO_ADD].length = 0;\n }\n}\n\nlet freeConsumers = [];\nfunction getOrBorrowReactiveLViewConsumer(lView) {\n return lView[REACTIVE_TEMPLATE_CONSUMER] ?? borrowReactiveLViewConsumer(lView);\n}\nfunction borrowReactiveLViewConsumer(lView) {\n const consumer = freeConsumers.pop() ?? Object.create(REACTIVE_LVIEW_CONSUMER_NODE);\n consumer.lView = lView;\n return consumer;\n}\nfunction maybeReturnReactiveLViewConsumer(consumer) {\n if (consumer.lView[REACTIVE_TEMPLATE_CONSUMER] === consumer) {\n return;\n }\n consumer.lView = null;\n freeConsumers.push(consumer);\n}\nconst REACTIVE_LVIEW_CONSUMER_NODE = {\n ...REACTIVE_NODE,\n consumerIsAlwaysLive: true,\n kind: 'template',\n consumerMarkedDirty: node => {\n markAncestorsForTraversal(node.lView);\n },\n consumerOnSignalRead() {\n this.lView[REACTIVE_TEMPLATE_CONSUMER] = this;\n }\n};\nfunction getOrCreateTemporaryConsumer(lView) {\n const consumer = lView[REACTIVE_TEMPLATE_CONSUMER] ?? Object.create(TEMPORARY_CONSUMER_NODE);\n consumer.lView = lView;\n return consumer;\n}\nconst TEMPORARY_CONSUMER_NODE = {\n ...REACTIVE_NODE,\n consumerIsAlwaysLive: true,\n kind: 'template',\n consumerMarkedDirty: node => {\n let parent = getLViewParent(node.lView);\n while (parent && !viewShouldHaveReactiveConsumer(parent[TVIEW$1])) {\n parent = getLViewParent(parent);\n }\n if (!parent) {\n return;\n }\n markViewForRefresh(parent);\n },\n consumerOnSignalRead() {\n this.lView[REACTIVE_TEMPLATE_CONSUMER] = this;\n }\n};\nfunction viewShouldHaveReactiveConsumer(tView) {\n return tView.type !== 2;\n}\nfunction isReactiveLViewConsumer(node) {\n return node.kind === 'template';\n}\n\nfunction runEffectsInView(view) {\n if (view[EFFECTS] === null) {\n return;\n }\n let tryFlushEffects = true;\n while (tryFlushEffects) {\n let foundDirtyEffect = false;\n for (const effect of view[EFFECTS]) {\n if (!effect.dirty) {\n continue;\n }\n foundDirtyEffect = true;\n if (effect.zone === null || Zone.current === effect.zone) {\n effect.run();\n } else {\n effect.zone.run(() => effect.run());\n }\n if (view[EFFECTS] === null) {\n return;\n }\n }\n tryFlushEffects = foundDirtyEffect && !!(view[FLAGS] & 8192);\n }\n}\n\nconst MAXIMUM_REFRESH_RERUNS$1 = 100;\nfunction detectChangesInternal(lView, mode = 0) {\n const environment = lView[ENVIRONMENT];\n const rendererFactory = environment.rendererFactory;\n const checkNoChangesMode = !!ngDevMode && isInCheckNoChangesMode();\n if (!checkNoChangesMode) {\n rendererFactory.begin?.();\n }\n try {\n detectChangesInViewWhileDirty(lView, mode);\n } finally {\n if (!checkNoChangesMode) {\n rendererFactory.end?.();\n }\n }\n}\nfunction detectChangesInViewWhileDirty(lView, mode) {\n const lastIsRefreshingViewsValue = isRefreshingViews();\n try {\n setIsRefreshingViews(true);\n detectChangesInView(lView, mode);\n if (ngDevMode && isExhaustiveCheckNoChanges()) {\n return;\n }\n let retries = 0;\n while (requiresRefreshOrTraversal(lView)) {\n if (retries === MAXIMUM_REFRESH_RERUNS$1) {\n throw new RuntimeError(103, ngDevMode && 'Infinite change detection while trying to refresh views. ' + 'There may be components which each cause the other to require a refresh, ' + 'causing an infinite loop.');\n }\n retries++;\n detectChangesInView(lView, 1);\n }\n } finally {\n setIsRefreshingViews(lastIsRefreshingViewsValue);\n }\n}\nfunction checkNoChangesInternal(lView, exhaustive) {\n setIsInCheckNoChangesMode(exhaustive ? CheckNoChangesMode.Exhaustive : CheckNoChangesMode.OnlyDirtyViews);\n try {\n detectChangesInternal(lView);\n } finally {\n setIsInCheckNoChangesMode(CheckNoChangesMode.Off);\n }\n}\nfunction refreshView(tView, lView, templateFn, context) {\n ngDevMode && assertEqual(isCreationMode(lView), false, 'Should be run in update mode');\n if (isDestroyed(lView)) return;\n const flags = lView[FLAGS];\n const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();\n const isInExhaustiveCheckNoChangesPass = ngDevMode && isExhaustiveCheckNoChanges();\n enterView(lView);\n let returnConsumerToPool = true;\n let prevConsumer = null;\n let currentConsumer = null;\n if (!isInCheckNoChangesPass) {\n if (viewShouldHaveReactiveConsumer(tView)) {\n currentConsumer = getOrBorrowReactiveLViewConsumer(lView);\n prevConsumer = consumerBeforeComputation(currentConsumer);\n } else if (getActiveConsumer() === null) {\n returnConsumerToPool = false;\n currentConsumer = getOrCreateTemporaryConsumer(lView);\n prevConsumer = consumerBeforeComputation(currentConsumer);\n } else if (lView[REACTIVE_TEMPLATE_CONSUMER]) {\n consumerDestroy(lView[REACTIVE_TEMPLATE_CONSUMER]);\n lView[REACTIVE_TEMPLATE_CONSUMER] = null;\n }\n }\n try {\n resetPreOrderHookFlags(lView);\n setBindingIndex(tView.bindingStartIndex);\n if (templateFn !== null) {\n executeTemplate(tView, lView, templateFn, 2, context);\n }\n const hooksInitPhaseCompleted = (flags & 3) === 3;\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const preOrderCheckHooks = tView.preOrderCheckHooks;\n if (preOrderCheckHooks !== null) {\n executeCheckHooks(lView, preOrderCheckHooks, null);\n }\n } else {\n const preOrderHooks = tView.preOrderHooks;\n if (preOrderHooks !== null) {\n executeInitAndCheckHooks(lView, preOrderHooks, 0, null);\n }\n incrementInitPhaseFlags(lView, 0);\n }\n }\n if (!isInExhaustiveCheckNoChangesPass) {\n markTransplantedViewsForRefresh(lView);\n }\n runEffectsInView(lView);\n detectChangesInEmbeddedViews(lView, 0);\n if (tView.contentQueries !== null) {\n refreshContentQueries(tView, lView);\n }\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const contentCheckHooks = tView.contentCheckHooks;\n if (contentCheckHooks !== null) {\n executeCheckHooks(lView, contentCheckHooks);\n }\n } else {\n const contentHooks = tView.contentHooks;\n if (contentHooks !== null) {\n executeInitAndCheckHooks(lView, contentHooks, 1);\n }\n incrementInitPhaseFlags(lView, 1);\n }\n }\n processHostBindingOpCodes(tView, lView);\n const components = tView.components;\n if (components !== null) {\n detectChangesInChildComponents(lView, components, 0);\n }\n const viewQuery = tView.viewQuery;\n if (viewQuery !== null) {\n executeViewQueryFn(2, viewQuery, context);\n }\n if (!isInCheckNoChangesPass) {\n if (hooksInitPhaseCompleted) {\n const viewCheckHooks = tView.viewCheckHooks;\n if (viewCheckHooks !== null) {\n executeCheckHooks(lView, viewCheckHooks);\n }\n } else {\n const viewHooks = tView.viewHooks;\n if (viewHooks !== null) {\n executeInitAndCheckHooks(lView, viewHooks, 2);\n }\n incrementInitPhaseFlags(lView, 2);\n }\n }\n if (tView.firstUpdatePass === true) {\n tView.firstUpdatePass = false;\n }\n if (lView[EFFECTS_TO_SCHEDULE]) {\n for (const notifyEffect of lView[EFFECTS_TO_SCHEDULE]) {\n notifyEffect();\n }\n lView[EFFECTS_TO_SCHEDULE] = null;\n }\n if (!isInCheckNoChangesPass) {\n addAfterRenderSequencesForView(lView);\n lView[FLAGS] &= ~(64 | 8);\n }\n } catch (e) {\n handleViewError(lView, e, isInCheckNoChangesPass);\n } finally {\n if (currentConsumer !== null) {\n consumerAfterComputation(currentConsumer, prevConsumer);\n if (returnConsumerToPool) {\n maybeReturnReactiveLViewConsumer(currentConsumer);\n }\n }\n leaveView();\n }\n}\nfunction handleViewError(lView, e, isInCheckNoChangesPass) {\n let handled = false;\n let errorToHandle = e;\n let currentLView = lView;\n const prevConsumer = setActiveConsumer(null);\n try {\n while (currentLView !== null) {\n if (isLContainer(currentLView)) {\n currentLView = currentLView[PARENT];\n continue;\n }\n const onError = currentLView[ON_ERROR];\n if (onError) {\n try {\n const declarationInstance = lView[DECLARATION_COMPONENT_VIEW][CONTEXT];\n const declarationType = declarationInstance?.constructor;\n const details = {\n declarationInstance,\n declarationType,\n caughtBy: onError\n };\n const prevConsumer = setActiveConsumer(null);\n try {\n onError(encapsulateBoundaryError(errorToHandle), details);\n } finally {\n setActiveConsumer(prevConsumer);\n }\n handled = true;\n break;\n } catch (boundaryError) {\n errorToHandle = boundaryError;\n }\n }\n currentLView = currentLView[PARENT];\n }\n } finally {\n setActiveConsumer(prevConsumer);\n }\n if (!handled) {\n if (!isInCheckNoChangesPass) {\n markAncestorsForTraversal(lView);\n }\n throw errorToHandle;\n }\n}\nfunction detectChangesInEmbeddedViews(lView, mode) {\n for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const embeddedLView = lContainer[i];\n detectChangesInViewIfAttached(embeddedLView, mode);\n }\n }\n}\nfunction markTransplantedViewsForRefresh(lView) {\n for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {\n if (!(lContainer[FLAGS] & 2)) continue;\n const movedViews = lContainer[MOVED_VIEWS];\n ngDevMode && assertDefined(movedViews, 'Transplanted View flags set but missing MOVED_VIEWS');\n for (let i = 0; i < movedViews.length; i++) {\n const movedLView = movedViews[i];\n markViewForRefresh(movedLView);\n }\n }\n}\nfunction detectChangesInComponent(hostLView, componentHostIdx, mode) {\n ngDevMode && assertEqual(isCreationMode(hostLView), false, 'Should be run in update mode');\n profiler(ProfilerEvent.ComponentStart);\n const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);\n try {\n detectChangesInViewIfAttached(componentView, mode);\n } finally {\n profiler(ProfilerEvent.ComponentEnd, componentView[CONTEXT]);\n }\n}\nfunction detectChangesInViewIfAttached(lView, mode) {\n if (!viewAttachedToChangeDetector(lView)) {\n return;\n }\n detectChangesInView(lView, mode);\n}\nfunction detectChangesInView(lView, mode) {\n const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();\n const tView = lView[TVIEW$1];\n const flags = lView[FLAGS];\n const consumer = lView[REACTIVE_TEMPLATE_CONSUMER];\n let shouldRefreshView = !!(mode === 0 && flags & 16);\n shouldRefreshView ||= !!(flags & 64 && mode === 0 && !isInCheckNoChangesPass);\n shouldRefreshView ||= !!(flags & 1024);\n shouldRefreshView ||= !!(consumer?.dirty && consumerPollProducersForChange(consumer));\n shouldRefreshView ||= !!(ngDevMode && isExhaustiveCheckNoChanges());\n if (consumer) {\n consumer.dirty = false;\n }\n lView[FLAGS] &= -9217;\n if (shouldRefreshView) {\n refreshView(tView, lView, tView.template, lView[CONTEXT]);\n } else if (flags & 8192) {\n const prevConsumer = setActiveConsumer(null);\n try {\n if (!isInCheckNoChangesPass) {\n try {\n runEffectsInView(lView);\n } catch (e) {\n handleViewError(lView, e, isInCheckNoChangesPass);\n }\n }\n detectChangesInEmbeddedViews(lView, 1);\n const components = tView.components;\n if (components !== null) {\n detectChangesInChildComponents(lView, components, 1);\n }\n if (!isInCheckNoChangesPass) {\n addAfterRenderSequencesForView(lView);\n }\n } finally {\n setActiveConsumer(prevConsumer);\n }\n }\n}\nfunction detectChangesInChildComponents(hostLView, components, mode) {\n for (let i = 0; i < components.length; i++) {\n detectChangesInComponent(hostLView, components[i], mode);\n }\n}\nfunction processHostBindingOpCodes(tView, lView) {\n const hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null) return;\n try {\n for (let i = 0; i < hostBindingOpCodes.length; i++) {\n const opCode = hostBindingOpCodes[i];\n if (opCode < 0) {\n setSelectedIndex(~opCode);\n } else {\n const directiveIdx = opCode;\n const bindingRootIndx = hostBindingOpCodes[++i];\n const hostBindingFn = hostBindingOpCodes[++i];\n setBindingRootForHostBindings(bindingRootIndx, directiveIdx);\n const context = lView[directiveIdx];\n profiler(ProfilerEvent.HostBindingsUpdateStart, context);\n try {\n hostBindingFn(2, context);\n } finally {\n profiler(ProfilerEvent.HostBindingsUpdateEnd, context);\n }\n }\n }\n } finally {\n setSelectedIndex(-1);\n }\n}\n\nfunction markViewDirty(lView, source) {\n const dirtyBitsToUse = isRefreshingViews() ? 64 : 1024 | 64;\n lView[ENVIRONMENT].changeDetectionScheduler?.notify(source);\n while (lView) {\n lView[FLAGS] |= dirtyBitsToUse;\n const parent = getLViewParent(lView);\n if (isRootView(lView) && !parent) {\n return lView;\n }\n lView = parent;\n }\n return null;\n}\n\nfunction createLContainer(hostNative, currentView, native, tNode) {\n ngDevMode && assertLView(currentView);\n const lContainer = [hostNative, true, 0, currentView, null, tNode, null, native, null, null];\n ngDevMode && assertEqual(lContainer.length, CONTAINER_HEADER_OFFSET, 'Should allocate correct number of slots for LContainer header.');\n return lContainer;\n}\nfunction getLViewFromLContainer(lContainer, index) {\n const adjustedIndex = CONTAINER_HEADER_OFFSET + index;\n if (adjustedIndex < lContainer.length) {\n const lView = lContainer[adjustedIndex];\n ngDevMode && assertLView(lView);\n return lView;\n }\n return undefined;\n}\nfunction addLViewToLContainer(lContainer, lView, index, addToDOM = true) {\n const tView = lView[TVIEW$1];\n insertView(tView, lView, lContainer, index);\n if (addToDOM) {\n const beforeNode = getBeforeNodeForView(index, lContainer);\n const renderer = lView[RENDERER];\n const parentRNode = renderer.parentNode(lContainer[NATIVE]);\n if (parentRNode !== null) {\n addViewToDOM(tView, lContainer[T_HOST], renderer, lView, parentRNode, beforeNode);\n }\n }\n const hydrationInfo = lView[HYDRATION];\n if (hydrationInfo !== null && hydrationInfo.firstChild !== null) {\n hydrationInfo.firstChild = null;\n }\n}\nfunction removeLViewFromLContainer(lContainer, index) {\n const lView = detachView(lContainer, index);\n if (lView !== undefined) {\n destroyLView(lView[TVIEW$1], lView);\n }\n return lView;\n}\nfunction detachView(lContainer, removeIndex) {\n if (lContainer.length <= CONTAINER_HEADER_OFFSET) return;\n const indexInContainer = CONTAINER_HEADER_OFFSET + removeIndex;\n const viewToDetach = lContainer[indexInContainer];\n if (viewToDetach) {\n const declarationLContainer = viewToDetach[DECLARATION_LCONTAINER];\n if (declarationLContainer !== null && declarationLContainer !== lContainer) {\n detachMovedView(declarationLContainer, viewToDetach);\n }\n if (removeIndex > 0) {\n lContainer[indexInContainer - 1][NEXT] = viewToDetach[NEXT];\n }\n const removedLView = removeFromArray(lContainer, CONTAINER_HEADER_OFFSET + removeIndex);\n removeViewFromDOM(viewToDetach[TVIEW$1], viewToDetach);\n const lQueries = removedLView[QUERIES];\n if (lQueries !== null) {\n lQueries.detachView(removedLView[TVIEW$1]);\n }\n viewToDetach[PARENT] = null;\n viewToDetach[NEXT] = null;\n viewToDetach[FLAGS] &= -129;\n }\n return viewToDetach;\n}\nfunction insertView(tView, lView, lContainer, index) {\n ngDevMode && assertLView(lView);\n ngDevMode && assertLContainer(lContainer);\n const indexInContainer = CONTAINER_HEADER_OFFSET + index;\n const containerLength = lContainer.length;\n if (index > 0) {\n lContainer[indexInContainer - 1][NEXT] = lView;\n }\n if (index < containerLength - CONTAINER_HEADER_OFFSET) {\n lView[NEXT] = lContainer[indexInContainer];\n addToArray(lContainer, CONTAINER_HEADER_OFFSET + index, lView);\n } else {\n lContainer.push(lView);\n lView[NEXT] = null;\n }\n lView[PARENT] = lContainer;\n const declarationLContainer = lView[DECLARATION_LCONTAINER];\n if (declarationLContainer !== null && lContainer !== declarationLContainer) {\n trackMovedView(declarationLContainer, lView);\n }\n const lQueries = lView[QUERIES];\n if (lQueries !== null) {\n lQueries.insertView(tView);\n }\n updateAncestorTraversalFlagsOnAttach(lView);\n lView[FLAGS] |= 128;\n}\nfunction trackMovedView(declarationContainer, lView) {\n ngDevMode && assertDefined(lView, 'LView required');\n ngDevMode && assertLContainer(declarationContainer);\n const movedViews = declarationContainer[MOVED_VIEWS];\n const parent = lView[PARENT];\n ngDevMode && assertDefined(parent, 'missing parent');\n if (isLView(parent)) {\n declarationContainer[FLAGS] |= 2;\n } else {\n const insertedComponentLView = parent[PARENT][DECLARATION_COMPONENT_VIEW];\n ngDevMode && assertDefined(insertedComponentLView, 'Missing insertedComponentLView');\n const declaredComponentLView = lView[DECLARATION_COMPONENT_VIEW];\n ngDevMode && assertDefined(declaredComponentLView, 'Missing declaredComponentLView');\n if (declaredComponentLView !== insertedComponentLView) {\n declarationContainer[FLAGS] |= 2;\n }\n }\n if (movedViews === null) {\n declarationContainer[MOVED_VIEWS] = [lView];\n } else {\n movedViews.push(lView);\n }\n}\n\nclass ViewRef {\n _lView;\n _cdRefInjectingView;\n _appRef = null;\n _attachedToViewContainer = false;\n exhaustive;\n get rootNodes() {\n const lView = this._lView;\n const tView = lView[TVIEW$1];\n return collectNativeNodes(tView, lView, tView.firstChild, []);\n }\n constructor(_lView, _cdRefInjectingView) {\n this._lView = _lView;\n this._cdRefInjectingView = _cdRefInjectingView;\n }\n get context() {\n return this._lView[CONTEXT];\n }\n set context(value) {\n if (ngDevMode) {\n console.warn('Angular: Replacing the `context` object of an `EmbeddedViewRef` is deprecated.');\n }\n this._lView[CONTEXT] = value;\n }\n get destroyed() {\n return isDestroyed(this._lView);\n }\n destroy() {\n if (this._appRef) {\n this._appRef.detachView(this);\n } else if (this._attachedToViewContainer) {\n const parent = this._lView[PARENT];\n if (isLContainer(parent)) {\n const viewRefs = parent[VIEW_REFS];\n const index = viewRefs ? viewRefs.indexOf(this) : -1;\n if (index > -1) {\n ngDevMode && assertEqual(index, parent.indexOf(this._lView) - CONTAINER_HEADER_OFFSET, 'An attached view should be in the same position within its container as its ViewRef in the VIEW_REFS array.');\n detachView(parent, index);\n removeFromArray(viewRefs, index);\n }\n }\n this._attachedToViewContainer = false;\n }\n destroyLView(this._lView[TVIEW$1], this._lView);\n }\n onDestroy(callback) {\n storeLViewOnDestroy(this._lView, callback);\n }\n markForCheck() {\n markViewDirty(this._cdRefInjectingView || this._lView, 4);\n }\n detach() {\n this._lView[FLAGS] &= -129;\n }\n reattach() {\n updateAncestorTraversalFlagsOnAttach(this._lView);\n this._lView[FLAGS] |= 128;\n }\n detectChanges() {\n this._lView[FLAGS] |= 1024;\n detectChangesInternal(this._lView);\n }\n checkNoChanges() {\n if (ngDevMode) {\n try {\n this.exhaustive ??= this._lView[INJECTOR].get(UseExhaustiveCheckNoChanges, USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT);\n } catch {\n this.exhaustive = USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT;\n }\n checkNoChangesInternal(this._lView, this.exhaustive);\n }\n }\n attachToViewContainerRef() {\n if (this._appRef) {\n throw new RuntimeError(902, ngDevMode && 'This view is already attached directly to the ApplicationRef!');\n }\n this._attachedToViewContainer = true;\n }\n detachFromAppRef() {\n this._appRef = null;\n const isRoot = isRootView(this._lView);\n const declarationContainer = this._lView[DECLARATION_LCONTAINER];\n if (declarationContainer !== null && !isRoot) {\n detachMovedView(declarationContainer, this._lView);\n }\n detachViewFromDOM(this._lView[TVIEW$1], this._lView);\n }\n attachToAppRef(appRef) {\n if (this._attachedToViewContainer) {\n throw new RuntimeError(902, ngDevMode && 'This view is already attached to a ViewContainer!');\n }\n this._appRef = appRef;\n const isRoot = isRootView(this._lView);\n const declarationContainer = this._lView[DECLARATION_LCONTAINER];\n if (declarationContainer !== null && !isRoot) {\n trackMovedView(declarationContainer, this._lView);\n }\n updateAncestorTraversalFlagsOnAttach(this._lView);\n }\n}\nfunction isViewDirty(view) {\n return requiresRefreshOrTraversal(view._lView) || !!(view._lView[FLAGS] & 64);\n}\nfunction markForRefresh(view) {\n markViewForRefresh(view._lView);\n}\n\nlet TemplateRef = /*#__PURE__*/ (() => {\nclass TemplateRef {\n _declarationLView;\n _declarationTContainer;\n elementRef;\n static __NG_ELEMENT_ID__ = injectTemplateRef;\n constructor(_declarationLView, _declarationTContainer, elementRef) {\n this._declarationLView = _declarationLView;\n this._declarationTContainer = _declarationTContainer;\n this.elementRef = elementRef;\n }\n get ssrId() {\n return this._declarationTContainer.tView?.ssrId || null;\n }\n createEmbeddedView(context, injector) {\n return this.createEmbeddedViewImpl(context, injector);\n }\n createEmbeddedViewImpl(context, injector, dehydratedView) {\n const embeddedLView = createAndRenderEmbeddedLView(this._declarationLView, this._declarationTContainer, context, {\n embeddedViewInjector: injector,\n dehydratedView\n });\n return new ViewRef(embeddedLView);\n }\n}\nreturn TemplateRef;\n})();\nfunction injectTemplateRef() {\n return createTemplateRef(getCurrentTNode(), getLView());\n}\nfunction createTemplateRef(hostTNode, hostLView) {\n if (hostTNode.type & 4) {\n ngDevMode && assertDefined(hostTNode.tView, 'TView must be allocated');\n return new TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView));\n }\n return null;\n}\n\nconst AT_THIS_LOCATION = '<-- AT THIS LOCATION';\nconst THIRD_PARTY_SCRIPTS_URL = `/guide/hydration#third-party-scripts-with-dom-manipulation`;\nfunction getFriendlyStringFromTNodeType(tNodeType) {\n switch (tNodeType) {\n case 4:\n return 'view container';\n case 2:\n return 'element';\n case 8:\n return 'ng-container';\n case 32:\n return 'icu';\n case 64:\n return 'i18n';\n case 16:\n return 'projection';\n case 1:\n return 'text';\n case 128:\n return '@let';\n default:\n return '';\n }\n}\nfunction validateMatchingNode(node, nodeType, tagName, lView, tNode, isViewContainerAnchor = false) {\n if (!node || node.nodeType !== nodeType || node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() !== tagName?.toLowerCase()) {\n const expectedNode = shortRNodeDescription(nodeType, tagName, null);\n let header = `During hydration Angular expected ${expectedNode} but `;\n const hostComponentDef = getDeclarationComponentDef(lView);\n const componentClassName = hostComponentDef?.type?.name;\n const expectedDom = describeExpectedDom(lView, tNode, isViewContainerAnchor);\n const expected = `Angular expected this DOM:\\n\\n${expectedDom}\\n\\n`;\n let actual = '';\n const componentHostElement = unwrapRNode(lView[HOST]);\n if (!node) {\n header += `the node was not found.\\n\\n`;\n markRNodeAsHavingHydrationMismatch(componentHostElement, expectedDom);\n } else {\n const actualNode = shortRNodeDescription(node.nodeType, node.tagName ?? null, node.textContent ?? null);\n header += `found ${actualNode}.\\n\\n`;\n const actualDom = describeDomFromNode(node);\n actual = `Actual DOM is:\\n\\n${actualDom}\\n\\n`;\n markRNodeAsHavingHydrationMismatch(componentHostElement, expectedDom, actualDom);\n }\n const footer = getHydrationErrorFooter(componentClassName);\n let message = header + expected + actual + getHydrationAttributeNote() + footer;\n if (!node || node && isLikelyExternalSourceNode(node)) {\n message += `Note: It looks like this mismatch may have been caused by a third-party script or ` + `browser extension that modified the DOM outside of Angular's control. ` + `Angular hydration does not support nodes injected or removed outside of the Angular-managed DOM. ` + `Note: If you know which element in the DOM this will be inserted, consider adding ngSkipHydration to prevent this error. \\n\\n`;\n }\n throw new RuntimeError(-500, message);\n }\n}\nfunction validateSiblingNodeExists(node) {\n validateNodeExists(node);\n if (!node.nextSibling) {\n const header = 'During hydration Angular expected more sibling nodes to be present.\\n\\n';\n const actual = `Actual DOM is:\\n\\n${describeDomFromNode(node)}\\n\\n`;\n const footer = getHydrationErrorFooter();\n const message = header + actual + footer;\n markRNodeAsHavingHydrationMismatch(node, '', actual);\n throw new RuntimeError(-501, message);\n }\n}\nfunction validateNodeExists(node, lView = null, tNode = null) {\n if (!node) {\n const header = 'During hydration, Angular expected an element to be present at this location.\\n\\n';\n let expected = '';\n let footer = '';\n if (lView !== null && tNode !== null) {\n expected = describeExpectedDom(lView, tNode, false);\n footer = getHydrationErrorFooter();\n markRNodeAsHavingHydrationMismatch(unwrapRNode(lView[HOST]), expected, '');\n }\n throw new RuntimeError(-502, `${header}${expected}\\n\\n${footer}`);\n }\n}\nfunction nodeNotFoundError(lView, tNode) {\n const header = 'During serialization, Angular was unable to find an element in the DOM:\\n\\n';\n const expected = `${describeExpectedDom(lView, tNode, false)}\\n\\n`;\n const footer = getHydrationErrorFooter();\n throw new RuntimeError(-502, header + expected + footer);\n}\nfunction nodeNotFoundAtPathError(host, path) {\n const header = `During hydration Angular was unable to locate a node ` + `using the \"${path}\" path, starting from the ${describeRNode(host)} node.\\n\\n`;\n const footer = getHydrationErrorFooter();\n markRNodeAsHavingHydrationMismatch(host);\n throw new RuntimeError(-502, header + footer);\n}\nfunction unsupportedProjectionOfDomNodes(rNode) {\n const header = 'During serialization, Angular detected DOM nodes ' + 'that were created outside of Angular context and provided as projectable nodes ' + '(likely via `ViewContainerRef.createComponent` or `createComponent` APIs). ' + 'Hydration is not supported for such cases, consider refactoring the code to avoid ' + 'this pattern or using `ngSkipHydration` on the host element of the component.\\n\\n';\n const actual = `${describeDomFromNode(rNode)}\\n\\n`;\n const message = header + actual + getHydrationAttributeNote();\n return new RuntimeError(-503, message);\n}\nfunction invalidSkipHydrationHost(rNode) {\n const header = 'The `ngSkipHydration` flag is applied on a node ' + \"that doesn't act as a component host. Hydration can be \" + 'skipped only on per-component basis.\\n\\n';\n const actual = `${describeDomFromNode(rNode)}\\n\\n`;\n const footer = 'Please move the `ngSkipHydration` attribute to the component host element.\\n\\n';\n const message = header + actual + footer;\n return new RuntimeError(-504, message);\n}\nfunction stringifyTNodeAttrs(tNode) {\n const results = [];\n if (tNode.attrs) {\n for (let i = 0; i < tNode.attrs.length;) {\n const attrName = tNode.attrs[i++];\n if (typeof attrName == 'number') {\n break;\n }\n const attrValue = tNode.attrs[i++];\n results.push(`${attrName}=\"${shorten(attrValue)}\"`);\n }\n }\n return results.join(' ');\n}\nconst internalAttrs = /*#__PURE__*/ new Set(['ngh', 'ng-version', 'ng-server-context']);\nfunction stringifyRNodeAttrs(rNode) {\n const results = [];\n for (let i = 0; i < rNode.attributes.length; i++) {\n const attr = rNode.attributes[i];\n if (internalAttrs.has(attr.name)) continue;\n results.push(`${attr.name}=\"${shorten(attr.value)}\"`);\n }\n return results.join(' ');\n}\nfunction describeTNode(tNode, innerContent = 'โ€ฆ') {\n switch (tNode.type) {\n case 1:\n const content = tNode.value ? `(${tNode.value})` : '';\n return `#text${content}`;\n case 2:\n const attrs = stringifyTNodeAttrs(tNode);\n const tag = tNode.value.toLowerCase();\n return `<${tag}${attrs ? ' ' + attrs : ''}>${innerContent}`;\n case 8:\n return '';\n case 4:\n return '';\n default:\n const typeAsString = getFriendlyStringFromTNodeType(tNode.type);\n return `#node(${typeAsString})`;\n }\n}\nfunction describeRNode(rNode, innerContent = 'โ€ฆ') {\n const node = rNode;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n const tag = node.tagName.toLowerCase();\n const attrs = stringifyRNodeAttrs(node);\n return `<${tag}${attrs ? ' ' + attrs : ''}>${innerContent}`;\n case Node.TEXT_NODE:\n const content = node.textContent ? shorten(node.textContent) : '';\n return `#text${content ? `(${content})` : ''}`;\n case Node.COMMENT_NODE:\n return ``;\n default:\n return `#node(${node.nodeType})`;\n }\n}\nfunction describeExpectedDom(lView, tNode, isViewContainerAnchor) {\n const spacer = ' ';\n let content = '';\n if (tNode.prev) {\n content += spacer + 'โ€ฆ\\n';\n content += spacer + describeTNode(tNode.prev) + '\\n';\n } else if (tNode.type && tNode.type & 12) {\n content += spacer + 'โ€ฆ\\n';\n }\n if (isViewContainerAnchor) {\n content += spacer + describeTNode(tNode) + '\\n';\n content += spacer + ` ${AT_THIS_LOCATION}\\n`;\n } else {\n content += spacer + describeTNode(tNode) + ` ${AT_THIS_LOCATION}\\n`;\n }\n content += spacer + 'โ€ฆ\\n';\n const parentRNode = tNode.type ? getParentRElement(lView[TVIEW$1], tNode, lView) : null;\n if (parentRNode) {\n content = describeRNode(parentRNode, '\\n' + content);\n }\n return content;\n}\nfunction describeDomFromNode(node) {\n const spacer = ' ';\n let content = '';\n const currentNode = node;\n if (currentNode.previousSibling) {\n content += spacer + 'โ€ฆ\\n';\n content += spacer + describeRNode(currentNode.previousSibling) + '\\n';\n }\n content += spacer + describeRNode(currentNode) + ` ${AT_THIS_LOCATION}\\n`;\n if (node.nextSibling) {\n content += spacer + 'โ€ฆ\\n';\n }\n if (node.parentNode) {\n content = describeRNode(currentNode.parentNode, '\\n' + content);\n }\n return content;\n}\nfunction shortRNodeDescription(nodeType, tagName, textContent) {\n switch (nodeType) {\n case Node.ELEMENT_NODE:\n return `<${tagName.toLowerCase()}>`;\n case Node.TEXT_NODE:\n const content = textContent ? ` (with the \"${shorten(textContent)}\" content)` : '';\n return `a text node${content}`;\n case Node.COMMENT_NODE:\n return 'a comment node';\n default:\n return `#node(nodeType=${nodeType})`;\n }\n}\nfunction getHydrationErrorFooter(componentClassName) {\n const componentInfo = componentClassName ? `the \"${componentClassName}\"` : 'corresponding';\n return `To fix this problem:\\n` + ` * check ${componentInfo} component for hydration-related issues\\n` + ` * check to see if your template has valid HTML structure\\n` + ` * check if there are any third-party scripts that manipulate the DOM. More info: ${DOC_PAGE_BASE_URL}${THIRD_PARTY_SCRIPTS_URL}\\n` + ` * or skip hydration by adding the \\`ngSkipHydration\\` attribute ` + `to its host node in a template\\n\\n`;\n}\nfunction isLikelyExternalSourceNode(rNode) {\n const node = rNode;\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n if (readPatchedData(node)) {\n return false;\n }\n return true;\n}\nfunction getHydrationAttributeNote() {\n return 'Note: attributes are only displayed to better represent the DOM' + ' but have no effect on hydration mismatches.\\n\\n';\n}\nfunction stripNewlines(input) {\n return input.replace(/\\s+/gm, '');\n}\nfunction shorten(input, maxLength = 50) {\n if (!input) {\n return '';\n }\n input = stripNewlines(input);\n return input.length > maxLength ? `${input.substring(0, maxLength - 1)}โ€ฆ` : input;\n}\nfunction describeDomNode(node) {\n const textContent = node.textContent?.slice(0, 50);\n return textContent ? `${node.nodeName} (\"${textContent}\")` : node.nodeName;\n}\n\nfunction getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView) {\n const tNodeInsertBeforeIndex = currentTNode.insertBeforeIndex;\n const insertBeforeIndex = Array.isArray(tNodeInsertBeforeIndex) ? tNodeInsertBeforeIndex[0] : tNodeInsertBeforeIndex;\n if (insertBeforeIndex === null) {\n return getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView);\n } else {\n ngDevMode && assertIndexInRange(lView, insertBeforeIndex);\n return unwrapRNode(lView[insertBeforeIndex]);\n }\n}\nfunction processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRElement) {\n const tNodeInsertBeforeIndex = childTNode.insertBeforeIndex;\n if (Array.isArray(tNodeInsertBeforeIndex)) {\n ngDevMode && assertDomNode(childRNode);\n let i18nParent = childRNode;\n let anchorRNode = null;\n if (!(childTNode.type & 3)) {\n anchorRNode = i18nParent;\n i18nParent = parentRElement;\n }\n if (i18nParent !== null && childTNode.componentOffset === -1) {\n for (let i = 1; i < tNodeInsertBeforeIndex.length; i++) {\n const i18nChild = lView[tNodeInsertBeforeIndex[i]];\n nativeInsertBefore(renderer, i18nParent, i18nChild, anchorRNode, false);\n }\n }\n }\n}\n\nfunction getOrCreateTNode(tView, index, type, name, attrs) {\n ngDevMode && index !== 0 && assertGreaterThanOrEqual(index, HEADER_OFFSET, \"TNodes can't be in the LView header.\");\n ngDevMode && assertPureTNodeType(type);\n let tNode = tView.data[index];\n if (tNode === null) {\n tNode = createTNodeAtIndex(tView, index, type, name, attrs);\n if (isInI18nBlock()) {\n tNode.flags |= 32;\n }\n } else if (tNode.type & 64) {\n tNode.type = type;\n tNode.value = name;\n tNode.attrs = attrs;\n const parent = getCurrentParentTNode();\n tNode.injectorIndex = parent === null ? -1 : parent.injectorIndex;\n ngDevMode && assertTNodeForTView(tNode, tView);\n ngDevMode && assertEqual(index, tNode.index, 'Expecting same index');\n }\n setCurrentTNode(tNode, true);\n return tNode;\n}\nfunction createTNodeAtIndex(tView, index, type, name, attrs) {\n const currentTNode = getCurrentTNodePlaceholderOk();\n const isParent = isCurrentTNodeParent();\n const parent = isParent ? currentTNode : currentTNode && currentTNode.parent;\n const tNode = tView.data[index] = createTNode(tView, parent, type, index, name, attrs);\n linkTNodeInTView(tView, tNode, currentTNode, isParent);\n return tNode;\n}\nfunction linkTNodeInTView(tView, tNode, currentTNode, isParent) {\n if (tView.firstChild === null) {\n tView.firstChild = tNode;\n }\n if (currentTNode !== null) {\n if (isParent) {\n if (currentTNode.child == null && tNode.parent !== null) {\n currentTNode.child = tNode;\n }\n } else {\n if (currentTNode.next === null) {\n currentTNode.next = tNode;\n tNode.prev = currentTNode;\n }\n }\n }\n}\nfunction createTNode(tView, tParent, type, index, value, attrs) {\n ngDevMode && index !== 0 && assertGreaterThanOrEqual(index, HEADER_OFFSET, \"TNodes can't be in the LView header.\");\n ngDevMode && assertNotSame(attrs, undefined, \"'undefined' is not valid value for 'attrs'\");\n ngDevMode && tParent && assertTNodeForTView(tParent, tView);\n let injectorIndex = tParent ? tParent.injectorIndex : -1;\n let flags = 0;\n if (isInSkipHydrationBlock$1()) {\n flags |= 128;\n }\n const tNode = {\n type,\n index,\n insertBeforeIndex: null,\n injectorIndex,\n directiveStart: -1,\n directiveEnd: -1,\n directiveStylingLast: -1,\n componentOffset: -1,\n controlDirectiveIndex: -1,\n customControlIndex: -1,\n propertyBindings: null,\n flags,\n providerIndexes: 0,\n value: value,\n namespace: getNamespace(),\n attrs: attrs,\n mergedAttrs: null,\n localNames: null,\n initialInputs: null,\n inputs: null,\n hostDirectiveInputs: null,\n outputs: null,\n hostDirectiveOutputs: null,\n directiveToIndex: null,\n tView: null,\n next: null,\n prev: null,\n projectionNext: null,\n child: null,\n parent: tParent,\n projection: null,\n styles: null,\n stylesWithoutHost: null,\n residualStyles: undefined,\n classes: null,\n classesWithoutHost: null,\n residualClasses: undefined,\n classBindings: 0,\n styleBindings: 0\n };\n if (ngDevMode) {\n Object.seal(tNode);\n }\n return tNode;\n}\n\nfunction addTNodeAndUpdateInsertBeforeIndex(previousTNodes, newTNode) {\n ngDevMode && assertEqual(newTNode.insertBeforeIndex, null, 'We expect that insertBeforeIndex is not set');\n previousTNodes.push(newTNode);\n if (previousTNodes.length > 1) {\n for (let i = previousTNodes.length - 2; i >= 0; i--) {\n const existingTNode = previousTNodes[i];\n if (!isI18nText(existingTNode)) {\n if (isNewTNodeCreatedBefore(existingTNode, newTNode) && getInsertBeforeIndex(existingTNode) === null) {\n setInsertBeforeIndex(existingTNode, newTNode.index);\n }\n }\n }\n }\n}\nfunction isI18nText(tNode) {\n return !(tNode.type & 64);\n}\nfunction isNewTNodeCreatedBefore(existingTNode, newTNode) {\n return isI18nText(newTNode) || existingTNode.index > newTNode.index;\n}\nfunction getInsertBeforeIndex(tNode) {\n const index = tNode.insertBeforeIndex;\n return Array.isArray(index) ? index[0] : index;\n}\nfunction setInsertBeforeIndex(tNode, value) {\n const index = tNode.insertBeforeIndex;\n if (Array.isArray(index)) {\n index[0] = value;\n } else {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n tNode.insertBeforeIndex = value;\n }\n}\n\nconst CURRENT_CASE_LVIEW_INDEX = /*#__PURE__*/ getClosureSafeProperty({\n currentCaseLViewIndex: getClosureSafeProperty\n});\nconst TVIEW = /*#__PURE__*/ getClosureSafeProperty({\n tView: getClosureSafeProperty\n});\nfunction getTIcu(tView, index) {\n const value = tView.data[index];\n if (value === null || typeof value === 'string') return null;\n if (ngDevMode && !(Object.hasOwn(value, TVIEW) || Object.hasOwn(value, CURRENT_CASE_LVIEW_INDEX))) {\n throwError(\"We expect to get 'null'|'TIcu'|'TIcuContainer', but got: \" + value);\n }\n const tIcu = Object.hasOwn(value, CURRENT_CASE_LVIEW_INDEX) ? value : value.value;\n ngDevMode && assertTIcu(tIcu);\n return tIcu;\n}\nfunction setTIcu(tView, index, tIcu) {\n const tNode = tView.data[index];\n ngDevMode && assertEqual(tNode === null || Object.hasOwn(tNode, TVIEW), true, \"We expect to get 'null'|'TIcuContainer'\");\n if (tNode === null) {\n tView.data[index] = tIcu;\n } else {\n ngDevMode && assertTNodeType(tNode, 32);\n tNode.value = tIcu;\n }\n}\nfunction setTNodeInsertBeforeIndex(tNode, index) {\n ngDevMode && assertTNode(tNode);\n let insertBeforeIndex = tNode.insertBeforeIndex;\n if (insertBeforeIndex === null) {\n setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore);\n insertBeforeIndex = tNode.insertBeforeIndex = [null, index];\n } else {\n ngDevMode && assertEqual(Array.isArray(insertBeforeIndex), true, 'Expecting array here');\n insertBeforeIndex.push(index);\n }\n}\nfunction createTNodePlaceholder(tView, previousTNodes, index) {\n const tNode = createTNodeAtIndex(tView, index, 64, null, null);\n addTNodeAndUpdateInsertBeforeIndex(previousTNodes, tNode);\n return tNode;\n}\nfunction getCurrentICUCaseIndex(tIcu, lView) {\n const currentCase = lView[tIcu.currentCaseLViewIndex];\n return currentCase === null ? currentCase : currentCase < 0 ? ~currentCase : currentCase;\n}\nfunction getParentFromIcuCreateOpCode(mergedCode) {\n return mergedCode >>> 17;\n}\nfunction getRefFromIcuCreateOpCode(mergedCode) {\n return (mergedCode & 131070) >>> 1;\n}\nfunction getInstructionFromIcuCreateOpCode(mergedCode) {\n return mergedCode & 1;\n}\nfunction icuCreateOpCode(opCode, parentIdx, refIdx) {\n ngDevMode && assertGreaterThanOrEqual(parentIdx, 0, 'Missing parent index');\n ngDevMode && assertGreaterThan(refIdx, 0, 'Missing ref index');\n if (parentIdx > 32767 || refIdx > 65535) {\n throw new Error('ICU node index out of range (too many nodes in ICU case)');\n }\n return opCode | parentIdx << 17 | refIdx << 1;\n}\nfunction isRootTemplateMessage(subTemplateIndex) {\n return subTemplateIndex === -1;\n}\n\nfunction enterIcu(state, tIcu, lView) {\n state.index = 0;\n const currentCase = getCurrentICUCaseIndex(tIcu, lView);\n if (currentCase !== null) {\n ngDevMode && assertNumberInRange(currentCase, 0, tIcu.cases.length - 1);\n state.removes = tIcu.remove[currentCase];\n } else {\n state.removes = EMPTY_ARRAY;\n }\n}\nfunction icuContainerIteratorNext(state) {\n if (state.index < state.removes.length) {\n const removeOpCode = state.removes[state.index++];\n ngDevMode && assertNumber(removeOpCode, 'Expecting OpCode number');\n if (removeOpCode > 0) {\n const rNode = state.lView[removeOpCode];\n ngDevMode && assertDomNode(rNode);\n return rNode;\n } else {\n state.stack.push(state.index, state.removes);\n const tIcuIndex = ~removeOpCode;\n const tIcu = state.lView[TVIEW$1].data[tIcuIndex];\n ngDevMode && assertTIcu(tIcu);\n enterIcu(state, tIcu, state.lView);\n return icuContainerIteratorNext(state);\n }\n } else {\n if (state.stack.length === 0) {\n state.lView = undefined;\n return null;\n } else {\n state.removes = state.stack.pop();\n state.index = state.stack.pop();\n return icuContainerIteratorNext(state);\n }\n }\n}\nfunction loadIcuContainerVisitor() {\n const _state = {\n stack: [],\n index: -1\n };\n function icuContainerIteratorStart(tIcuContainerNode, lView) {\n _state.lView = lView;\n while (_state.stack.length) _state.stack.pop();\n ngDevMode && assertTNodeForLView(tIcuContainerNode, lView);\n enterIcu(_state, tIcuContainerNode.value, lView);\n return icuContainerIteratorNext.bind(null, _state);\n }\n return icuContainerIteratorStart;\n}\nfunction createIcuIterator(tIcu, lView) {\n const state = {\n stack: [],\n index: -1,\n lView\n };\n ngDevMode && assertTIcu(tIcu);\n enterIcu(state, tIcu, lView);\n return icuContainerIteratorNext.bind(null, state);\n}\n\nconst REF_EXTRACTOR_REGEXP = /* @__PURE__ */(() => {\n return new RegExp(`^(\\\\d+)*(${REFERENCE_NODE_BODY}|${REFERENCE_NODE_HOST})*(.*)`);\n})();\nfunction compressNodeLocation(referenceNode, path) {\n const result = [referenceNode];\n for (const segment of path) {\n const lastIdx = result.length - 1;\n if (lastIdx > 0 && result[lastIdx - 1] === segment) {\n const value = result[lastIdx] || 1;\n result[lastIdx] = value + 1;\n } else {\n result.push(segment, '');\n }\n }\n return result.join('');\n}\nfunction decompressNodeLocation(path) {\n const matches = path.match(REF_EXTRACTOR_REGEXP);\n const [_, refNodeId, refNodeName, rest] = matches;\n const ref = refNodeId ? parseInt(refNodeId, 10) : refNodeName;\n const steps = [];\n for (const [_, step, count] of rest.matchAll(/(f|n)(\\d*)/g)) {\n const repeat = parseInt(count, 10) || 1;\n steps.push(step, repeat);\n }\n return [ref, ...steps];\n}\n\nfunction isFirstElementInNgContainer(tNode) {\n return !tNode.prev && tNode.parent?.type === 8;\n}\nfunction getNoOffsetIndex(tNode) {\n return tNode.index - HEADER_OFFSET;\n}\nfunction isDisconnectedNode(tNode, lView) {\n return !(tNode.type & (16 | 128)) && !!lView[tNode.index] && isDisconnectedRNode(unwrapRNode(lView[tNode.index]));\n}\nfunction isDisconnectedRNode(rNode) {\n return !!rNode && !rNode.isConnected;\n}\nfunction locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex) {\n const i18nNodes = hydrationInfo.i18nNodes;\n if (i18nNodes) {\n return i18nNodes.get(noOffsetIndex);\n }\n return undefined;\n}\nfunction tryLocateRNodeByPath(hydrationInfo, lView, noOffsetIndex) {\n const nodes = hydrationInfo.data[NODES];\n const path = nodes?.[noOffsetIndex];\n return path ? locateRNodeByPath(path, lView) : null;\n}\nfunction locateNextRNode(hydrationInfo, tView, lView, tNode) {\n const noOffsetIndex = getNoOffsetIndex(tNode);\n let native = locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex);\n if (native === undefined) {\n const nodes = hydrationInfo.data[NODES];\n if (nodes?.[noOffsetIndex]) {\n native = locateRNodeByPath(nodes[noOffsetIndex], lView);\n } else if (tView.firstChild === tNode) {\n native = hydrationInfo.firstChild;\n } else {\n const previousTNodeParent = tNode.prev === null;\n const previousTNode = tNode.prev ?? tNode.parent;\n ngDevMode && assertDefined(previousTNode, 'Unexpected state: current TNode does not have a connection ' + 'to the previous node or a parent node.');\n if (isFirstElementInNgContainer(tNode)) {\n const noOffsetParentIndex = getNoOffsetIndex(tNode.parent);\n native = getSegmentHead(hydrationInfo, noOffsetParentIndex);\n } else {\n let previousRElement = getNativeByTNode(previousTNode, lView);\n if (previousTNodeParent) {\n native = previousRElement.firstChild;\n } else {\n const noOffsetPrevSiblingIndex = getNoOffsetIndex(previousTNode);\n const segmentHead = getSegmentHead(hydrationInfo, noOffsetPrevSiblingIndex);\n if (previousTNode.type === 2 && segmentHead) {\n const numRootNodesToSkip = calcSerializedContainerSize(hydrationInfo, noOffsetPrevSiblingIndex);\n const nodesToSkip = numRootNodesToSkip + 1;\n native = siblingAfter(nodesToSkip, segmentHead);\n } else {\n native = previousRElement.nextSibling;\n }\n }\n }\n }\n }\n return native;\n}\nfunction siblingAfter(skip, from) {\n let currentNode = from;\n for (let i = 0; i < skip; i++) {\n ngDevMode && validateSiblingNodeExists(currentNode);\n if (currentNode == null) {\n throw new RuntimeError(-501, ngDevMode && 'During hydration Angular expected more sibling nodes to be present. This usually means the client-rendered DOM no longer matches the server-rendered HTML.');\n }\n currentNode = currentNode.nextSibling;\n }\n return currentNode;\n}\nfunction stringifyNavigationInstructions(instructions) {\n const container = [];\n for (let i = 0; i < instructions.length; i += 2) {\n const step = instructions[i];\n const repeat = instructions[i + 1];\n for (let r = 0; r < repeat; r++) {\n container.push(step === NODE_NAVIGATION_STEP_FIRST_CHILD ? 'firstChild' : 'nextSibling');\n }\n }\n return container.join('.');\n}\nfunction navigateToNode(from, instructions) {\n let node = from;\n for (let i = 0; i < instructions.length; i += 2) {\n const step = instructions[i];\n const repeat = instructions[i + 1];\n for (let r = 0; r < repeat; r++) {\n if (ngDevMode && !node) {\n throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));\n }\n if (!node) {\n throw new RuntimeError(509, ngDevMode && 'During hydration Angular was unable to locate a node using a recorded navigation path. This usually means the client-rendered DOM no longer matches the server-rendered HTML.');\n }\n switch (step) {\n case NODE_NAVIGATION_STEP_FIRST_CHILD:\n node = node.firstChild;\n break;\n case NODE_NAVIGATION_STEP_NEXT_SIBLING:\n node = node.nextSibling;\n break;\n }\n }\n }\n if (ngDevMode && !node) {\n throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));\n }\n if (!node) {\n throw new RuntimeError(509, ngDevMode && 'During hydration Angular was unable to locate a node using a recorded navigation path. This usually means the client-rendered DOM no longer matches the server-rendered HTML.');\n }\n return node;\n}\nfunction locateRNodeByPath(path, lView) {\n const [referenceNode, ...navigationInstructions] = decompressNodeLocation(path);\n let ref;\n if (referenceNode === REFERENCE_NODE_HOST) {\n ref = lView[DECLARATION_COMPONENT_VIEW][HOST];\n } else if (referenceNode === REFERENCE_NODE_BODY) {\n ref = ษตษตresolveBody(lView[DECLARATION_COMPONENT_VIEW][HOST]);\n } else {\n const parentElementId = Number(referenceNode);\n ref = unwrapRNode(lView[parentElementId + HEADER_OFFSET]);\n }\n return navigateToNode(ref, navigationInstructions);\n}\nfunction navigateBetween(start, finish) {\n if (start === finish) {\n return [];\n } else if (start.parentElement == null || finish.parentElement == null) {\n return null;\n } else if (start.parentElement === finish.parentElement) {\n return navigateBetweenSiblings(start, finish);\n } else {\n const parent = finish.parentElement;\n const parentPath = navigateBetween(start, parent);\n const childPath = navigateBetween(parent.firstChild, finish);\n if (!parentPath || !childPath) return null;\n return [...parentPath, NODE_NAVIGATION_STEP_FIRST_CHILD, ...childPath];\n }\n}\nfunction navigateBetweenSiblings(start, finish) {\n const nav = [];\n let node = null;\n for (node = start; node != null && node !== finish; node = node.nextSibling) {\n nav.push(NODE_NAVIGATION_STEP_NEXT_SIBLING);\n }\n return node == null ? null : nav;\n}\nfunction calcPathBetween(from, to, fromNodeName) {\n const path = navigateBetween(from, to);\n return path === null ? null : compressNodeLocation(fromNodeName, path);\n}\nfunction calcPathForNode(tNode, lView, excludedParentNodes) {\n let parentTNode = tNode.parent;\n let parentIndex;\n let parentRNode;\n let referenceNodeName;\n while (parentTNode !== null && (isDisconnectedNode(parentTNode, lView) || excludedParentNodes?.has(parentTNode.index))) {\n parentTNode = parentTNode.parent;\n }\n if (parentTNode === null || !(parentTNode.type & 3)) {\n parentIndex = referenceNodeName = REFERENCE_NODE_HOST;\n parentRNode = lView[DECLARATION_COMPONENT_VIEW][HOST];\n } else {\n parentIndex = parentTNode.index;\n parentRNode = unwrapRNode(lView[parentIndex]);\n referenceNodeName = renderStringify(parentIndex - HEADER_OFFSET);\n }\n let rNode = unwrapRNode(lView[tNode.index]);\n if (tNode.type & (12 | 32)) {\n const firstRNode = getFirstNativeNode(lView, tNode);\n if (firstRNode) {\n rNode = firstRNode;\n }\n }\n let path = calcPathBetween(parentRNode, rNode, referenceNodeName);\n if (path === null && parentRNode !== rNode) {\n const body = parentRNode.ownerDocument.body;\n path = calcPathBetween(body, rNode, REFERENCE_NODE_BODY);\n if (path === null) {\n throw nodeNotFoundError(lView, tNode);\n }\n }\n return path;\n}\nfunction gatherDeferBlocksCommentNodes(doc, node) {\n const commentNodesIterator = doc.createNodeIterator(node, NodeFilter.SHOW_COMMENT, {\n acceptNode\n });\n let currentNode;\n const nodesByBlockId = new Map();\n while (currentNode = commentNodesIterator.nextNode()) {\n const nghPattern = 'ngh=';\n const content = currentNode?.textContent;\n const nghIdx = content?.indexOf(nghPattern) ?? -1;\n if (nghIdx > -1) {\n const nghValue = content.substring(nghIdx + nghPattern.length).trim();\n ngDevMode && assertEqual(nghValue.startsWith('d'), true, 'Invalid defer block id found in a comment node.');\n nodesByBlockId.set(nghValue, currentNode);\n }\n }\n return nodesByBlockId;\n}\nfunction acceptNode(node) {\n return node.textContent?.trimStart().startsWith('ngh=') ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;\n}\n\nlet _isI18nHydrationSupportEnabled = false;\nlet _prepareI18nBlockForHydrationImpl = () => {};\nfunction setIsI18nHydrationSupportEnabled(enabled) {\n _isI18nHydrationSupportEnabled = enabled;\n}\nfunction isI18nHydrationSupportEnabled() {\n return _isI18nHydrationSupportEnabled;\n}\nfunction prepareI18nBlockForHydration(lView, index, parentTNode, subTemplateIndex) {\n _prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex);\n}\nfunction enablePrepareI18nBlockForHydrationImpl() {\n _prepareI18nBlockForHydrationImpl = prepareI18nBlockForHydrationImpl;\n}\nfunction isI18nHydrationEnabled(injector) {\n injector = injector ?? inject(Injector);\n return injector.get(IS_I18N_HYDRATION_ENABLED, false);\n}\nfunction getOrComputeI18nChildren(tView, context) {\n let i18nChildren = context.i18nChildren.get(tView);\n if (i18nChildren === undefined) {\n i18nChildren = collectI18nChildren(tView);\n context.i18nChildren.set(tView, i18nChildren);\n }\n return i18nChildren;\n}\nfunction collectI18nChildren(tView) {\n const children = new Set();\n function collectI18nViews(node) {\n children.add(node.index);\n switch (node.kind) {\n case 1:\n case 2:\n {\n for (const childNode of node.children) {\n collectI18nViews(childNode);\n }\n break;\n }\n case 3:\n {\n for (const caseNodes of node.cases) {\n for (const caseNode of caseNodes) {\n collectI18nViews(caseNode);\n }\n }\n break;\n }\n }\n }\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n const tI18n = tView.data[i];\n if (!tI18n || !tI18n.ast) {\n continue;\n }\n for (const node of tI18n.ast) {\n collectI18nViews(node);\n }\n }\n return children.size === 0 ? null : children;\n}\nfunction trySerializeI18nBlock(lView, index, context) {\n if (!context.isI18nHydrationEnabled) {\n return null;\n }\n const tView = lView[TVIEW$1];\n const tI18n = tView.data[index];\n if (!tI18n || !tI18n.ast) {\n return null;\n }\n const parentTNode = tView.data[tI18n.parentTNodeIndex];\n if (parentTNode && isI18nInSkipHydrationBlock(parentTNode)) {\n return null;\n }\n const serializedI18nBlock = {\n caseQueue: [],\n disconnectedNodes: new Set(),\n disjointNodes: new Set()\n };\n serializeI18nBlock(lView, serializedI18nBlock, context, tI18n.ast);\n return serializedI18nBlock.caseQueue.length === 0 && serializedI18nBlock.disconnectedNodes.size === 0 && serializedI18nBlock.disjointNodes.size === 0 ? null : serializedI18nBlock;\n}\nfunction serializeI18nBlock(lView, serializedI18nBlock, context, nodes) {\n let prevRNode = null;\n for (const node of nodes) {\n const nextRNode = serializeI18nNode(lView, serializedI18nBlock, context, node);\n if (nextRNode) {\n if (isDisjointNode(prevRNode, nextRNode)) {\n serializedI18nBlock.disjointNodes.add(node.index - HEADER_OFFSET);\n }\n prevRNode = nextRNode;\n }\n }\n return prevRNode;\n}\nfunction isDisjointNode(prevNode, nextNode) {\n return prevNode && prevNode.nextSibling !== nextNode;\n}\nfunction serializeI18nNode(lView, serializedI18nBlock, context, node) {\n const maybeRNode = unwrapRNode(lView[node.index]);\n if (!maybeRNode || isDisconnectedRNode(maybeRNode)) {\n serializedI18nBlock.disconnectedNodes.add(node.index - HEADER_OFFSET);\n return null;\n }\n const rNode = maybeRNode;\n switch (node.kind) {\n case 0:\n {\n processTextNodeBeforeSerialization(context, rNode);\n break;\n }\n case 1:\n case 2:\n {\n serializeI18nBlock(lView, serializedI18nBlock, context, node.children);\n break;\n }\n case 3:\n {\n const currentCase = lView[node.currentCaseLViewIndex];\n if (currentCase != null) {\n const caseIdx = currentCase < 0 ? ~currentCase : currentCase;\n serializedI18nBlock.caseQueue.push(caseIdx);\n serializeI18nBlock(lView, serializedI18nBlock, context, node.cases[caseIdx]);\n }\n break;\n }\n }\n return getFirstNativeNodeForI18nNode(lView, node);\n}\nfunction getFirstNativeNodeForI18nNode(lView, node) {\n const tView = lView[TVIEW$1];\n const maybeTNode = tView.data[node.index];\n if (isTNodeShape(maybeTNode)) {\n return getFirstNativeNode(lView, maybeTNode);\n } else if (node.kind === 3) {\n const icuIterator = createIcuIterator(maybeTNode, lView);\n let rNode = icuIterator();\n return rNode ?? unwrapRNode(lView[node.index]);\n } else {\n return unwrapRNode(lView[node.index]) ?? null;\n }\n}\nfunction setCurrentNode(state, node) {\n state.currentNode = node;\n}\nfunction appendI18nNodeToCollection(context, state, astNode) {\n const noOffsetIndex = astNode.index - HEADER_OFFSET;\n const {\n disconnectedNodes\n } = context;\n const currentNode = state.currentNode;\n if (state.isConnected) {\n context.i18nNodes.set(noOffsetIndex, currentNode);\n disconnectedNodes.delete(noOffsetIndex);\n } else {\n disconnectedNodes.add(noOffsetIndex);\n }\n return currentNode;\n}\nfunction skipSiblingNodes(state, skip) {\n let currentNode = state.currentNode;\n for (let i = 0; i < skip; i++) {\n if (!currentNode) {\n break;\n }\n currentNode = currentNode?.nextSibling ?? null;\n }\n return currentNode;\n}\nfunction forkHydrationState(state, nextNode) {\n return {\n currentNode: nextNode,\n isConnected: state.isConnected\n };\n}\nfunction prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex) {\n const hydrationInfo = lView[HYDRATION];\n if (!hydrationInfo) {\n return;\n }\n if (!isI18nHydrationSupportEnabled() || parentTNode && (isI18nInSkipHydrationBlock(parentTNode) || isDisconnectedNode$1(hydrationInfo, parentTNode.index - HEADER_OFFSET))) {\n return;\n }\n const tView = lView[TVIEW$1];\n const tI18n = tView.data[index];\n ngDevMode && assertDefined(tI18n, 'Expected i18n data to be present in a given TView slot during hydration');\n function findHydrationRoot() {\n if (isRootTemplateMessage(subTemplateIndex)) {\n ngDevMode && assertDefined(parentTNode, 'Expected parent TNode while hydrating i18n root');\n const rootNode = locateNextRNode(hydrationInfo, tView, lView, parentTNode);\n return parentTNode.type & 8 ? rootNode : rootNode.firstChild;\n }\n return hydrationInfo?.firstChild;\n }\n const currentNode = findHydrationRoot();\n ngDevMode && assertDefined(currentNode, 'Expected root i18n node during hydration');\n const disconnectedNodes = initDisconnectedNodes(hydrationInfo) ?? new Set();\n const i18nNodes = hydrationInfo.i18nNodes ??= new Map();\n const caseQueue = [...(hydrationInfo.data[I18N_DATA]?.[index - HEADER_OFFSET] ?? [])];\n const dehydratedIcuData = hydrationInfo.dehydratedIcuData ??= new Map();\n collectI18nNodesFromDom({\n hydrationInfo,\n lView,\n i18nNodes,\n disconnectedNodes,\n caseQueue,\n dehydratedIcuData\n }, {\n currentNode,\n isConnected: true\n }, tI18n.ast);\n hydrationInfo.disconnectedNodes = disconnectedNodes.size === 0 ? null : disconnectedNodes;\n}\nfunction collectI18nNodesFromDom(context, state, nodeOrNodes) {\n if (Array.isArray(nodeOrNodes)) {\n let nextState = state;\n for (const node of nodeOrNodes) {\n const targetNode = tryLocateRNodeByPath(context.hydrationInfo, context.lView, node.index - HEADER_OFFSET);\n if (targetNode) {\n nextState = forkHydrationState(state, targetNode);\n }\n collectI18nNodesFromDom(context, nextState, node);\n }\n } else {\n if (context.disconnectedNodes.has(nodeOrNodes.index - HEADER_OFFSET)) {\n return;\n }\n switch (nodeOrNodes.kind) {\n case 0:\n {\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n case 1:\n {\n collectI18nNodesFromDom(context, forkHydrationState(state, state.currentNode?.firstChild ?? null), nodeOrNodes.children);\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n case 2:\n {\n const noOffsetIndex = nodeOrNodes.index - HEADER_OFFSET;\n const {\n hydrationInfo\n } = context;\n const containerSize = getNgContainerSize(hydrationInfo, noOffsetIndex);\n switch (nodeOrNodes.type) {\n case 0:\n {\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n if (isSerializedElementContainer(hydrationInfo, noOffsetIndex)) {\n collectI18nNodesFromDom(context, state, nodeOrNodes.children);\n const nextNode = skipSiblingNodes(state, 1);\n setCurrentNode(state, nextNode);\n } else {\n collectI18nNodesFromDom(context, forkHydrationState(state, state.currentNode?.firstChild ?? null), nodeOrNodes.children);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n if (containerSize !== null) {\n const nextNode = skipSiblingNodes(state, containerSize + 1);\n setCurrentNode(state, nextNode);\n }\n }\n break;\n }\n case 1:\n {\n ngDevMode && assertNotEqual(containerSize, null, 'Expected a container size while hydrating i18n subtemplate');\n appendI18nNodeToCollection(context, state, nodeOrNodes);\n const nextNode = skipSiblingNodes(state, containerSize + 1);\n setCurrentNode(state, nextNode);\n break;\n }\n }\n break;\n }\n case 3:\n {\n const selectedCase = state.isConnected ? context.caseQueue.shift() : null;\n const childState = {\n currentNode: null,\n isConnected: false\n };\n for (let i = 0; i < nodeOrNodes.cases.length; i++) {\n collectI18nNodesFromDom(context, i === selectedCase ? state : childState, nodeOrNodes.cases[i]);\n }\n if (selectedCase !== null) {\n context.dehydratedIcuData.set(nodeOrNodes.index, {\n case: selectedCase,\n node: nodeOrNodes\n });\n }\n const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes);\n setCurrentNode(state, currentNode?.nextSibling ?? null);\n break;\n }\n }\n }\n}\nlet _claimDehydratedIcuCaseImpl = () => {};\nfunction claimDehydratedIcuCase(lView, icuIndex, caseIndex) {\n _claimDehydratedIcuCaseImpl(lView, icuIndex, caseIndex);\n}\nfunction enableClaimDehydratedIcuCaseImpl() {\n _claimDehydratedIcuCaseImpl = claimDehydratedIcuCaseImpl;\n}\nfunction claimDehydratedIcuCaseImpl(lView, icuIndex, caseIndex) {\n const dehydratedIcuDataMap = lView[HYDRATION]?.dehydratedIcuData;\n if (dehydratedIcuDataMap) {\n const dehydratedIcuData = dehydratedIcuDataMap.get(icuIndex);\n if (dehydratedIcuData?.case === caseIndex) {\n dehydratedIcuDataMap.delete(icuIndex);\n }\n }\n}\nfunction cleanupI18nHydrationData(lView) {\n const hydrationInfo = lView[HYDRATION];\n if (hydrationInfo) {\n const {\n i18nNodes,\n dehydratedIcuData: dehydratedIcuDataMap\n } = hydrationInfo;\n if (i18nNodes && dehydratedIcuDataMap) {\n const renderer = lView[RENDERER];\n for (const dehydratedIcuData of dehydratedIcuDataMap.values()) {\n cleanupDehydratedIcuData(renderer, i18nNodes, dehydratedIcuData);\n }\n }\n hydrationInfo.i18nNodes = undefined;\n hydrationInfo.dehydratedIcuData = undefined;\n }\n}\nfunction cleanupDehydratedIcuData(renderer, i18nNodes, dehydratedIcuData) {\n for (const node of dehydratedIcuData.node.cases[dehydratedIcuData.case]) {\n const rNode = i18nNodes.get(node.index - HEADER_OFFSET);\n if (rNode) {\n nativeRemoveNode(renderer, rNode, false);\n }\n }\n}\n\nfunction removeDehydratedViews(lContainer) {\n const views = lContainer[DEHYDRATED_VIEWS] ?? [];\n const parentLView = lContainer[PARENT];\n const renderer = parentLView[RENDERER];\n const retainedViews = [];\n for (const view of views) {\n if (view.data[DEFER_BLOCK_ID] !== undefined) {\n retainedViews.push(view);\n } else {\n removeDehydratedView(view, renderer);\n ngDevMode && ngDevMode.dehydratedViewsRemoved++;\n }\n }\n lContainer[DEHYDRATED_VIEWS] = retainedViews;\n}\nfunction removeDehydratedViewList(deferBlock) {\n const {\n lContainer\n } = deferBlock;\n const dehydratedViews = lContainer[DEHYDRATED_VIEWS];\n if (dehydratedViews === null) return;\n const parentLView = lContainer[PARENT];\n const renderer = parentLView[RENDERER];\n for (const view of dehydratedViews) {\n removeDehydratedView(view, renderer);\n ngDevMode && ngDevMode.dehydratedViewsRemoved++;\n }\n}\nfunction removeDehydratedView(dehydratedView, renderer) {\n let nodesRemoved = 0;\n let currentRNode = dehydratedView.firstChild;\n if (currentRNode) {\n const numNodes = dehydratedView.data[NUM_ROOT_NODES];\n while (nodesRemoved < numNodes) {\n ngDevMode && validateSiblingNodeExists(currentRNode);\n const nextSibling = currentRNode.nextSibling;\n nativeRemoveNode(renderer, currentRNode, false);\n currentRNode = nextSibling;\n nodesRemoved++;\n }\n }\n}\nfunction cleanupLContainer(lContainer) {\n removeDehydratedViews(lContainer);\n const hostLView = lContainer[HOST];\n if (isLView(hostLView)) {\n cleanupLView(hostLView);\n }\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n cleanupLView(lContainer[i]);\n }\n}\nfunction cleanupLView(lView) {\n cleanupI18nHydrationData(lView);\n const tView = lView[TVIEW$1];\n for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {\n if (isLContainer(lView[i])) {\n const lContainer = lView[i];\n cleanupLContainer(lContainer);\n } else if (isLView(lView[i])) {\n cleanupLView(lView[i]);\n }\n }\n}\nfunction cleanupDehydratedViews(appRef) {\n const viewRefs = appRef._views;\n for (const viewRef of viewRefs) {\n const lNode = getLNodeForHydration(viewRef);\n if (lNode !== null && lNode[HOST] !== null) {\n if (isLView(lNode)) {\n cleanupLView(lNode);\n } else {\n cleanupLContainer(lNode);\n }\n ngDevMode && ngDevMode.dehydratedViewsCleanupRuns++;\n }\n }\n}\nfunction cleanupHydratedDeferBlocks(deferBlock, hydratedBlocks, registry, appRef) {\n if (deferBlock !== null) {\n registry.cleanup(hydratedBlocks);\n cleanupLContainer(deferBlock.lContainer);\n cleanupDehydratedViews(appRef);\n }\n}\n\nfunction locateDehydratedViewsInContainer(currentRNode, serializedViews) {\n const dehydratedViews = [];\n for (const serializedView of serializedViews) {\n for (let i = 0; i < (serializedView[MULTIPLIER] ?? 1); i++) {\n const view = {\n data: serializedView,\n firstChild: null\n };\n if (serializedView[NUM_ROOT_NODES] > 0) {\n view.firstChild = currentRNode;\n currentRNode = siblingAfter(serializedView[NUM_ROOT_NODES], currentRNode);\n }\n dehydratedViews.push(view);\n }\n }\n return [currentRNode, dehydratedViews];\n}\nlet _findMatchingDehydratedViewImpl = () => null;\nlet _findAndReconcileMatchingDehydratedViewsImpl = () => null;\nfunction enableFindMatchingDehydratedViewImpl() {\n _findMatchingDehydratedViewImpl = findMatchingDehydratedViewImpl;\n _findAndReconcileMatchingDehydratedViewsImpl = findAndReconcileMatchingDehydratedViewsImpl;\n}\nfunction findMatchingDehydratedViewImpl(lContainer, template) {\n if (hasMatchingDehydratedView(lContainer, template)) {\n return lContainer[DEHYDRATED_VIEWS].shift();\n } else {\n removeDehydratedViews(lContainer);\n return null;\n }\n}\nfunction findMatchingDehydratedView(lContainer, template) {\n return _findMatchingDehydratedViewImpl(lContainer, template);\n}\nfunction findAndReconcileMatchingDehydratedViewsImpl(lContainer, templateTNode, hostLView) {\n if (templateTNode.tView.ssrId === null) return null;\n const dehydratedView = findMatchingDehydratedView(lContainer, templateTNode.tView.ssrId);\n if (hostLView[TVIEW$1].firstUpdatePass && dehydratedView === null) {\n removeStaleDehydratedBranch(hostLView, templateTNode);\n }\n return dehydratedView;\n}\nfunction findAndReconcileMatchingDehydratedViews(lContainer, templateTNode, hostLView) {\n return _findAndReconcileMatchingDehydratedViewsImpl(lContainer, templateTNode, hostLView);\n}\nfunction removeStaleDehydratedBranch(hostLView, tNode) {\n let currentTNode = tNode;\n while (currentTNode) {\n if (cleanupMatchingDehydratedViews(hostLView, currentTNode)) return;\n if ((currentTNode.flags & 256) === 256) {\n break;\n }\n currentTNode = currentTNode.prev;\n }\n currentTNode = tNode.next;\n while (currentTNode) {\n if ((currentTNode.flags & 512) !== 512) {\n break;\n }\n if (cleanupMatchingDehydratedViews(hostLView, currentTNode)) return;\n currentTNode = currentTNode.next;\n }\n}\nfunction hasMatchingDehydratedView(lContainer, template) {\n const views = lContainer[DEHYDRATED_VIEWS];\n if (!template || views === null || views.length === 0) {\n return false;\n }\n return views[0].data[TEMPLATE_ID] === template;\n}\nfunction cleanupMatchingDehydratedViews(hostLView, currentTNode) {\n const ssrId = currentTNode.tView?.ssrId;\n if (ssrId == null) return false;\n const container = hostLView[currentTNode.index];\n if (isLContainer(container) && hasMatchingDehydratedView(container, ssrId)) {\n removeDehydratedViews(container);\n return true;\n }\n return false;\n}\n\nlet ComponentRef$1 = class ComponentRef {};\n\nclass RendererFactory2 {}\nclass Renderer2 {\n destroyNode = null;\n static __NG_ELEMENT_ID__ = () => injectRenderer2();\n}\nif (typeof ngDevMode === 'undefined' || ngDevMode) {\n /*#__PURE__*/ registerSpecialProvider(Renderer2);\n}\nfunction injectRenderer2() {\n const lView = getLView();\n const tNode = getCurrentTNode();\n const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);\n return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];\n}\n\nlet Sanitizer = /*#__PURE__*/ (() => {\nclass Sanitizer {\n static ษตprov =\n /* @__PURE__ */\n __defineInjectable({\n token: Sanitizer,\n providedIn: 'root',\n factory: () => null\n });\n}\nreturn Sanitizer;\n})();\n\nconst RENDER = /*#__PURE__*/ Symbol('RENDER');\nconst ON_DESTROY = /*#__PURE__*/ Symbol('ON_DESTROY');\nconst CONTENT_ADAPTER = /*#__PURE__*/ Symbol('CONTENT_ADAPTER');\nconst GET_CONTEXT = /*#__PURE__*/ Symbol('GET_CONTEXT');\n\nfunction isForeignComponent(value) {\n return typeof value === 'object' && value !== null && RENDER in value;\n}\nfunction isModuleWithProviders(value) {\n return value.ngModule !== undefined;\n}\nfunction isNgModule(value) {\n return !!getNgModuleDef(value);\n}\nfunction isPipe(value) {\n return !!getPipeDef$1(value);\n}\nfunction isDirective(value) {\n return !!getDirectiveDef(value);\n}\nfunction isComponent(value) {\n return !!getComponentDef(value);\n}\nfunction getDependencyTypeForError(type) {\n if (getComponentDef(type)) return 'component';\n if (getDirectiveDef(type)) return 'directive';\n if (getPipeDef$1(type)) return 'pipe';\n return 'type';\n}\nfunction verifyStandaloneImport(depType, importingType) {\n if (isForwardRef(depType)) {\n depType = resolveForwardRef(depType);\n if (!depType) {\n throw new Error(`Expected forwardRef function, imported from \"${stringifyForError(importingType)}\", to return a standalone entity or NgModule but got \"${stringifyForError(depType) || depType}\".`);\n }\n }\n if (getNgModuleDef(depType) == null) {\n const def = getComponentDef(depType) || getDirectiveDef(depType) || getPipeDef$1(depType);\n if (def != null) {\n if (!def.standalone) {\n const type = getDependencyTypeForError(depType);\n throw new Error(`The \"${stringifyForError(depType)}\" ${type}, imported from \"${stringifyForError(importingType)}\", is not standalone. Does the ${type} have the standalone: false flag?`);\n }\n } else {\n if (isModuleWithProviders(depType)) {\n throw new Error(`A module with providers was imported from \"${stringifyForError(importingType)}\". Modules with providers are not supported in standalone components imports.`);\n } else if (isForeignComponent(depType)) {\n throw new Error(`A foreign component, imported from \"${stringifyForError(importingType)}\", cannot be imported using 'imports'. Foreign components are only supported in AOT mode and must be registered in 'foreignImports'.`);\n } else {\n throw new Error(`The \"${stringifyForError(depType)}\" type, imported from \"${stringifyForError(importingType)}\", must be a standalone component / directive / pipe or an NgModule. Did you forget to add the required @Component / @Directive / @Pipe or @NgModule annotation?`);\n }\n }\n }\n}\n\nclass DepsTracker {\n ownerNgModule = new WeakMap();\n ngModulesWithSomeUnresolvedDecls = new Set();\n ngModulesScopeCache = new WeakMap();\n standaloneComponentsScopeCache = new WeakMap();\n resolveNgModulesDecls() {\n if (this.ngModulesWithSomeUnresolvedDecls.size === 0) {\n return;\n }\n for (const moduleType of this.ngModulesWithSomeUnresolvedDecls) {\n const def = getNgModuleDef(moduleType);\n if (def?.declarations) {\n for (const decl of maybeUnwrapFn(def.declarations)) {\n if (isComponent(decl)) {\n this.ownerNgModule.set(decl, moduleType);\n }\n }\n }\n }\n this.ngModulesWithSomeUnresolvedDecls.clear();\n }\n getComponentDependencies(type, rawImports) {\n this.resolveNgModulesDecls();\n const def = getComponentDef(type);\n if (def === null) {\n throw new Error(`Attempting to get component dependencies for a type that is not a component: ${type}`);\n }\n if (def.standalone) {\n const scope = this.getStandaloneComponentScope(type, rawImports);\n if (scope.compilation.isPoisoned) {\n return {\n dependencies: []\n };\n }\n return {\n dependencies: [...scope.compilation.directives, ...scope.compilation.pipes, ...scope.compilation.ngModules]\n };\n } else {\n if (!this.ownerNgModule.has(type)) {\n return {\n dependencies: []\n };\n }\n const scope = this.getNgModuleScope(this.ownerNgModule.get(type));\n if (scope.compilation.isPoisoned) {\n return {\n dependencies: []\n };\n }\n return {\n dependencies: [...scope.compilation.directives, ...scope.compilation.pipes]\n };\n }\n }\n registerNgModule(type, scopeInfo) {\n if (!isNgModule(type)) {\n throw new Error(`Attempting to register a Type which is not NgModule as NgModule: ${type}`);\n }\n this.ngModulesWithSomeUnresolvedDecls.add(type);\n }\n clearScopeCacheFor(type) {\n this.ngModulesScopeCache.delete(type);\n this.standaloneComponentsScopeCache.delete(type);\n }\n getNgModuleScope(type) {\n if (this.ngModulesScopeCache.has(type)) {\n return this.ngModulesScopeCache.get(type);\n }\n const scope = this.computeNgModuleScope(type);\n this.ngModulesScopeCache.set(type, scope);\n return scope;\n }\n computeNgModuleScope(type) {\n const def = getNgModuleDefOrThrow(type);\n const scope = {\n exported: {\n directives: new Set(),\n pipes: new Set()\n },\n compilation: {\n directives: new Set(),\n pipes: new Set()\n }\n };\n for (const imported of maybeUnwrapFn(def.imports)) {\n if (isNgModule(imported)) {\n const importedScope = this.getNgModuleScope(imported);\n addSet(importedScope.exported.directives, scope.compilation.directives);\n addSet(importedScope.exported.pipes, scope.compilation.pipes);\n } else if (isStandalone(imported)) {\n if (isDirective(imported) || isComponent(imported)) {\n scope.compilation.directives.add(imported);\n } else if (isPipe(imported)) {\n scope.compilation.pipes.add(imported);\n } else {\n throw new RuntimeError(980, 'The standalone imported type is neither a component nor a directive nor a pipe');\n }\n } else {\n scope.compilation.isPoisoned = true;\n break;\n }\n }\n if (!scope.compilation.isPoisoned) {\n for (const decl of maybeUnwrapFn(def.declarations)) {\n if (isNgModule(decl) || isStandalone(decl)) {\n scope.compilation.isPoisoned = true;\n break;\n }\n if (isPipe(decl)) {\n scope.compilation.pipes.add(decl);\n } else {\n scope.compilation.directives.add(decl);\n }\n }\n }\n for (const exported of maybeUnwrapFn(def.exports)) {\n if (isNgModule(exported)) {\n const exportedScope = this.getNgModuleScope(exported);\n addSet(exportedScope.exported.directives, scope.exported.directives);\n addSet(exportedScope.exported.pipes, scope.exported.pipes);\n addSet(exportedScope.exported.directives, scope.compilation.directives);\n addSet(exportedScope.exported.pipes, scope.compilation.pipes);\n } else if (isPipe(exported)) {\n scope.exported.pipes.add(exported);\n } else {\n scope.exported.directives.add(exported);\n }\n }\n return scope;\n }\n getStandaloneComponentScope(type, rawImports) {\n if (this.standaloneComponentsScopeCache.has(type)) {\n return this.standaloneComponentsScopeCache.get(type);\n }\n const ans = this.computeStandaloneComponentScope(type, rawImports);\n this.standaloneComponentsScopeCache.set(type, ans);\n return ans;\n }\n computeStandaloneComponentScope(type, rawImports) {\n const ans = {\n compilation: {\n directives: new Set([type]),\n pipes: new Set(),\n ngModules: new Set()\n }\n };\n for (const rawImport of flatten(rawImports ?? [])) {\n const imported = resolveForwardRef(rawImport);\n if (imported && isNgModule(imported)) {\n ans.compilation.ngModules.add(imported);\n const importedScope = this.getNgModuleScope(imported);\n if (importedScope.exported.isPoisoned) {\n ans.compilation.isPoisoned = true;\n return ans;\n }\n addSet(importedScope.exported.directives, ans.compilation.directives);\n addSet(importedScope.exported.pipes, ans.compilation.pipes);\n } else if (imported && isStandalone(imported)) {\n if (isPipe(imported)) {\n ans.compilation.pipes.add(imported);\n } else if (isDirective(imported) || isComponent(imported)) {\n ans.compilation.directives.add(imported);\n } else {\n ans.compilation.isPoisoned = true;\n return ans;\n }\n } else {\n ans.compilation.isPoisoned = true;\n return ans;\n }\n }\n return ans;\n }\n isOrphanComponent(cmp) {\n const def = getComponentDef(cmp);\n if (!def || def.standalone) {\n return false;\n }\n this.resolveNgModulesDecls();\n return !this.ownerNgModule.has(cmp);\n }\n}\nfunction addSet(sourceSet, targetSet) {\n for (const m of sourceSet) {\n targetSet.add(m);\n }\n}\nconst depsTracker = /*#__PURE__*/ new DepsTracker();\n\nfunction getClosestComponentName(node, predicate) {\n let currentNode = node;\n while (currentNode) {\n const lView = readPatchedLView(currentNode);\n if (lView !== null) {\n for (let i = HEADER_OFFSET; i < lView.length; i++) {\n const current = lView[i];\n if (!isLView(current) && !isLContainer(current) || current[HOST] !== currentNode) {\n continue;\n }\n const tView = lView[TVIEW$1];\n const tNode = getTNode(tView, i);\n if (isComponentHost(tNode)) {\n const def = tView.data[tNode.directiveStart + tNode.componentOffset];\n const name = getComponentName(def);\n if (name !== null && (!predicate || predicate(currentNode, name))) {\n return name;\n } else {\n break;\n }\n }\n }\n }\n currentNode = currentNode.parentNode;\n }\n return null;\n}\nfunction getComponentName(def) {\n return def.debugInfo?.className || def.type.name || null;\n}\n\nconst NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};\n\nclass ChainedInjector {\n injector;\n parentInjector;\n constructor(injector, parentInjector) {\n this.injector = injector;\n this.parentInjector = parentInjector;\n }\n get(token, notFoundValue, options) {\n const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, options);\n if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR || notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n return value;\n }\n return this.parentInjector.get(token, notFoundValue, options);\n }\n}\n\nfunction isListLikeIterable(obj) {\n if (!isJsObject(obj)) return false;\n return Array.isArray(obj) || !(obj instanceof Map) && Symbol.iterator in obj;\n}\nfunction areIterablesEqual(a, b, comparator) {\n const iterator1 = a[Symbol.iterator]();\n const iterator2 = b[Symbol.iterator]();\n while (true) {\n const item1 = iterator1.next();\n const item2 = iterator2.next();\n if (item1.done && item2.done) return true;\n if (item1.done || item2.done) return false;\n if (!comparator(item1.value, item2.value)) return false;\n }\n}\nfunction iterateListLike(obj, fn) {\n if (Array.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n } else {\n const iterator = obj[Symbol.iterator]();\n let item;\n while (!(item = iterator.next()).done) {\n fn(item.value);\n }\n }\n}\nfunction isJsObject(o) {\n return o !== null && (typeof o === 'function' || typeof o === 'object');\n}\n\nfunction devModeEqual(a, b) {\n const isListLikeIterableA = isListLikeIterable(a);\n const isListLikeIterableB = isListLikeIterable(b);\n if (isListLikeIterableA && isListLikeIterableB) {\n return areIterablesEqual(a, b, devModeEqual);\n } else {\n const isAObject = a && (typeof a === 'object' || typeof a === 'function');\n const isBObject = b && (typeof b === 'object' || typeof b === 'function');\n if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {\n return true;\n } else {\n return Object.is(a, b);\n }\n }\n}\n\nfunction updateBinding(lView, bindingIndex, value) {\n return lView[bindingIndex] = value;\n}\nfunction getBinding(lView, bindingIndex) {\n ngDevMode && assertIndexInRange(lView, bindingIndex);\n ngDevMode && assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');\n return lView[bindingIndex];\n}\nfunction bindingUpdated(lView, bindingIndex, value) {\n ngDevMode && assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);\n if (value === NO_CHANGE) {\n return false;\n }\n const oldValue = lView[bindingIndex];\n if (Object.is(oldValue, value)) {\n return false;\n } else {\n if (ngDevMode && isInCheckNoChangesMode()) {\n const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;\n if (!devModeEqual(oldValueToCompare, value)) {\n const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);\n throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName, lView);\n }\n return false;\n }\n lView[bindingIndex] = value;\n return true;\n }\n}\nfunction bindingUpdated2(lView, bindingIndex, exp1, exp2) {\n const different = bindingUpdated(lView, bindingIndex, exp1);\n return bindingUpdated(lView, bindingIndex + 1, exp2) || different;\n}\nfunction bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n}\nfunction bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;\n}\n\nfunction wrapListener(tNode, lView, listenerFn) {\n return function wrapListenerIn_markDirtyAndPreventDefault(event) {\n const nativeEl = wrapListenerIn_markDirtyAndPreventDefault.__ngNativeEl__;\n if (nativeEl !== undefined) {\n markEventHandledForElement(event, nativeEl);\n }\n const startView = isComponentHost(tNode) ? getComponentLViewByIndex(tNode.index, lView) : lView;\n markViewDirty(startView, 5);\n const context = lView[CONTEXT];\n let result = executeListenerWithErrorHandling(lView, context, listenerFn, event);\n let nextListenerFn = wrapListenerIn_markDirtyAndPreventDefault.__ngNextListenerFn__;\n while (nextListenerFn) {\n result = executeListenerWithErrorHandling(lView, context, nextListenerFn, event) && result;\n nextListenerFn = nextListenerFn.__ngNextListenerFn__;\n }\n return result;\n };\n}\nfunction executeListenerWithErrorHandling(lView, context, listenerFn, e) {\n const prevConsumer = setActiveConsumer$1(null);\n try {\n profiler(ProfilerEvent.OutputStart, context, listenerFn);\n return listenerFn(e) !== false;\n } catch (error) {\n handleUncaughtError(lView, error);\n return false;\n } finally {\n profiler(ProfilerEvent.OutputEnd, context, listenerFn);\n setActiveConsumer$1(prevConsumer);\n }\n}\nfunction listenToDomEvent(tNode, tView, lView, eventTargetResolver, renderer, eventName, originalListener, wrappedListener) {\n ngDevMode && assertNotSame(wrappedListener, originalListener, 'Expected wrapped and original listeners to be different.');\n const isTNodeDirectiveHost = isDirectiveHost(tNode);\n let hasCoalesced = false;\n let existingListener = null;\n if (!eventTargetResolver && isTNodeDirectiveHost) {\n existingListener = findExistingListener(tView, lView, eventName, tNode.index);\n }\n if (existingListener !== null) {\n const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;\n lastListenerFn.__ngNextListenerFn__ = originalListener;\n existingListener.__ngLastListenerFn__ = originalListener;\n hasCoalesced = true;\n } else {\n const native = getNativeByTNode(tNode, lView);\n const target = eventTargetResolver ? eventTargetResolver(native) : native;\n stashEventListenerImpl(lView, target, eventName, wrappedListener);\n if (!eventTargetResolver) {\n wrappedListener.__ngNativeEl__ = native;\n }\n const cleanupFn = renderer.listen(target, eventName, wrappedListener);\n if (!isAnimationEventType(eventName)) {\n const idxOrTargetGetter = eventTargetResolver ? _lView => eventTargetResolver(unwrapRNode(_lView[tNode.index])) : tNode.index;\n storeListenerCleanup(idxOrTargetGetter, tView, lView, eventName, wrappedListener, cleanupFn, false);\n }\n }\n return hasCoalesced;\n}\nfunction isAnimationEventType(eventName) {\n return eventName.startsWith('animation') || eventName.startsWith('transition');\n}\nfunction findExistingListener(tView, lView, eventName, tNodeIndex) {\n const tCleanup = tView.cleanup;\n if (tCleanup != null) {\n for (let i = 0; i < tCleanup.length - 1; i += 2) {\n const cleanupEventName = tCleanup[i];\n if (cleanupEventName === eventName && tCleanup[i + 1] === tNodeIndex) {\n const lCleanup = lView[CLEANUP];\n const listenerIdxInLCleanup = tCleanup[i + 2];\n return lCleanup && lCleanup.length > listenerIdxInLCleanup ? lCleanup[listenerIdxInLCleanup] : null;\n }\n if (typeof cleanupEventName === 'string') {\n i += 2;\n }\n }\n }\n return null;\n}\nfunction storeListenerCleanup(indexOrTargetGetter, tView, lView, eventName, listenerFn, cleanup, isOutput) {\n const tCleanup = tView.firstCreatePass ? getOrCreateTViewCleanup(tView) : null;\n const lCleanup = getOrCreateLViewCleanup(lView);\n const index = lCleanup.length;\n lCleanup.push(listenerFn, cleanup);\n tCleanup && tCleanup.push(eventName, indexOrTargetGetter, index, (index + 1) * (isOutput ? -1 : 1));\n}\n\nfunction createOutputListener(tNode, lView, listenerFn, targetDef, eventName) {\n const wrappedListener = wrapListener(tNode, lView, listenerFn);\n const hasBound = listenToDirectiveOutput(tNode, lView, targetDef, eventName, wrappedListener);\n if (!hasBound && ngDevMode) {\n throw new RuntimeError(316, `${stringifyForError(targetDef.type)} does not have an output with a public name of \"${eventName}\".`);\n }\n}\nfunction listenToDirectiveOutput(tNode, lView, target, eventName, listenerFn) {\n let hostIndex = null;\n let hostDirectivesStart = null;\n let hostDirectivesEnd = null;\n let hasOutput = false;\n if (ngDevMode && !tNode.directiveToIndex?.has(target.type)) {\n throw new Error(`Node does not have a directive with type ${target.type.name}`);\n }\n const data = tNode.directiveToIndex.get(target.type);\n if (typeof data === 'number') {\n hostIndex = data;\n } else {\n [hostIndex, hostDirectivesStart, hostDirectivesEnd] = data;\n }\n if (hostDirectivesStart !== null && hostDirectivesEnd !== null && tNode.hostDirectiveOutputs && Object.hasOwn(tNode.hostDirectiveOutputs, eventName)) {\n const hostDirectiveOutputs = tNode.hostDirectiveOutputs[eventName];\n for (let i = 0; i < hostDirectiveOutputs.length; i += 2) {\n const index = hostDirectiveOutputs[i];\n if (index >= hostDirectivesStart && index <= hostDirectivesEnd) {\n ngDevMode && assertIndexInRange(lView, index);\n hasOutput = true;\n listenToOutput(tNode, lView, index, hostDirectiveOutputs[i + 1], eventName, listenerFn);\n } else if (index > hostDirectivesEnd) {\n break;\n }\n }\n }\n if (Object.hasOwn(target.outputs, eventName)) {\n ngDevMode && assertIndexInRange(lView, hostIndex);\n hasOutput = true;\n listenToOutput(tNode, lView, hostIndex, eventName, eventName, listenerFn);\n }\n return hasOutput;\n}\nfunction listenToOutput(tNode, lView, directiveIndex, lookupName, eventName, listenerFn) {\n ngDevMode && assertIndexInRange(lView, directiveIndex);\n const instance = lView[directiveIndex];\n const tView = lView[TVIEW$1];\n const def = tView.data[directiveIndex];\n const propertyName = def.outputs[lookupName];\n const output = instance[propertyName];\n if (ngDevMode && !isOutputSubscribable(output)) {\n throw new Error(`@Output ${propertyName} not initialized in '${instance.constructor.name}'.`);\n }\n const subscription = output.subscribe(listenerFn);\n storeListenerCleanup(tNode.index, tView, lView, eventName, listenerFn, subscription, true);\n}\nfunction isOutputSubscribable(value) {\n return value != null && typeof value.subscribe === 'function';\n}\n\nfunction ษตษตcontrolCreate() {\n controlCreateInternal();\n}\nfunction controlCreateInternal() {\n const lView = getLView();\n const tView = getTView();\n const tNode = getCurrentTNode();\n if (tView.firstCreatePass) {\n initializeControlFirstCreatePass(tView, tNode);\n }\n if (tNode.controlDirectiveIndex === -1) {\n return;\n }\n performanceMarkFeature('NgSignalForms');\n const instance = lView[tNode.controlDirectiveIndex];\n const controlDef = tView.data[tNode.controlDirectiveIndex].controlDef;\n controlDef.create(instance, new ControlDirectiveHostImpl(lView, tView, tNode));\n}\nfunction ษตษตcontrol() {\n controlUpdateInternal();\n}\nfunction controlUpdateInternal() {\n if (ngDevMode && isInCheckNoChangesMode()) {\n return;\n }\n const lView = getLView();\n const tView = getTView();\n const tNode = getSelectedTNode();\n if (tNode.controlDirectiveIndex === -1) {\n return;\n }\n const controlDef = tView.data[tNode.controlDirectiveIndex].controlDef;\n const instance = lView[tNode.controlDirectiveIndex];\n controlDef.update(instance, new ControlDirectiveHostImpl(lView, tView, tNode));\n}\nclass ControlDirectiveHostImpl {\n lView;\n tView;\n tNode;\n hasPassThrough;\n constructor(lView, tView, tNode) {\n this.lView = lView;\n this.tView = tView;\n this.tNode = tNode;\n this.hasPassThrough = !!(tNode.flags & 4096);\n }\n get customControl() {\n return this.tNode.customControlIndex !== -1 ? this.lView[this.tNode.customControlIndex] : undefined;\n }\n get nativeElement() {\n return getNativeByTNode(this.tNode, this.lView);\n }\n get descriptor() {\n if (ngDevMode && isComponentHost(this.tNode)) {\n const componentIndex = this.tNode.directiveStart + this.tNode.componentOffset;\n const componentDef = this.tView.data[componentIndex];\n return `Component ${debugStringifyTypeForError(componentDef.type)}`;\n }\n return `<${this.tNode.value}>`;\n }\n listenToCustomControlOutput(outputName, callback) {\n const directiveDef = this.tView.data[this.tNode.customControlIndex];\n listenToDirectiveOutput(this.tNode, this.lView, directiveDef, outputName, wrapListener(this.tNode, this.lView, callback));\n }\n listenToCustomControlModel(listener) {\n const modelName = this.tNode.flags & 1024 ? 'valueChange' : 'checkedChange';\n const directiveDef = this.tView.data[this.tNode.customControlIndex];\n listenToDirectiveOutput(this.tNode, this.lView, directiveDef, modelName, wrapListener(this.tNode, this.lView, listener));\n }\n setInputOnDirectives(inputName, value, writePredicate) {\n const directiveIndices = this.tNode.inputs?.[inputName];\n const hostDirectiveInputs = this.tNode.hostDirectiveInputs?.[inputName];\n if (!directiveIndices && !hostDirectiveInputs) {\n return false;\n }\n let wasSet = false;\n if (directiveIndices) {\n for (const index of directiveIndices) {\n if (index === this.tNode.controlDirectiveIndex) {\n continue;\n }\n const directive = this.lView[index];\n const directiveDef = this.tView.data[index];\n const matchesPredicate = !writePredicate || writePredicate(readInputFromDirective(directive, directiveDef, inputName));\n if (matchesPredicate) {\n writeToDirectiveInput(directiveDef, directive, inputName, value);\n wasSet = true;\n }\n }\n }\n if (hostDirectiveInputs) {\n for (let i = 0; i < hostDirectiveInputs.length; i += 2) {\n const index = hostDirectiveInputs[i];\n if (index === this.tNode.controlDirectiveIndex) {\n continue;\n }\n const directive = this.lView[index];\n const internalName = hostDirectiveInputs[i + 1];\n const directiveDef = this.tView.data[index];\n const matchesPredicate = !writePredicate || writePredicate(readInputFromDirective(directive, directiveDef, inputName));\n if (matchesPredicate) {\n writeToDirectiveInput(directiveDef, directive, internalName, value);\n wasSet = true;\n }\n }\n }\n return wasSet;\n }\n setCustomControlModelInput(value) {\n const directiveDef = this.tView.data[this.tNode.customControlIndex];\n const modelName = this.tNode.flags & 1024 ? 'value' : 'checked';\n setDirectiveInput(this.tNode, this.tView, this.lView, directiveDef, modelName, value);\n }\n customControlHasInput(inputName) {\n if (this.tNode.customControlIndex === -1) {\n return false;\n }\n const directiveDef = this.tView.data[this.tNode.customControlIndex];\n const presence = directiveDef.signalFormsInputPresence ??= this._buildCustomControlInputCache(directiveDef);\n return presence[inputName] === true;\n }\n _buildCustomControlInputCache(directiveDef) {\n const cache = {};\n for (const key in directiveDef.inputs) {\n cache[key] = true;\n }\n if (directiveDef.hostDirectives !== null) {\n const queue = [...directiveDef.hostDirectives];\n while (queue.length > 0) {\n const hostDir = queue.shift();\n if (typeof hostDir !== 'function') {\n for (const key in hostDir.inputs) {\n cache[hostDir.inputs[key]] = true;\n }\n const hostDirectives = getHostDirectives(hostDir.directive);\n if (hostDirectives !== null) {\n queue.push(...hostDirectives);\n }\n continue;\n }\n for (const config of hostDir()) {\n if (typeof config === 'function') {\n continue;\n }\n if (config.inputs) {\n for (let i = 0; i < config.inputs.length; i += 2) {\n const exposedName = config.inputs[i + 1] || config.inputs[i];\n cache[exposedName] = true;\n }\n }\n const hostDirectives = getHostDirectives(config.directive);\n if (hostDirectives !== null) {\n queue.push(...hostDirectives);\n }\n }\n }\n }\n return cache;\n }\n}\nfunction getHostDirectives(directiveType) {\n if (typeof directiveType === 'function' && 'ษตdir' in directiveType) {\n return directiveType.ษตdir.hostDirectives ?? null;\n }\n return null;\n}\nfunction readInputFromDirective(instance, directiveDef, inputName) {\n if (!directiveDef.inputs || !Object.hasOwn(directiveDef.inputs, inputName)) {\n return undefined;\n }\n const [privateName, flags] = directiveDef.inputs[inputName];\n if ((flags & InputFlags.SignalBased) !== 0) {\n const field = instance[privateName];\n const node = field[SIGNAL];\n return node.value === REQUIRED_UNSET_VALUE ? undefined : node.value;\n }\n return instance[privateName];\n}\nfunction initializeControlFirstCreatePass(tView, tNode, lView) {\n ngDevMode && assertFirstCreatePass(tView);\n for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {\n const directiveDef = tView.data[i];\n if (directiveDef.controlDef) {\n tNode.controlDirectiveIndex = i;\n break;\n }\n }\n if (tNode.controlDirectiveIndex === -1) {\n return;\n }\n const controlDef = tView.data[tNode.controlDirectiveIndex].controlDef;\n if (controlDef.passThroughInput) {\n if ((tNode.inputs?.[controlDef.passThroughInput]?.length ?? 0) > 1) {\n tNode.flags |= 4096;\n return;\n }\n }\n initializeCustomControlStatus(tView, tNode);\n}\nfunction initializeCustomControlStatus(tView, tNode) {\n for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) {\n const directiveDef = tView.data[i];\n if (tNode.directiveToIndex && !tNode.directiveToIndex.has(directiveDef.type)) {\n continue;\n }\n if (hasModelInput(directiveDef, 'value')) {\n tNode.flags |= 1024;\n tNode.customControlIndex = i;\n return;\n }\n if (hasModelInput(directiveDef, 'checked')) {\n tNode.flags |= 2048;\n tNode.customControlIndex = i;\n return;\n }\n }\n if (tNode.hostDirectiveInputs !== null && tNode.hostDirectiveOutputs !== null && tNode.directiveToIndex !== null) {\n const checkModel = (modelName, flag) => {\n const inputs = tNode.hostDirectiveInputs[modelName];\n const outputs = tNode.hostDirectiveOutputs[modelName + 'Change'];\n if (!inputs || !outputs) {\n return false;\n }\n for (let i = 0; i < inputs.length; i += 2) {\n const inputIndex = inputs[i];\n for (let j = 0; j < outputs.length; j += 2) {\n const outputIndex = outputs[j];\n if (inputIndex !== outputIndex) {\n continue;\n }\n for (const data of tNode.directiveToIndex.values()) {\n if (!Array.isArray(data)) {\n continue;\n }\n const [hostIndex, start, end] = data;\n if (inputIndex >= start && inputIndex <= end) {\n tNode.flags |= flag;\n tNode.customControlIndex = hostIndex;\n return true;\n }\n }\n }\n }\n return false;\n };\n if (checkModel('value', 1024)) {\n return;\n }\n if (checkModel('checked', 2048)) {\n return;\n }\n }\n}\nfunction hasModelInput(directiveDef, name) {\n return hasInput(directiveDef, name) && hasOutput(directiveDef, name + 'Change');\n}\nfunction hasInput(directiveDef, name) {\n return name in directiveDef.inputs;\n}\nfunction hasOutput(directiveDef, name) {\n return name in directiveDef.outputs;\n}\n\nconst BINDING = /* @__PURE__ */Symbol('BINDING');\nconst INPUT_BINDING_METADATA = {\n kind: 'input',\n requiredVars: 1\n};\nconst OUTPUT_BINDING_METADATA = {\n kind: 'output',\n requiredVars: 0\n};\nfunction inputBindingUpdate(targetDirectiveIdx, publicName, value) {\n const lView = getLView();\n const bindingIndex = nextBindingIndex();\n if (bindingUpdated(lView, bindingIndex, value)) {\n const tView = lView[TVIEW$1];\n const tNode = getSelectedTNode();\n const componentLView = getComponentLViewByIndex(tNode.index, lView);\n markViewDirty(componentLView, 1);\n const targetDef = tView.directiveRegistry[targetDirectiveIdx];\n if (ngDevMode && !targetDef) {\n throw new RuntimeError(315, `Input binding to property \"${publicName}\" does not have a target.`);\n }\n const hasSet = setDirectiveInput(tNode, tView, lView, targetDef, publicName, value);\n if (ngDevMode) {\n if (!hasSet) {\n throw new RuntimeError(315, `${stringifyForError(targetDef.type)} does not have an input with a public name of \"${publicName}\".`);\n }\n storePropertyBindingMetadata(tView.data, tNode, publicName, bindingIndex);\n }\n }\n}\nfunction inputBinding(publicName, value) {\n if (publicName === 'formField') {\n const binding = {\n [BINDING]: INPUT_BINDING_METADATA,\n create: () => {\n controlCreateInternal();\n },\n update: () => {\n inputBindingUpdate(binding.targetIdx, publicName, value());\n controlUpdateInternal();\n }\n };\n return binding;\n }\n const binding = {\n [BINDING]: INPUT_BINDING_METADATA,\n update: () => inputBindingUpdate(binding.targetIdx, publicName, value())\n };\n return binding;\n}\nfunction outputBinding(eventName, listener) {\n const binding = {\n [BINDING]: OUTPUT_BINDING_METADATA,\n create: () => {\n const lView = getLView();\n const tNode = getCurrentTNode();\n const tView = lView[TVIEW$1];\n const targetDef = tView.directiveRegistry[binding.targetIdx];\n createOutputListener(tNode, lView, listener, targetDef, eventName);\n }\n };\n return binding;\n}\nfunction twoWayBinding(publicName, value) {\n const input = inputBinding(publicName, value);\n const output = outputBinding(publicName + 'Change', eventValue => value.set(eventValue));\n ngDevMode && assertNotDefined(input.create, 'Unexpected `create` callback in inputBinding');\n ngDevMode && assertNotDefined(output.update, 'Unexpected `update` callback in outputBinding');\n const binding = {\n [BINDING]: {\n kind: 'twoWay',\n requiredVars: input[BINDING].requiredVars + output[BINDING].requiredVars\n },\n set targetIdx(idx) {\n input.targetIdx = idx;\n output.targetIdx = idx;\n },\n create: output.create,\n update: input.update\n };\n return binding;\n}\n\nconst SHARED_STYLES_HOST = /*#__PURE__*/ new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'SHARED_STYLES_HOST' : '');\n\nfunction computeStaticStyling(tNode, attrs, writeToHost) {\n ngDevMode && assertFirstCreatePass(getTView(), 'Expecting to be called in first template pass only');\n let styles = writeToHost ? tNode.styles : null;\n let classes = writeToHost ? tNode.classes : null;\n let mode = 0;\n if (attrs !== null) {\n for (let i = 0; i < attrs.length; i++) {\n const value = attrs[i];\n if (typeof value === 'number') {\n mode = value;\n } else if (mode == 1) {\n classes = concatStringsWithSpace(classes, value);\n } else if (mode == 2) {\n const style = value;\n const styleValue = attrs[++i];\n styles = concatStringsWithSpace(styles, style + ': ' + styleValue + ';');\n }\n }\n }\n writeToHost ? tNode.styles = styles : tNode.stylesWithoutHost = styles;\n writeToHost ? tNode.classes = classes : tNode.classesWithoutHost = classes;\n}\n\nfunction ษตษตdirectiveInject(token, flags = 0) {\n const lView = getLView();\n if (lView === null) {\n ngDevMode && assertInjectImplementationNotEqual(ษตษตdirectiveInject);\n return __inject(token, flags);\n }\n const tNode = getCurrentTNode();\n const value = getOrCreateInjectable(tNode, lView, resolveForwardRef(token), flags);\n ngDevMode && emitInjectEvent(token, value, flags);\n return value;\n}\nfunction ษตษตinvalidFactory() {\n const msg = ngDevMode ? `This constructor was not compatible with Dependency Injection.` : 'invalid';\n throw new Error(msg);\n}\n\nfunction resolveDirectives(tView, lView, tNode, localRefs, directiveMatcher) {\n ngDevMode && assertFirstCreatePass(tView);\n const exportsMap = localRefs === null ? null : {\n '': -1\n };\n const matchedDirectiveDefs = directiveMatcher(tView, tNode);\n if (matchedDirectiveDefs !== null) {\n let directiveDefs = matchedDirectiveDefs;\n let hostDirectiveDefs = null;\n let hostDirectiveRanges = null;\n for (const def of matchedDirectiveDefs) {\n if (def.resolveHostDirectives !== null) {\n [directiveDefs, hostDirectiveDefs, hostDirectiveRanges] = def.resolveHostDirectives(matchedDirectiveDefs);\n break;\n }\n }\n ngDevMode && assertNoDuplicateDirectives(directiveDefs);\n initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs, hostDirectiveRanges);\n }\n if (exportsMap !== null && localRefs !== null) {\n cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n }\n}\nfunction cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n const localNames = tNode.localNames = [];\n for (let i = 0; i < localRefs.length; i += 2) {\n const index = exportsMap[localRefs[i + 1]];\n if (index == null) throw new RuntimeError(-301, ngDevMode && `Export of name '${localRefs[i + 1]}' not found!`);\n localNames.push(localRefs[i], index);\n }\n}\nfunction markAsComponentHost(tView, hostTNode, componentOffset) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertGreaterThan(componentOffset, -1, 'componentOffset must be great than -1');\n hostTNode.componentOffset = componentOffset;\n (tView.components ??= []).push(hostTNode.index);\n}\nfunction initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs, hostDirectiveRanges) {\n ngDevMode && assertFirstCreatePass(tView);\n const directivesLength = directives.length;\n let componentDef = null;\n for (let i = 0; i < directivesLength; i++) {\n const def = directives[i];\n if (componentDef === null && isComponentDef(def)) {\n componentDef = def;\n markAsComponentHost(tView, tNode, i);\n }\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, def.type);\n }\n initTNodeFlags(tNode, tView.data.length, directivesLength);\n if (componentDef?.viewProvidersResolver) {\n componentDef.viewProvidersResolver(componentDef);\n }\n for (let i = 0; i < directivesLength; i++) {\n const def = directives[i];\n if (def.providersResolver) {\n def.providersResolver(def);\n }\n }\n let preOrderHooksFound = false;\n let preOrderCheckHooksFound = false;\n let directiveIdx = allocExpando(tView, lView, directivesLength, null);\n ngDevMode && assertSame(directiveIdx, tNode.directiveStart, 'TNode.directiveStart should point to just allocated space');\n if (directivesLength > 0) {\n tNode.directiveToIndex = new Map();\n }\n for (let i = 0; i < directivesLength; i++) {\n const def = directives[i];\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs);\n configureViewWithDirective(tView, tNode, lView, directiveIdx, def);\n saveNameToExportMap(directiveIdx, def, exportsMap);\n if (hostDirectiveRanges !== null && hostDirectiveRanges.has(def)) {\n const [start, end] = hostDirectiveRanges.get(def);\n tNode.directiveToIndex.set(def.type, [directiveIdx, start + tNode.directiveStart, end + tNode.directiveStart]);\n } else if (hostDirectiveDefs === null || !hostDirectiveDefs.has(def)) {\n tNode.directiveToIndex.set(def.type, directiveIdx);\n }\n if (def.contentQueries !== null) tNode.flags |= 4;\n if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0) tNode.flags |= 64;\n const lifeCycleHooks = def.type.prototype;\n if (!preOrderHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) {\n (tView.preOrderHooks ??= []).push(tNode.index);\n preOrderHooksFound = true;\n }\n if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) {\n (tView.preOrderCheckHooks ??= []).push(tNode.index);\n preOrderCheckHooksFound = true;\n }\n directiveIdx++;\n }\n initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs);\n}\nfunction initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs) {\n ngDevMode && assertFirstCreatePass(tView);\n for (let index = tNode.directiveStart; index < tNode.directiveEnd; index++) {\n const directiveDef = tView.data[index];\n if (hostDirectiveDefs === null || !hostDirectiveDefs.has(directiveDef)) {\n setupSelectorMatchedInputsOrOutputs(0, tNode, directiveDef, index);\n setupSelectorMatchedInputsOrOutputs(1, tNode, directiveDef, index);\n setupInitialInputs(tNode, index, false);\n } else {\n const hostDirectiveDef = hostDirectiveDefs.get(directiveDef);\n setupHostDirectiveInputsOrOutputs(0, tNode, hostDirectiveDef, index);\n setupHostDirectiveInputsOrOutputs(1, tNode, hostDirectiveDef, index);\n setupInitialInputs(tNode, index, true);\n }\n }\n}\nfunction setupSelectorMatchedInputsOrOutputs(mode, tNode, def, directiveIndex) {\n const aliasMap = mode === 0 ? def.inputs : def.outputs;\n for (const publicName in aliasMap) {\n if (Object.hasOwn(aliasMap, publicName)) {\n let bindings;\n if (mode === 0) {\n bindings = tNode.inputs ??= {};\n } else {\n bindings = tNode.outputs ??= {};\n }\n bindings[publicName] ??= [];\n bindings[publicName].push(directiveIndex);\n setShadowStylingInputFlags(tNode, publicName);\n }\n }\n}\nfunction setupHostDirectiveInputsOrOutputs(mode, tNode, config, directiveIndex) {\n const aliasMap = mode === 0 ? config.inputs : config.outputs;\n for (const initialName in aliasMap) {\n if (Object.hasOwn(aliasMap, initialName)) {\n const publicName = aliasMap[initialName];\n let bindings;\n if (mode === 0) {\n bindings = tNode.hostDirectiveInputs ??= {};\n } else {\n bindings = tNode.hostDirectiveOutputs ??= {};\n }\n bindings[publicName] ??= [];\n bindings[publicName].push(directiveIndex, initialName);\n setShadowStylingInputFlags(tNode, publicName);\n }\n }\n}\nfunction setShadowStylingInputFlags(tNode, publicName) {\n if (publicName === 'class') {\n tNode.flags |= 8;\n } else if (publicName === 'style') {\n tNode.flags |= 16;\n }\n}\nfunction setupInitialInputs(tNode, directiveIndex, isHostDirective) {\n const {\n attrs,\n inputs,\n hostDirectiveInputs\n } = tNode;\n if (attrs === null || !isHostDirective && inputs === null || isHostDirective && hostDirectiveInputs === null || isInlineTemplate(tNode)) {\n tNode.initialInputs ??= [];\n tNode.initialInputs.push(null);\n return;\n }\n let inputsToStore = null;\n let i = 0;\n while (i < attrs.length) {\n const attrName = attrs[i];\n if (attrName === 0) {\n i += 4;\n continue;\n } else if (attrName === 5) {\n i += 2;\n continue;\n } else if (typeof attrName === 'number') {\n break;\n }\n if (!isHostDirective && Object.hasOwn(inputs, attrName)) {\n const inputConfig = inputs[attrName];\n for (const index of inputConfig) {\n if (index === directiveIndex) {\n inputsToStore ??= [];\n inputsToStore.push(attrName, attrs[i + 1]);\n break;\n }\n }\n } else if (isHostDirective && Object.hasOwn(hostDirectiveInputs, attrName)) {\n const config = hostDirectiveInputs[attrName];\n for (let j = 0; j < config.length; j += 2) {\n if (config[j] === directiveIndex) {\n inputsToStore ??= [];\n inputsToStore.push(config[j + 1], attrs[i + 1]);\n break;\n }\n }\n }\n i += 2;\n }\n tNode.initialInputs ??= [];\n tNode.initialInputs.push(inputsToStore);\n}\nfunction configureViewWithDirective(tView, tNode, lView, directiveIndex, def) {\n ngDevMode && assertGreaterThanOrEqual(directiveIndex, HEADER_OFFSET, 'Must be in Expando section');\n tView.data[directiveIndex] = def;\n const directiveFactory = def.factory || (def.factory = getFactoryDef(def.type, true));\n const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), ษตษตdirectiveInject, ngDevMode ? def.type.name : null);\n tView.blueprint[directiveIndex] = nodeInjectorFactory;\n lView[directiveIndex] = nodeInjectorFactory;\n registerHostBindingOpCodes(tView, tNode, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def);\n}\nfunction registerHostBindingOpCodes(tView, tNode, directiveIdx, directiveVarsIdx, def) {\n ngDevMode && assertFirstCreatePass(tView);\n const hostBindings = def.hostBindings;\n if (hostBindings) {\n let hostBindingOpCodes = tView.hostBindingOpCodes;\n if (hostBindingOpCodes === null) {\n hostBindingOpCodes = tView.hostBindingOpCodes = [];\n }\n const elementIndx = ~tNode.index;\n if (lastSelectedElementIdx(hostBindingOpCodes) != elementIndx) {\n hostBindingOpCodes.push(elementIndx);\n }\n hostBindingOpCodes.push(directiveIdx, directiveVarsIdx, hostBindings);\n }\n}\nfunction lastSelectedElementIdx(hostBindingOpCodes) {\n let i = hostBindingOpCodes.length;\n while (i > 0) {\n const value = hostBindingOpCodes[--i];\n if (typeof value === 'number' && value < 0) {\n return value;\n }\n }\n return 0;\n}\nfunction saveNameToExportMap(directiveIdx, def, exportsMap) {\n if (exportsMap) {\n if (def.exportAs) {\n for (let i = 0; i < def.exportAs.length; i++) {\n exportsMap[def.exportAs[i]] = directiveIdx;\n }\n }\n if (isComponentDef(def)) exportsMap[''] = directiveIdx;\n }\n}\nfunction initTNodeFlags(tNode, index, numberOfDirectives) {\n ngDevMode && assertNotEqual(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, 'Reached the max number of directives');\n tNode.flags |= 1;\n tNode.directiveStart = index;\n tNode.directiveEnd = index + numberOfDirectives;\n tNode.providerIndexes = index;\n}\nfunction assertNoDuplicateDirectives(directives) {\n if (directives.length < 2) {\n return;\n }\n const seenDirectives = new Set();\n for (const current of directives) {\n if (seenDirectives.has(current)) {\n throw new RuntimeError(309, `Directive ${current.type.name} matches multiple times on the same element. ` + `Directives can only match an element once.`);\n }\n seenDirectives.add(current);\n }\n}\n\nfunction directiveHostFirstCreatePass(index, lView, type, name, directiveMatcher, bindingsEnabled, attrsIndex, localRefsIndex) {\n const tView = lView[TVIEW$1];\n ngDevMode && assertFirstCreatePass(tView);\n const tViewConsts = tView.consts;\n const attrs = getConstant(tViewConsts, attrsIndex);\n const tNode = getOrCreateTNode(tView, index, type, name, attrs);\n if (bindingsEnabled) {\n resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex), directiveMatcher);\n }\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);\n if (tNode.attrs !== null) {\n computeStaticStyling(tNode, tNode.attrs, false);\n }\n if (tNode.mergedAttrs !== null) {\n computeStaticStyling(tNode, tNode.mergedAttrs, true);\n }\n if (tView.queries !== null) {\n tView.queries.elementStart(tView, tNode);\n }\n return tNode;\n}\nfunction directiveHostEndFirstCreatePass(tView, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n registerPostOrderHooks(tView, tNode);\n if (isContentQueryHost(tNode)) {\n tView.queries.elementEnd(tNode);\n }\n}\nfunction domOnlyFirstCreatePass(index, tView, type, name, attrsIndex, localRefsIndex) {\n ngDevMode && assertFirstCreatePass(tView);\n const tViewConsts = tView.consts;\n const attrs = getConstant(tViewConsts, attrsIndex);\n const tNode = getOrCreateTNode(tView, index, type, name, attrs);\n tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs);\n if (localRefsIndex != null) {\n const refs = getConstant(tViewConsts, localRefsIndex);\n tNode.localNames = [];\n for (let i = 0; i < refs.length; i += 2) {\n tNode.localNames.push(refs[i], -1);\n }\n }\n if (tNode.attrs !== null) {\n computeStaticStyling(tNode, tNode.attrs, false);\n }\n if (tNode.mergedAttrs !== null) {\n computeStaticStyling(tNode, tNode.mergedAttrs, true);\n }\n if (tView.queries !== null) {\n tView.queries.elementStart(tView, tNode);\n }\n return tNode;\n}\n\nconst shadowRootSupported = typeof ShadowRoot !== 'undefined';\nconst documentSupported = typeof Document !== 'undefined';\nfunction toInputRefArray(map) {\n return Object.keys(map).map(name => {\n const [propName, flags, transform] = map[name];\n const inputData = {\n propName: propName,\n templateName: name,\n isSignal: (flags & InputFlags.SignalBased) !== 0\n };\n if (transform) {\n inputData.transform = transform;\n }\n return inputData;\n });\n}\nfunction toOutputRefArray(map) {\n return Object.keys(map).map(name => ({\n propName: map[name],\n templateName: name\n }));\n}\nfunction verifyNotAnOrphanComponent(componentDef) {\n if ((typeof ngJitMode === 'undefined' || ngJitMode) && componentDef.debugInfo?.forbidOrphanRendering) {\n if (depsTracker.isOrphanComponent(componentDef.type)) {\n throw new RuntimeError(981, `Orphan component found! Trying to render the component ${debugStringifyTypeForError(componentDef.type)} without first loading the NgModule that declares it. It is recommended to make this component standalone in order to avoid this error. If this is not possible now, import the component's NgModule in the appropriate NgModule, or the standalone component in which you are trying to render this component. If this is a lazy import, load the NgModule lazily as well and use its module injector.`);\n }\n }\n}\nfunction createRootViewInjector(componentDef, environmentInjector, injector) {\n let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ? environmentInjector : environmentInjector?.injector;\n if (realEnvironmentInjector && componentDef.getStandaloneInjector !== null) {\n realEnvironmentInjector = componentDef.getStandaloneInjector(realEnvironmentInjector) || realEnvironmentInjector;\n }\n const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;\n return rootViewInjector;\n}\nfunction createRootLViewEnvironment(rootLViewInjector) {\n const rendererFactory = rootLViewInjector.get(RendererFactory2, null);\n if (rendererFactory === null) {\n throw new RuntimeError(407, ngDevMode && 'Angular was not able to inject a renderer (RendererFactory2). ' + 'Likely this is due to a broken DI hierarchy. ' + 'Make sure that any injector used to create this component has a correct parent.');\n }\n const sanitizer = rootLViewInjector.get(Sanitizer, null);\n const changeDetectionScheduler = rootLViewInjector.get(ChangeDetectionScheduler, null);\n const tracingService = rootLViewInjector.get(TracingService, null, {\n optional: true\n });\n let ngReflect = false;\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n ngReflect = rootLViewInjector.get(NG_REFLECT_ATTRS_FLAG, NG_REFLECT_ATTRS_FLAG_DEFAULT);\n }\n return {\n rendererFactory,\n sanitizer,\n changeDetectionScheduler,\n ngReflect,\n tracingService\n };\n}\nfunction createHostElement(componentDef, renderer, hostElementNamespace) {\n const tagName = inferTagNameFromDefinition(componentDef);\n const namespace = tagName === 'svg' ? SVG_NAMESPACE : tagName === 'math' ? MATH_ML_NAMESPACE : hostElementNamespace;\n return createElementNode(renderer, tagName, namespace);\n}\nfunction assertNotScriptHostElement(element) {\n const elementName = element && 'localName' in element && typeof element.localName === 'string' ? element.localName : element?.tagName;\n if (elementName?.toLowerCase() === 'script') {\n throw new RuntimeError(905, ngDevMode && `\" + + +
+ + diff --git a/suites-experimental/chat-room-angular/src/main.ts b/suites-experimental/chat-room-angular/src/main.ts new file mode 100644 index 000000000..9174bb93a --- /dev/null +++ b/suites-experimental/chat-room-angular/src/main.ts @@ -0,0 +1,11 @@ +import { provideZoneChangeDetection } from "@angular/core"; +import { bootstrapApplication } from "@angular/platform-browser"; +import { App } from "./app"; + +// Zone-based change detection, without event coalescing, so an update renders +// synchronously when the event handler that caused it returns, as it does for +// a click in React and in Svelte's microtask. Zoneless Angular renders in a +// setTimeout/rAF race instead, which the suite's MessageChannel yield between +// interactions does not wait for in every browser, so interactions would +// coalesce and the suite would measure less work than the other ports do. +bootstrapApplication(App, { providers: [provideZoneChangeDetection()] }).catch((error) => console.error(error)); diff --git a/suites-experimental/chat-room-angular/src/row-heights.js b/suites-experimental/chat-room-angular/src/row-heights.js new file mode 100644 index 000000000..78b4b6117 --- /dev/null +++ b/suites-experimental/chat-room-angular/src/row-heights.js @@ -0,0 +1,126 @@ +// The height model behind the windowed timeline: estimate, measure, cache, +// correct. Offsets are prefix sums over a mix of measured and estimated heights, +// rebuilt from the earliest row that changed, which is what turns a scroll offset +// back into a row index without touching the DOM. +// +// Hand-rolled because a chat row's height depends on how its text wraps, which a +// generic virtualizer expects to know up front. + +// A negative height means "not measured yet". 0 is reachable -- a conditionally +// collapsed row measures 0px -- and has to stay measured, or it would be +// re-measured on every pass forever. +const UNMEASURED = -1; + +export class RowHeights { + #estimate; + #count; + #heights; + #offsets; + + // The oldest loaded row. The model covers [#first, #count); older rows + // contribute no height because they are not in the timeline yet. + #first; + + // Earliest row whose offset needs recomputing: changing row i only moves the + // rows after it. #count + 1 means everything is up to date. + #dirtyFrom; + + constructor(count, first, estimate) { + this.#estimate = estimate; + this.#count = count; + this.#first = first; + this.#heights = new Float64Array(count).fill(UNMEASURED); + this.#offsets = new Float64Array(count + 1); + this.#dirtyFrom = first; + } + + get count() { + return this.#count; + } + + get first() { + return this.#first; + } + + // Load older history. Measured heights stay valid because a row keeps its + // index: the offsets all shift by the height of the rows that were added, + // which is what lets the scroll position be corrected exactly. + extendTo(first) { + if (first >= this.#first) + return; + this.#first = first; + this.#dirtyFrom = first; + } + + // A room only ever grows at the end, when the local user sends, so every + // measured height and every offset up to the old end survives. + grow(count) { + if (count <= this.#count) + return; + + const heights = new Float64Array(count); + heights.set(this.#heights); + heights.fill(UNMEASURED, this.#count); + const offsets = new Float64Array(count + 1); + offsets.set(this.#offsets); + + this.#dirtyFrom = Math.min(this.#dirtyFrom, this.#count); + this.#heights = heights; + this.#offsets = offsets; + this.#count = count; + } + + heightAt(index) { + const height = this.#heights[index]; + return height === UNMEASURED ? this.#estimate : height; + } + + // Returns whether the cached height moved, so a caller that read offsets + // before the pass knows they are now stale. + measure(index, height) { + if (this.#heights[index] === height) + return false; + this.#heights[index] = height; + if (index < this.#dirtyFrom) + this.#dirtyFrom = index; + return true; + } + + offsetAt(index) { + this.#recomputeOffsets(); + return this.#offsets[index]; + } + + get totalHeight() { + this.#recomputeOffsets(); + return this.#offsets[this.#count]; + } + + // The row containing a content offset, clamped at both ends. + indexAt(offset) { + this.#recomputeOffsets(); + const offsets = this.#offsets; + let low = this.#first; + let high = this.#count - 1; + while (low < high) { + const middle = (low + high + 1) >> 1; + if (offsets[middle] <= offset) + low = middle; + else + high = middle - 1; + } + return Math.max(this.#first, low); + } + + #recomputeOffsets() { + if (this.#dirtyFrom > this.#count) + return; + const offsets = this.#offsets; + // Offsets run from the oldest loaded row, which is the origin the + // scroller's own coordinates line up with. + offsets[this.#first] = 0; + for (let i = this.#dirtyFrom; i < this.#count; i++) + offsets[i + 1] = offsets[i] + this.heightAt(i); + this.#dirtyFrom = this.#count + 1; + } +} diff --git a/suites-experimental/chat-room-angular/src/styles.css b/suites-experimental/chat-room-angular/src/styles.css new file mode 100644 index 000000000..590d7ba3c --- /dev/null +++ b/suites-experimental/chat-room-angular/src/styles.css @@ -0,0 +1,497 @@ +* { + box-sizing: border-box; +} + +html, +body { + margin: 0; + height: 100%; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; + color: #17191c; + background-color: #f4f6fa; +} + +#root { + height: 100vh; +} + +.app { + display: grid; + grid-template-columns: 300px 1fr; + height: 100vh; + overflow: hidden; +} + +/* Avatars are CSS-drawn circles, so the workload ships no image assets. */ +.avatar { + display: inline-flex; + align-items: center; + justify-content: center; + flex: 0 0 auto; + width: 36px; + height: 36px; + border-radius: 50%; + color: #fff; + font-size: 13px; + font-weight: 600; + text-transform: uppercase; +} + +/* Room list (sidebar) */ +.room-list { + display: flex; + flex-direction: column; + overflow-y: auto; + border-right: 1px solid #e3e8ef; + background-color: #fff; +} + +.room-list-item { + display: flex; + align-items: center; + gap: 12px; + padding: 10px 14px; + border: 0; + border-bottom: 1px solid #f0f2f5; + background: transparent; + text-align: left; + cursor: pointer; + font: inherit; + color: inherit; +} + +.room-list-item:hover { + background-color: #f4f6fa; +} + +.room-list-item-selected { + background-color: #e8f0fe; +} + +.room-list-item-text { + display: flex; + flex-direction: column; + min-width: 0; +} + +.room-list-item-name { + font-weight: 600; + font-size: 15px; +} + +.room-list-item-preview { + font-size: 13px; + color: #737d8c; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +/* Room (main panel) */ +.room { + display: flex; + flex-direction: column; + min-width: 0; + height: 100vh; +} + +.room-header { + padding: 14px 20px; + border-bottom: 1px solid #e3e8ef; + background-color: #fff; +} + +.room-header-name { + margin: 0; + font-size: 18px; +} + +.room-header-topic { + margin: 4px 0 0; + font-size: 13px; + color: #737d8c; +} + +/* Composer. Sits below the timeline, so the scroller gives up the height it takes. */ +.composer { + display: flex; + flex: 0 0 auto; + gap: 8px; + padding: 12px 20px; + border-top: 1px solid #e3e8ef; + background-color: #fff; +} + +.composer-input { + flex: 1 1 auto; + min-width: 0; + padding: 8px 12px; + border: 1px solid #d5dbe5; + border-radius: 8px; + font: inherit; + font-size: 14px; + color: inherit; +} + +.composer-input:focus { + border-color: #9dc0f5; + outline: 2px solid #dce8fb; + outline-offset: -1px; +} + +.composer-send { + flex: 0 0 auto; + padding: 8px 16px; + border: 0; + border-radius: 8px; + background-color: #2a6fd6; + font: inherit; + font-size: 14px; + font-weight: 600; + color: #fff; + cursor: pointer; +} + +.composer-send:hover:enabled { + background-color: #245fb8; +} + +.composer-send:disabled { + background-color: #c8d1de; + cursor: default; +} + +/* Timeline. No vertical padding, so scrollTop maps one to one onto the height + model's row offsets. overflow-anchor is off because the timeline corrects its own + scroll position after measuring, and the browser would apply a second correction + for the same content change. */ +.timeline { + flex: 1 1 auto; + margin: 0; + padding: 0 20px; + list-style: none; + overflow-y: auto; + overflow-anchor: none; +} + +/* A row is a column: the separators stack above the message's own flex row. */ +.timeline-message { + padding: 6px 0; +} + +.timeline-message-row { + display: flex; + gap: 12px; +} + +/* Grouped messages drop the avatar and name; the gutter keeps the body aligned + and carries the timestamp on hover, the way real clients do. */ +.timeline-message-grouped { + padding: 1px 0; +} + +.timeline-message-gutter { + flex: 0 0 auto; + width: 36px; + font-size: 11px; + color: #939aa5; + text-align: right; + opacity: 0; +} + +.timeline-message-grouped:hover .timeline-message-gutter { + opacity: 1; +} + +/* Date separator: a centred label between two rules, drawn with pseudo-element + borders so it costs a real layout box either side. */ +.timeline-date-separator { + display: flex; + align-items: center; + gap: 8px; + margin: 10px 0 6px; +} + +.timeline-date-separator::before, +.timeline-date-separator::after { + content: ""; + flex: 1 1 auto; + border-top: 1px solid #e3e6ea; +} + +.timeline-date-separator-label { + flex: 0 0 auto; + padding: 2px 10px; + border: 1px solid #e3e6ea; + border-radius: 10px; + background-color: #fff; + color: #6b7280; + font-size: 11px; + font-weight: 600; +} + +/* The unread divider sits above the first message the reader has not seen. */ +.timeline-unread-divider { + display: flex; + align-items: center; + gap: 8px; + margin: 8px 0 4px; + border-top: 1px solid #e2564a; +} + +.timeline-unread-divider-label { + margin-left: auto; + padding: 1px 8px; + border-radius: 0 0 8px 8px; + background-color: #e2564a; + color: #fff; + font-size: 10px; + font-weight: 700; + text-transform: uppercase; +} + +.timeline-message-body { + min-width: 0; + flex: 1 1 auto; +} + +/* The jump target of a reply click. Background only: changing the box would + invalidate measured row heights. */ +.timeline-message-highlighted { + background-color: #fff6d8; +} + +/* Inline reply quote: a button, because clicking it jumps to the parent. */ +.timeline-message-reply { + display: flex; + gap: 6px; + align-items: baseline; + width: 100%; + margin-bottom: 2px; + padding: 0 0 0 8px; + border: 0; + border-left: 2px solid #d5dbe5; + background: transparent; + font: inherit; + font-size: 12px; + color: #737d8c; + text-align: left; + cursor: pointer; +} + +.timeline-message-reply:hover { + border-left-color: #9dc0f5; + color: #5a6472; +} + +.timeline-message-reply-sender { + flex: 0 0 auto; + font-weight: 600; + color: #5a6472; +} + +.timeline-message-reply-excerpt { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.timeline-message-meta { + display: flex; + align-items: baseline; + gap: 8px; +} + +.timeline-message-sender { + font-weight: 600; + font-size: 14px; +} + +.timeline-message-time { + font-size: 12px; + color: #939aa5; +} + +.timeline-message-text { + margin-top: 2px; + font-size: 14px; + line-height: 1.4; + color: #2c3038; +} + +/* Rich message content */ +.rich-paragraph { + margin: 0 0 4px; +} + +.rich-paragraph:last-child { + margin-bottom: 0; +} + +.rich-code { + padding: 1px 4px; + border: 1px solid #e3e8ef; + border-radius: 4px; + background-color: #f4f6fa; + font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; + font-size: 0.9em; + color: #b4295c; +} + +.rich-code-block { + margin: 4px 0; + padding: 8px 10px; + overflow-x: auto; + border: 1px solid #e3e8ef; + border-radius: 6px; + background-color: #f8fafc; + font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; + font-size: 12px; + line-height: 1.45; + white-space: pre; +} + +/* Attachments and link previews. The artwork is procedurally generated SVG. */ +.rich-image { + display: block; + max-width: 100%; + height: auto; + margin: 6px 0; + border: 1px solid #e3e8ef; + border-radius: 8px; +} + +.rich-unfurl { + display: flex; + gap: 10px; + max-width: 460px; + margin: 6px 0; + padding: 10px; + border: 1px solid #e3e8ef; + border-left: 3px solid #9dc0f5; + border-radius: 8px; + background-color: #fbfcfe; + color: inherit; + text-decoration: none; +} + +.rich-unfurl:hover { + background-color: #f4f8ff; +} + +.rich-unfurl-thumb { + flex: 0 0 auto; + border-radius: 6px; +} + +.rich-unfurl-body { + display: flex; + flex-direction: column; + gap: 2px; + min-width: 0; +} + +.rich-unfurl-site { + font-size: 11px; + font-weight: 600; + color: #737d8c; + text-transform: uppercase; + letter-spacing: 0.02em; +} + +.rich-unfurl-title { + font-weight: 600; + color: #24509b; +} + +.rich-unfurl-description { + font-size: 13px; + color: #5a6472; +} + +.rich-quote { + margin: 4px 0; + padding: 2px 0 2px 10px; + border-left: 3px solid #c8d1de; + color: #5a6472; +} + +.rich-list { + margin: 4px 0; + padding-left: 20px; +} + +.rich-link { + color: #2a6fd6; + text-decoration: underline; +} + +.rich-pill { + padding: 0 5px; + border: 0; + border-radius: 10px; + font: inherit; + font-weight: 500; + white-space: nowrap; +} + +.rich-pill-mention { + background-color: #e2ecfd; + color: #24509b; +} + +/* A #room pill is a button: clicking it switches to that room. */ +.rich-pill-room { + background-color: #e6f6ee; + color: #1c6e4c; + cursor: pointer; +} + +.rich-pill-room:hover { + background-color: #d3efe1; +} + +/* Reactions */ +.timeline-message-reactions { + display: flex; + flex-wrap: wrap; + gap: 6px; + margin-top: 4px; +} + +/* Reaction pills are real toggle buttons. */ +.reaction { + display: inline-flex; + align-items: center; + gap: 4px; + padding: 1px 8px; + border: 1px solid #e3e8ef; + border-radius: 12px; + background-color: #f4f6fa; + font: inherit; + font-size: 12px; + color: inherit; + cursor: pointer; +} + +.reaction:hover { + border-color: #c8d1de; + background-color: #eaeef5; +} + +.reaction-mine { + border-color: #9dc0f5; + background-color: #e2ecfd; +} + +.reaction-mine .reaction-count { + color: #24509b; + font-weight: 600; +} + +.reaction-count { + color: #737d8c; +} diff --git a/suites-experimental/chat-room-angular/src/types.ts b/suites-experimental/chat-room-angular/src/types.ts new file mode 100644 index 000000000..e62b45a10 --- /dev/null +++ b/suites-experimental/chat-room-angular/src/types.ts @@ -0,0 +1,41 @@ +// The shapes data/rooms.js builds. That file is shared verbatim with the other +// ChatRoom ports, so it stays JavaScript and the types live here. + +export type Span = { type: "text"; text: string } | { type: "code"; text: string } | { type: "link"; text: string; href: string } | { type: "mention"; name: string } | { type: "room"; name: string; roomId: string }; + +export type Block = + | { type: "p"; spans: Span[] } + | { type: "quote"; spans: Span[] } + | { type: "code"; lang: string; lines: string[] } + | { type: "list"; items: Span[][] } + | { type: "image"; src: string; width: number; height: number; alt: string } + | { type: "unfurl"; href: string; site: string; title: string; description: string; thumbSrc: string; thumbWidth: number; thumbHeight: number }; + +export interface ChatReaction { + emoji: string; + count: number; +} + +export interface ChatMessage { + id: string; + sender: string; + senderInitials: string; + colorIndex: number; + time: string; + dayIndex: number; + blocks: Block[]; + replyTo: { id: string; sender: string; excerpt: string } | null; + grouped: boolean; + reactions: ChatReaction[]; +} + +export interface Room { + id: string; + name: string; + colorIndex: number; + initials: string; + topic: string; + lastMessage: string; + readUpToIndex: number; + messages: ChatMessage[]; +} diff --git a/suites-experimental/chat-room-angular/tsconfig.json b/suites-experimental/chat-room-angular/tsconfig.json new file mode 100644 index 000000000..8296460c4 --- /dev/null +++ b/suites-experimental/chat-room-angular/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "strict": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "skipLibCheck": true, + "isolatedModules": true, + "importHelpers": true, + "allowJs": true, + "target": "ES2022", + "module": "preserve" + }, + "files": ["src/main.ts"], + "angularCompilerOptions": { + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "typeCheckHostBindings": true, + "strictTemplates": true + } +} diff --git a/suites-experimental/chat-room-svelte/.gitignore b/suites-experimental/chat-room-svelte/.gitignore new file mode 100644 index 000000000..994970872 --- /dev/null +++ b/suites-experimental/chat-room-svelte/.gitignore @@ -0,0 +1,19 @@ +node_modules + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +pnpm-debug.log* + +# dist-ssr / local +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.sw? diff --git a/suites-experimental/chat-room-svelte/README.md b/suites-experimental/chat-room-svelte/README.md new file mode 100644 index 000000000..3cc448a64 --- /dev/null +++ b/suites-experimental/chat-room-svelte/README.md @@ -0,0 +1,36 @@ +## Description + +A Svelte 5 port of the [ChatRoom-React](../chat-room/README.md) workload: the same +two-pane chat app, the same deterministic fixtures, the same windowed timeline, +and the same measured steps, so the two can be compared directly. + +`src/data/`, `src/row-heights.js` and `src/styles.css` are copies of the React +workload's files and should be kept in sync with them. The components are +rewritten with runes, and render the same DOM as the React version, row for row +and pixel for pixel. + +## What are we testing + +The same interactions as ChatRoom-React (see its README), through Svelte's +fine-grained reactivity instead of React's reconciliation: + +- Mounting and destroying a large keyed timeline (`{#key}` on the room id) +- Keyed `{#each}` updates as the timeline window moves +- An `$effect` that measures the mounted rows after each update and corrects the + scroll position, rerunning until the measurements settle, in place of + React's `useLayoutEffect` loop + +## How are we testing + +The suite shares its steps (`ScrollTimeline`, `SwitchRooms`, +`LoadOlderMessages`) with ChatRoom-React, see `suites-experimental/suites.mjs`. + +## Developer Documentation + +The app was created with Vite + Svelte. It can be previewed during development +with `npm run dev`. To update the files run in the harness you have to run +`npm run build`, which regenerates the committed `dist/` directory. + +The built workload can be loaded within the harness at e.g. +`http://localhost:8080/?developerMode&suites=ChatRoom-Svelte`, or directly at +`http://localhost:8080/suites-experimental/chat-room-svelte/dist/index.html`. diff --git a/suites-experimental/chat-room-svelte/dist/assets/index.css b/suites-experimental/chat-room-svelte/dist/assets/index.css new file mode 100644 index 000000000..b4994384c --- /dev/null +++ b/suites-experimental/chat-room-svelte/dist/assets/index.css @@ -0,0 +1 @@ +*{box-sizing:border-box}html,body{height:100%;margin:0}body{color:#17191c;background-color:#f4f6fa;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif}#root{height:100vh}.app{grid-template-columns:300px 1fr;height:100vh;display:grid;overflow:hidden}.avatar{color:#fff;text-transform:uppercase;border-radius:50%;flex:none;justify-content:center;align-items:center;width:36px;height:36px;font-size:13px;font-weight:600;display:inline-flex}.room-list{background-color:#fff;border-right:1px solid #e3e8ef;flex-direction:column;display:flex;overflow-y:auto}.room-list-item{text-align:left;cursor:pointer;font:inherit;color:inherit;background:0 0;border:0;border-bottom:1px solid #f0f2f5;align-items:center;gap:12px;padding:10px 14px;display:flex}.room-list-item:hover{background-color:#f4f6fa}.room-list-item-selected{background-color:#e8f0fe}.room-list-item-text{flex-direction:column;min-width:0;display:flex}.room-list-item-name{font-size:15px;font-weight:600}.room-list-item-preview{color:#737d8c;white-space:nowrap;text-overflow:ellipsis;font-size:13px;overflow:hidden}.room{flex-direction:column;min-width:0;height:100vh;display:flex}.room-header{background-color:#fff;border-bottom:1px solid #e3e8ef;padding:14px 20px}.room-header-name{margin:0;font-size:18px}.room-header-topic{color:#737d8c;margin:4px 0 0;font-size:13px}.composer{background-color:#fff;border-top:1px solid #e3e8ef;flex:none;gap:8px;padding:12px 20px;display:flex}.composer-input{min-width:0;font:inherit;color:inherit;border:1px solid #d5dbe5;border-radius:8px;flex:auto;padding:8px 12px;font-size:14px}.composer-input:focus{outline-offset:-1px;border-color:#9dc0f5;outline:2px solid #dce8fb}.composer-send{font:inherit;color:#fff;cursor:pointer;background-color:#2a6fd6;border:0;border-radius:8px;flex:none;padding:8px 16px;font-size:14px;font-weight:600}.composer-send:hover:enabled{background-color:#245fb8}.composer-send:disabled{cursor:default;background-color:#c8d1de}.timeline{overflow-anchor:none;flex:auto;margin:0;padding:0 20px;list-style:none;overflow-y:auto}.timeline-message{padding:6px 0}.timeline-message-row{gap:12px;display:flex}.timeline-message-grouped{padding:1px 0}.timeline-message-gutter{color:#939aa5;text-align:right;opacity:0;flex:none;width:36px;font-size:11px}.timeline-message-grouped:hover .timeline-message-gutter{opacity:1}.timeline-date-separator{align-items:center;gap:8px;margin:10px 0 6px;display:flex}.timeline-date-separator:before,.timeline-date-separator:after{content:"";border-top:1px solid #e3e6ea;flex:auto}.timeline-date-separator-label{color:#6b7280;background-color:#fff;border:1px solid #e3e6ea;border-radius:10px;flex:none;padding:2px 10px;font-size:11px;font-weight:600}.timeline-unread-divider{border-top:1px solid #e2564a;align-items:center;gap:8px;margin:8px 0 4px;display:flex}.timeline-unread-divider-label{color:#fff;text-transform:uppercase;background-color:#e2564a;border-radius:0 0 8px 8px;margin-left:auto;padding:1px 8px;font-size:10px;font-weight:700}.timeline-message-body{flex:auto;min-width:0}.timeline-message-highlighted{background-color:#fff6d8}.timeline-message-reply{width:100%;font:inherit;color:#737d8c;text-align:left;cursor:pointer;background:0 0;border:0;border-left:2px solid #d5dbe5;align-items:baseline;gap:6px;margin-bottom:2px;padding:0 0 0 8px;font-size:12px;display:flex}.timeline-message-reply:hover{color:#5a6472;border-left-color:#9dc0f5}.timeline-message-reply-sender{color:#5a6472;flex:none;font-weight:600}.timeline-message-reply-excerpt{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.timeline-message-meta{align-items:baseline;gap:8px;display:flex}.timeline-message-sender{font-size:14px;font-weight:600}.timeline-message-time{color:#939aa5;font-size:12px}.timeline-message-text{color:#2c3038;margin-top:2px;font-size:14px;line-height:1.4}.rich-paragraph{margin:0 0 4px}.rich-paragraph:last-child{margin-bottom:0}.rich-code{color:#b4295c;background-color:#f4f6fa;border:1px solid #e3e8ef;border-radius:4px;padding:1px 4px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.9em}.rich-code-block{white-space:pre;background-color:#f8fafc;border:1px solid #e3e8ef;border-radius:6px;margin:4px 0;padding:8px 10px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;line-height:1.45;overflow-x:auto}.rich-image{border:1px solid #e3e8ef;border-radius:8px;max-width:100%;height:auto;margin:6px 0;display:block}.rich-unfurl{max-width:460px;color:inherit;background-color:#fbfcfe;border:1px solid #e3e8ef;border-left:3px solid #9dc0f5;border-radius:8px;gap:10px;margin:6px 0;padding:10px;text-decoration:none;display:flex}.rich-unfurl:hover{background-color:#f4f8ff}.rich-unfurl-thumb{border-radius:6px;flex:none}.rich-unfurl-body{flex-direction:column;gap:2px;min-width:0;display:flex}.rich-unfurl-site{color:#737d8c;text-transform:uppercase;letter-spacing:.02em;font-size:11px;font-weight:600}.rich-unfurl-title{color:#24509b;font-weight:600}.rich-unfurl-description{color:#5a6472;font-size:13px}.rich-quote{color:#5a6472;border-left:3px solid #c8d1de;margin:4px 0;padding:2px 0 2px 10px}.rich-list{margin:4px 0;padding-left:20px}.rich-link{color:#2a6fd6;text-decoration:underline}.rich-pill{font:inherit;white-space:nowrap;border:0;border-radius:10px;padding:0 5px;font-weight:500}.rich-pill-mention{color:#24509b;background-color:#e2ecfd}.rich-pill-room{color:#1c6e4c;cursor:pointer;background-color:#e6f6ee}.rich-pill-room:hover{background-color:#d3efe1}.timeline-message-reactions{flex-wrap:wrap;gap:6px;margin-top:4px;display:flex}.reaction{font:inherit;color:inherit;cursor:pointer;background-color:#f4f6fa;border:1px solid #e3e8ef;border-radius:12px;align-items:center;gap:4px;padding:1px 8px;font-size:12px;display:inline-flex}.reaction:hover{background-color:#eaeef5;border-color:#c8d1de}.reaction-mine{background-color:#e2ecfd;border-color:#9dc0f5}.reaction-mine .reaction-count{color:#24509b;font-weight:600}.reaction-count{color:#737d8c} diff --git a/suites-experimental/chat-room-svelte/dist/assets/index.js b/suites-experimental/chat-room-svelte/dist/assets/index.js new file mode 100644 index 000000000..b2f008b1b --- /dev/null +++ b/suites-experimental/chat-room-svelte/dist/assets/index.js @@ -0,0 +1,4 @@ +var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible,d=()=>{};function f(e){for(var t=0;t{e=n,t=r}),resolve:e,reject:t}}var m=1024,h=2048,g=4096,_=8192,v=16384,y=32768,b=1<<25,x=65536,S=1<<19,ee=1<<20,te=1<<25,ne=1<<21,re=1<<22,ie=1<<23,ae=Symbol(`$state`),oe=Symbol(`component`),se=Symbol(``),ce=Symbol(`attributes`),le=Symbol(`class`),ue=Symbol(`style`),de=Symbol(`text`),fe=Symbol(`form reset`),pe=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},me=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),he={},C=Symbol(`uninitialized`),ge=`http://www.w3.org/1999/xhtml`;function _e(){console.warn(`https://svelte.dev/e/derived_inert`)}function ve(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function ye(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var w=!1;function be(e){w=e}var T;function E(e){if(e===null)throw ve(),he;return T=e}function xe(){return E(on(T))}function D(e){if(w){if(on(T)!==null)throw ve(),he;T=e}}function Se(e=1){if(w){for(var t=e,n=T;t--;)n=on(n);T=n}}function Ce(e=!0){for(var t=0,n=T;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=on(n);e&&n.remove(),n=i}}function we(e){if(!e||e.nodeType!==8)throw ve(),he;return e.data}function Te(e){return e===this.v}function Ee(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function De(e){return!Ee(e,this.v)}function Oe(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function ke(){throw Error(`https://svelte.dev/e/missing_context`)}function Ae(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function je(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Me(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Ne(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Pe(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Fe(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ie(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Le(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Re(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function ze(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}function Be(e,t,n){let r={};return[()=>(n(r)||ke(),e(r)),e=>t(r,e),()=>n(r)]}function Ve(e){let t=e.p;for(;t!==null&&t.c===null;)t=t.p;return t?.c??null}function He(e,t){return e===null&&Oe(t),e.c??=new Map(Ve(e)||void 0)}var O=null;function Ue(e){O=e}function We(){return Be(Ge,Ke,qe)}function Ge(e){return He(O,`getContext`).get(e)}function Ke(e,t){return He(O,`setContext`).set(e,t),t}function qe(e){return He(O,`hasContext`).has(e)}function Je(e,t=!1,n){O={p:O,i:!1,c:null,e:null,s:e,x:null,r:W,l:null}}function Ye(e){var t=O,n=t.e;if(n!==null){t.e=null;for(var r of n)bn(r)}return e!==void 0&&(t.x=e),t.i=!0,O=t.p,Xe(e)}function Xe(e={}){return i(e,oe,{value:!0}),e}function Ze(){return!0}var Qe=[];function $e(){var e=Qe;Qe=[],f(e)}function et(e){if(Qe.length===0&&!Et){var t=Qe;queueMicrotask(()=>{t===Qe&&$e()})}Qe.push(e)}function tt(){for(;Qe.length>0;)$e()}var nt=~(h|g|m);function k(e,t){e.f=e.f&nt|t}function rt(e){e.f&512||e.deps===null?k(e,m):k(e,g)}function it(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),k(e,m)}var at=!1;function ot(){at||(at=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[fe]?.()})},{capture:!0}))}function st(e){var t=V,n=W;U(null),zn(null);try{return e()}finally{U(t),zn(n)}}function ct(e,t,n,r=n){e.addEventListener(t,()=>st(n));let i=e[fe];e[fe]=i?()=>{i(),r(!0)}:()=>r(!0),ot()}function lt(e,t,n,r){let i=Ze()?pt:_t;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=W,c=ut(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){pn(e,s)}dt()}}var d=ft();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>ht(e))).then(u).catch(e=>pn(e,s)).finally(d)}l?l.then(()=>{s.f&16384?d():(c(),f(),dt())}):f()}function ut(){var e=W,t=V,n=O,r=A;return function(i=!0){zn(e),U(t),Ue(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function dt(e=!0){zn(null),U(null),Ue(null),e&&A?.deactivate()}function ft(){var e=W,t=e.b,n=A,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function pt(e){var t=2|h;return W!==null&&(W.f|=S),{ctx:O,deps:null,effects:null,equals:Te,f:t,fn:e,reactions:null,rv:0,v:C,wv:0,parent:W,ac:null}}var mt=Symbol(`obsolete`);function ht(e,t,n){let r=W;r===null&&Ae();var i=void 0,a=Ut(C),o=!V,s=new Set;return Cn(()=>{var t=W,n=p();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==pe&&n.reject(e)}).finally(dt)}catch(e){n.reject(e),dt()}var c=A;if(o){if(t.f&32768)var l=ft();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(mt);else for(let e of s.values())e.reject(mt);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==mt&&(c.activate(),t?(a.f|=ie,qt(a,t)):(a.f&8388608&&(a.f^=ie),qt(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),vn(()=>{for(let e of s)e.reject(mt)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function gt(e){let t=pt(e);return Vn(t),t}function _t(e){let t=pt(e);return t.equals=De,t}function vt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n{t.ac.abort(pe),t.ac=null}),t.fn!==null&&(t.teardown=d),$n(t,0),Dn(t))}function St(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&er(t)}var Ct=null,A=null,wt=null,j=null,Tt=null,Et=!1,Dt=!1,Ot=null,kt=null,At=0,jt=1,Mt=class e{id=jt++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){Ct===null?Ct=this:(Ct.#n=this,this.#t=Ct),Ct=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)k(r,h),t(r);for(r of n.m)k(r,g),t(r)}this.#p.add(e)}#g(){var e=[];for(let i of this.#c)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=m}}n||e.push(t)}return this.#c=[],e}#_(){this.#e=!0;for(let e of this.#u)this.#d.delete(e),k(e,h),this.schedule(e);for(let e of this.#d)k(e,g),this.schedule(e);this.apply();for(var t=Ot=[],n=[],r=kt=[];this.#c.length>0;){At++>1e3&&(this.#S(),Pt());for(let e of this.#g())try{this.#v(e,t,n)}catch(t){throw zt(e),this.#h()||this.discard(),t}}if(A=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Ot=null,kt=null,this.#h()){this.#x(n),this.#x(t);for(let[e,t]of this.#f)Rt(e,t);r.length>0&&A.#_();return}let a=this.#y();if(a)this.#x(n),this.#x(t),a.#b(this);else{this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),wt=this,It(n),It(t),wt=null,this.#s?.resolve();var o=A;if(this.#a===0&&(this.#c.length===0||o!==null)&&this.#S(),this.#c.length>0){if(o!==null){for(let e of this.#c)o.#c.push(e);this.#c=[]}else o=this}o!==null&&(Vt.clear(),o.#_())}}#v(e,t,n){e.f^=m;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=m:i&4?t.push(r):Jn(r)&&(i&16&&this.#d.add(r),er(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#y(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#b(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),k(i,h),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),A=this,this.#_()}#x(e){for(var t=0;t{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=p()).promise}static ensure(){if(A===null){let t=A=new e;!Dt&&!Et&&et(()=>{t.#e||t.flush()})}return A}apply(){j=null}schedule(e){Tt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)?e.b.defer_effect(e):this.#c.push(e)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?Ct=e:t.#t=e,this.linked=!1}}};function Nt(e){var t=Et,n=wt;wt=null,Et=!0;try{var r;for(e&&(Nt(),r=e());;){if(tt(),A===null)return r;A.flush()}}finally{Et=t,wt=n}}function Pt(){try{Fe()}catch(e){pn(e,Tt)}}var Ft=null;function It(e){var t=e.length;if(t!==0){for(var n=0;n0)){Vt.clear();for(let e of Ft){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Ft.has(n)&&(Ft.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||er(n)}}Ft.clear()}}Ft=null}}function Lt(e){A.schedule(e)}function Rt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),k(e,m);for(var n=e.first;n!==null;)Rt(n,t),n=n.next}}function zt(e){k(e,m);for(var t=e.first;t!==null;)zt(t),t=t.next}var Bt=new Set,Vt=new Map,Ht=!1;function Ut(e,t){return{f:0,v:e,reactions:null,equals:Te,rv:0,wv:0}}function M(e,t){let n=Ut(e,t);return Vn(n),n}function Wt(e,t=!1,n=!0){let r=Ut(e);return t||(r.equals=De),r}function N(e,t,n=!1){return V!==null&&(!H||V.f&131072)&&Ze()&&V.f&4325394&&(Bn===null||!Bn.has(e))&&Re(),qt(e,n?Qt(t):t,kt)}var Gt=null,Kt=0;function qt(e,t,n=null){if(!e.equals(t)){Ln?Vt.set(e,t):Vt.has(e)||Vt.set(e,e.v);var r=Mt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&yt(t),j===null&&rt(t)}e.wv=qn(),Gt=null,Kt=0,Zt(e,h,n),Gt=null,Ze()&&W!==null&&W.f&1024&&!(W.f&96)&&(q===null?Hn([e]):q.push(e)),!r.is_fork&&Bt.size>0&&!Ht&&Jt()}return t}function Jt(){Ht=!1;for(let e of Bt){e.f&1024&&k(e,g);let t;try{t=Jn(e)}catch{t=!0}t&&er(e)}Bt.clear()}function Yt(e,t=1){var n=J(e),r=t===1?n++:n--;return N(e,n),r}function Xt(e){N(e,e.v+1)}function Zt(e,t,n){var r=e.reactions;if(r!==null){var i=Ze(),a=r.length;if(Kt+=a,Kt>1e5&&Gt===null&&(Gt=new Set),Gt!==null){if(Gt.has(e))return;Gt.add(e)}for(var o=0;o{if(Gn===d)return e();var t=V,n=Gn;U(null),Kn(d);var r=e();return U(t),Kn(n),r};return i&&r.set(`length`,M(t.length,u)),new Proxy(t,{defineProperty(e,t,n){`value`in n&&n.configurable!==!1&&n.enumerable!==!1&&n.writable!==!1||Ie();var i=r.get(t);return i===void 0?f(()=>{var e=M(n.value,u);return r.set(t,e),e}):N(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>M(C,u));r.set(t,e),Xt(o)}}else N(n,C),Xt(o);return!0},get(e,n,i){if(n===ae)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>M(Qt(s?e[n]:C),u)),r.set(n,o)),o!==void 0){var c=J(o);return c===C?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var n=Reflect.getOwnPropertyDescriptor(e,t),i=r.get(t);if(i!==void 0){var a=J(i);if(a===C)return;if(n&&`value`in n)n.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return n},has(e,t){if(t===ae)return!0;var n=r.get(t),i=n!==void 0&&n.v!==C||Reflect.has(e,t);return(n!==void 0||W!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>M(i?Qt(e[t]):C,u)),r.set(t,n)),J(n)===C)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;dM(C,u)),r.set(d+``,p)):N(p,C)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>M(void 0,u)),N(c,Qt(n)),r.set(t,c));else{l=c.v!==C;var m=f(()=>Qt(n));N(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&N(g,_+1)}Xt(o)}return!0},ownKeys(e){J(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==C});for(var[n,i]of r)i.v!==C&&!(n in e)&&t.push(n);return t},setPrototypeOf(){Le()}})}var $t,en,tn,nn;function rn(){if($t===void 0){$t=window,en=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;tn=a(t,`firstChild`).get,nn=a(t,`nextSibling`).get,u(e)&&(e[le]=void 0,e[ce]=null,e[ue]=void 0,e.__e=void 0),u(n)&&(n[de]=void 0)}}function P(e=``){return document.createTextNode(e)}function an(e){return tn.call(e)}function on(e){return nn.call(e)}function F(e,t){if(!w)return an(e);var n=an(T);if(n===null)n=T.appendChild(P());else if(t&&n.nodeType!==3){var r=P();return n?.before(r),E(r),r}return t&&dn(n),E(n),n}function sn(e,t=!1){if(!w){var n=an(e);return n instanceof Comment&&n.data===``?on(n):n}if(t){if(T?.nodeType!==3){var r=P();return T?.before(r),E(r),r}dn(T)}return T}function I(e,t=!1){if(!w)return an(e);var n=F(e,t);return D(e),n}function L(e,t=1,n=!1){let r=w?T:e;for(var i;t--;)i=r,r=on(r);if(!w)return r;if(n){if(r?.nodeType!==3){var a=P();return r===null?i?.after(a):r.before(a),E(a),a}dn(r)}return E(r),r}function cn(e){e.textContent=``}function ln(){return!1}function un(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function dn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function fn(e){var t=W;if(t===null)return V.f|=ie,e;if(!(t.f&32768)&&!(t.f&4))throw e;pn(e,t)}function pn(e,t){if(e===he)throw e;if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function mn(e){W===null&&(V===null&&Pe(e),Ne()),Ln&&Me(e)}function hn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function gn(e,t){var n=W;n!==null&&n.f&8192&&(e|=_);var r={ctx:O,deps:null,nodes:null,f:e|h|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};A?.register_created_effect(r);var i=r;if(e&4)Ot===null?Mt.ensure().schedule(r):Ot.push(r);else if(t!==null){try{er(r)}catch(e){throw B(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=x))}if(i!==null&&(i.parent=n,n!==null&&hn(i,n),V!==null&&V.f&2&&!(e&64))){var a=V;(a.effects??=[]).push(i)}return r}function _n(){return V!==null&&!H}function vn(e){let t=gn(8,null);return k(t,m),t.teardown=e,t}function yn(e){mn(`$effect`);var t=W.f;if(!V&&t&32&&O!==null&&!O.i){var n=O;(n.e??=[]).push(e)}else return bn(e)}function bn(e){return gn(4|ee,e)}function xn(e){Mt.ensure();let t=gn(64|S,e);return(e={})=>new Promise(n=>{e.outro?jn(t,()=>{B(t),n(void 0)}):(B(t),n(void 0))})}function Sn(e){return gn(4,e)}function Cn(e){return gn(re|S,e)}function wn(e,t=0){return gn(8|t,e)}function R(e,t=[],n=[],r=[]){lt(r,t,n,t=>{gn(8,()=>{e(...t.map(J))})})}function Tn(e,t=0){return gn(16|t,e)}function z(e){return gn(32|S,e)}function En(e){var t=e.teardown;if(t!==null){let n=Ln,r=V;Rn(!0),U(null);try{t.call(null)}catch(t){pn(t,e.parent)}finally{Rn(n),U(r)}}}function Dn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&st(()=>{e.abort(pe)});var r=n.next;n.f&64?n.parent=null:B(n,t),n=r}}function On(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||B(t),t=n}}function B(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(kn(e.nodes.start,e.nodes.end),n=!0),e.f|=b,Dn(e,t&&!n),$n(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();En(e),e.f^=b,e.f|=v;var i=e.parent;i!==null&&i.first!==null&&An(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function kn(e,t){for(;e!==null;){var n=e===t?null:on(e);e.remove(),e=n}}function An(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function jn(e,t,n=!0){var r=[];e.f|=256,Mn(e,r,!0);var i=()=>{n&&B(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Mn(e,t,n){if(!(e.f&8192)){e.f^=_;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);Mn(i,t,o?n:!1)}i=a}}}function Nn(e){e.f&=-257,Pn(e,!0)}function Pn(e,t){if(!(e.f&256)&&e.f&8192){e.f^=_,e.f&1024||(k(e,h),Mt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);Pn(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Fn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:on(n);t.append(n),n=i}}var In=null,Ln=!1;function Rn(e){Ln=e}var V=null,H=!1;function U(e){V=e}var W=null;function zn(e){W=e}var Bn=null;function Vn(e){V!==null&&(V.f&2097152||V.f&2)&&(Bn??=new Set).add(e)}var G=null,K=0,q=null;function Hn(e){q=e}var Un=1,Wn=0,Gn=Wn;function Kn(e){Gn=e}function qn(){return++Un}function Jn(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}t&512&&j===null&&k(e,m)}return!1}function Yn(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Bn!==null&&Bn.has(e)))for(var i=0;i{e.ac.abort(pe)}),e.ac=null);try{e.f|=ne;var u=e.fn,d=u();e.f|=y;var f=Zn(e);if(Ze()&&q!==null&&!H&&f!==null&&!(e.f&6146))for(var p=0;p0)for(t.length=K+G.length,r=0;r{s.ac.abort(pe),s.ac=null,k(s,h)}),xt(s),$n(s,0)}}function $n(e,t){var n=e.deps;if(n!==null)for(var r=t;rn?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,et(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function dr(e,t,n,r,i){var a={capture:r,passive:i},o=ur(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&vn(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function fr(e,t,n){(t[sr]??={})[e]=n}function pr(e){for(var t=0;t{hr=!1,mr=null}));var s=0,c=mr===e&&e[sr];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[sr]=t;return}var u=a.indexOf(t);if(u===-1)return;l<=u&&(s=l)}if(o=a[s]||e.target,o!==t){i(e,`currentTarget`,{configurable:!0,get(){return o||n}});var d=V,f=W;U(null),zn(null);try{for(var p,m=[];o!==null&&o!==t;){try{var h=o[sr]?.[r];h==null||o.disabled&&e.target!==o||h.call(o,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble)break;s++,o=s{throw e});throw p}}finally{e[sr]=t,delete e.currentTarget,U(d),zn(f)}}}var _r=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function vr(e){return _r?.createHTML(e)??e}function yr(e){var t=un(`template`);return t.innerHTML=vr(e.replaceAll(``,``)),t.content}function br(e,t){var n=W;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function Y(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(``);return()=>{if(w)return br(T,null),T;i===void 0&&(i=yr(a?e:``+e),n||(i=an(i)));var t=r||en?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=an(t),s=t.lastChild;br(o,s)}else br(t,t);return t}}function xr(e=``){if(!w){var t=P(e+``);return br(t,t),t}var n=T;return n.nodeType===3?dn(n):(n.before(n=P()),E(n)),br(n,n),n}function Sr(){if(w)return br(T,null),T;var e=document.createDocumentFragment(),t=document.createComment(``),n=P();return e.append(t,n),br(t,n),e}function X(e,t){if(w){var n=W;n.f&32768&&n.nodes.end!==null||(n.nodes.end=T),xe()}else e!==null&&e.before(t)}function Cr(e){let t=0,n=Ut(0),r;return()=>{_n()&&(J(n),wn(()=>(t===0&&(r=ir(()=>e(()=>Xt(n)))),t+=1,()=>{et(()=>{--t,t===0&&(r?.(),r=void 0,Xt(n))})})))}}var wr=x|S;function Tr(e,t,n,r){new Er(e,t,n,r)}var Er=class{parent;is_pending=!1;transform_error;#e;#t=w?T:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Cr(()=>(this.#m=Ut(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=W;t.b=this,t.f|=128,n(e)},this.parent=W.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=Tn(()=>{if(w){let e=we(this.#t);xe();let t=e===`[!`;if(e.startsWith(`[?`)){let t=JSON.parse(e.slice(2));this.#_(t)}else t?this.#b():this.#g()}else this.#x()},wr),w&&(this.#e=T)}#g(){try{this.#a=z(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);et(r),t&&(this.#s=z(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{this.#y()||(t?ye():(t=!0,n&&ze(),this.#s!==null&&jn(this.#s,()=>{this.#s=null}),this.#C(()=>{this.#x()})))};return{reset:r,invoke_onerror:()=>{if(!this.#y())try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){pn(e,this.#i&&this.#i.parent)}}}}#y(){return(this.#i.f&(v|b))!==0}#b(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=z(()=>e(this.#e)),et(()=>{if(!this.#y()){var e=this.#c=document.createDocumentFragment(),t=P(),n=!1;e.append(t),this.#a=this.#C(()=>{try{return z(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){pn(e,this.#i.parent)}return null}}),this.#a===null?(this.#c=null,n&&this.#S(A)):this.#u===0&&(this.#e.before(e),this.#c=null,jn(this.#o,()=>{this.#o=null}),this.#S(A))}}))}#x(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=z(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Fn(this.#a,e);let t=this.#n.pending;this.#o=z(()=>t(this.#e))}else this.#S(A)}catch(e){this.error(e)}}#S(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){it(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#C(e){var t=W,n=V,r=O;zn(this.#i),U(this.#i),Ue(this.#i.ctx);try{return Mt.ensure(),e()}finally{zn(t),U(n),Ue(r)}}#w(e,t){this.has_pending_snippet()?(this.#u+=e,this.#u===0&&(this.#S(t),this.#o&&jn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))):this.parent&&this.parent.#w(e,t)}update_pending_count(e,t){this.#w(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,et(()=>{this.#d=!1,this.#m&&qt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),J(this.#m)}error(e){if(e===he||!this.#n.onerror&&!this.#n.failed)throw e;A?.is_fork?(this.#a&&A.skip_effect(this.#a),this.#o&&A.skip_effect(this.#o),this.#s&&A.skip_effect(this.#s),A.oncommit(()=>{this.#y()||this.#T(e)})):this.#T(e)}#T(e){this.#a&&=(B(this.#a),null),this.#o&&=(B(this.#o),null),this.#s&&=(B(this.#s),null),w&&(E(this.#t),Se(),E(Ce()));let t=this.#n.failed,n=e=>{if(this.#y())return;let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&!this.#y()&&(this.#s=this.#C(()=>{try{return z(()=>{var r=W;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return pn(e,this.#i.parent),null}}))};et(()=>{if(!this.#y()){var t;try{t=this.transform_error(e)}catch(e){pn(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>pn(e,this.#i&&this.#i.parent)):n(t)}})}};function Z(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[de]??=e.nodeValue)&&(e[de]=n,e.nodeValue=`${n}`)}function Dr(e,t){return kr(e,t)}var Or=new Map;function kr(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){rn();var l=void 0,u=xn(()=>{var s=n??t.appendChild(P());Tr(s,{pending:()=>{}},t=>{Je({});var n=O;if(o&&(n.c=o),a&&(i.$$events=a),w&&br(t,null),l=e(t,i)||Xe(),w&&(W.nodes.end=T,T===null||T.nodeType!==8||T.data!==`]`))throw ve(),he;Ye()},c);var u=new Set,d=e=>{for(var n=0;n{for(var e of u)for(let n of[t,document]){var r=Or.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,gr),r.delete(e),r.size===0&&Or.delete(n)):r.set(e,i)}lr.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return Ar.set(l,u),l}var Ar=new WeakMap,jr=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Nn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Nn(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(B(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Fn(r,t),t.append(P()),this.#n.set(e,{effect:r,fragment:t})}else B(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),jn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(B(n.effect),this.#n.delete(e))};ensure(e,t){var n=A,r=ln();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=P();i.append(a),this.#n.set(e,{effect:z(()=>t(a)),fragment:i})}else this.#t.set(e,z(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else w&&(this.anchor=T),this.#a(n)}};function Mr(e,t,n=!1){var r;w&&(r=T,xe());var i=new jr(e),a=n?x:0;function o(e,t){if(w){var n=we(r);if(e!==parseInt(n.substring(1))){var a=Ce();E(a),i.anchor=a,be(!1),i.ensure(e,t),be(!0);return}}i.ensure(e,t)}Tn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var Nr=Symbol(`NaN`);function Pr(e,t,n){w&&xe();var r=new jr(e),i=!Ze();Tn(()=>{var e=t();e!==e&&(e=Nr),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function Fr(e,t){return t}function Ir(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;Lr(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else--s},!1)}if(s===0){var l=i.length===0&&n!==null&&e.pending.size===0;if(l){var u=n,d=u.parentNode;cn(d),d.append(u),e.items.clear()}Lr(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function Lr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i{var t=i();return e(t)?t:t==null?[]:r(t)}),p=new Map,m=!0;function h(e){if(!(_.effect.f&16384)){_.pending.delete(e);var t=J(f);_.fallback=d,Vr(_,t,c,n,a),d!==null&&(t.length===0?d.f&33554432?(d.f^=te,Ur(d,null,c)):Nn(d):jn(d,()=>{d=null}))}}function g(e){_.pending.delete(e)}var _={effect:Tn(()=>{var e=J(f),t=e.length;let r=!1;w&&we(c)===`[!`!=(t===0)&&(c=Ce(),E(c),be(!1),r=!0);for(var u=new Set,_=A,v=ln(),y=0;ys(c)):(d=z(()=>s(Rr??=P())),d.f|=te)),t>u.size&&je(``,``,``),w&&t>0&&E(Ce()),!m){if(p.set(_,u),v){for(let[e,t]of l)u.has(e)||_.skip_effect(t.e);_.oncommit(h),_.ondiscard(g)}else h(_)}r&&be(!0),J(f)}),flags:n,items:l,pending:p,outrogroups:null,fallback:d};m=!1,w&&(c=T)}function Br(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Vr(e,t,n,i,a){var o=!!(i&8),s=t.length,c=e.items,l=Br(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v0){var ie=i&4&&s===0?n:null;if(o){for(v=0;v{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function Hr(e,t,n,r,i,a,o,s){var c=o&1?o&16?Ut(n):Wt(n,!1,!1):null,l=o&2?Ut(i):null;return{v:c,i:l,e:z(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Ur(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=on(r);if(a.before(r),r===i)return;r=o}}function Wr(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Gr(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t=0;){var s=o+a;(o===0||Jr.includes(r[o-1]))&&(s===r.length||Jr.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Xr(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Zr(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Qr(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Zr)),i&&c.push(...Object.keys(i).map(Zr));var l=0,u=-1;let t=e.length;for(var d=0;d{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Q(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Q(e,`checked`,null),e.checked=r}}};e[fe]=n,et(n),ot()}}function Q(e,t,n,r){var i=oi(e);w&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===ii)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[se]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ci(e).has(t)?e[t]=n:e.setAttribute(t,n))}function oi(e){return e[ce]??={[ni]:e.nodeName.includes(`-`),[ri]:e.namespaceURI===ge}}var si=new Map;function ci(e){var t=e.getAttribute(`is`)||e.nodeName,n=si.get(t);if(n)return n;si.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&s!==`innerHTML`&&s!==`textContent`&&s!==`innerText`&&n.add(s);i=l(i)}return n}function li(e,t,n=t){var r=new WeakSet;ct(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=ui(e)?di(a):a,n(a),A!==null&&r.add(A),await tr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(w&&e.defaultValue!==e.value||ir(t)==null&&e.value)&&(n(ui(e)?di(e.value):e.value),A!==null&&r.add(A)),wn(()=>{var n=t();if(e===document.activeElement){var i=A;if(r.has(i))return}ui(e)&&n===di(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}function ui(e){var t=e.type;return t===`number`||t===`range`}function di(e){return e===``?null:+e}function fi(e,t){return e===t||e?.[ae]===t}function pi(e=Xe(),t,n,r){var i=O.r,a=W;return Sn(()=>{var o,s;return wn(()=>{o=s,s=r?.()||[],ir(()=>{fi(n(...s),e)||(t(e,...s),o&&fi(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&fi(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var mi=4,hi=[[`#3b82f6`,`#bfdbfe`],[`#a855f7`,`#f0d9ff`],[`#10b981`,`#b7f5da`],[`#ef4444`,`#ffd5d5`],[`#f59e0b`,`#ffeab0`],[`#06b6d4`,`#b8f2fb`],[`#6366f1`,`#d5daff`],[`#84cc16`,`#e3fab3`]];function gi(e,t,n){let r=t,i=n;switch(e){case 0:return``;case 1:return``;case 2:{let e=[.35,.62,.45,.8,.55];return e.map((t,n)=>{let a=r*.9/e.length-6;return``}).join(``)}default:return``}}var _i=new Map;function vi(e,t,n,r){let i=e%hi.length,a=t%mi,o=`${i}-${a}-${n}x${r}`,s=_i.get(o);if(s)return s;let[c,l]=hi[i],u=`g${i}${a}`,d=`${gi(a,n,r)}`,f=`data:image/svg+xml,${encodeURIComponent(d)}`;return _i.set(o,f),f}var yi=40,bi=1500,xi=8,Si=[`General`,`Random`,`Announcements`,`Engineering`,`Design`,`Product`,`Support`,`Off Topic`,`Releases`,`Incidents`,`Frontend`,`Backend`,`Infra`,`Mobile`,`Performance`,`Security`,`Docs`,`Hiring`,`Watercooler`,`Standup`],Ci=[`Ada Lovelace`,`Alan Turing`,`Grace Hopper`,`Linus Pauling`,`Marie Curie`,`Nikola Tesla`,`Rosalind Franklin`,`Carl Sagan`,`Katherine Johnson`,`Tim Berners-Lee`],wi=[`#368bd6`,`#ac3ba8`,`#03b381`,`#e64f7a`,`#ff812d`,`#2dc2c5`,`#5c56f5`,`#74d12c`],Ti=wi.length,Ei=`the.benchmark.switching.between.rooms.should.feel.instant.even.when.the.timeline.is.long.and.full.of.rich.messages.with.avatars.and.timestamps.rendering.performance.matters.a.lot.here.lets.measure.it.carefully.and.compare.across.browsers.over.time`.split(`.`),Di=`๐Ÿ˜€.๐Ÿ˜‚.๐ŸŽ‰.๐Ÿ”ฅ.โค๏ธ.๐Ÿ™.๐Ÿ‘€.๐Ÿš€.๐Ÿ˜….๐Ÿค”.๐Ÿ’ฏ.โœจ.๐Ÿ™Œ๐Ÿฝ.๐Ÿ‘๐Ÿป.๐Ÿ˜.๐Ÿฅณ.๐Ÿ˜ญ.๐Ÿคฏ.๐Ÿ‘.๐Ÿ’ช๐Ÿพ.๐Ÿง .โ˜•.๐Ÿ›.๐Ÿ“ˆ.๐Ÿ‘ฉโ€๐Ÿ’ป.๐Ÿง‘โ€๐Ÿš€.๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ.๐Ÿณ๏ธโ€๐ŸŒˆ.๐Ÿคทโ€โ™€๏ธ.๐Ÿ™‹โ€โ™‚๏ธ.๐Ÿซ .๐Ÿซถ`.split(`.`),Oi=[`๐Ÿ‘`,`โค๏ธ`,`๐Ÿ˜‚`,`๐ŸŽ‰`,`๐Ÿ”ฅ`,`โœ…`,`๐Ÿ‘€`,`๐Ÿ™`,`๐Ÿ’ฏ`,`๐Ÿš€`,`๐Ÿ˜…`,`๐Ÿคฏ`],ki=Ci.map(e=>e.split(` `)[0].toLowerCase()),Ai=[`scrollTop`,`scrollHeight`,`flushSync`,`requestAnimationFrame`,`IntersectionObserver`,`overflow-anchor`,`content-visibility`,`useLayoutEffect`,`getBoundingClientRect`,`will-change`,`ResizeObserver`,`queueMicrotask`,`clientHeight`,`offsetHeight`],ji=[`the trace`,`last night's run`,`this regression`,`the profile`,`the spec text`,`my notes`,`the dashboard`,`that comparison`],Mi=[`traces/2f9c`,`runs/nightly`,`profiles/hot-path`,`spec/scroll-anchoring`,`notes/timeline`,`dashboards/perf`,`reports/42`,`compare/main`],Ni=[{site:`example.com`,title:`Scroll anchoring, and why feeds jump`,description:`How browsers pin a scroll position while content is inserted above the viewport, and where it gives up.`},{site:`perf.example.com`,title:`Nightly run 482 vs 481`,description:`Geomean moved 1.8% on the chat suites. Row measurement dominates the profile.`},{site:`docs.example.com`,title:`Windowing a variable-height list`,description:`Estimate, measure, cache, correct. The four steps every hand-rolled virtualizer ends up with.`},{site:`bugs.example.com`,title:`Timeline jumps when the panel opens`,description:`Narrowing the scroller re-wraps every row, so the cached heights are all stale at once.`}],Pi=[`can we get a number on how bad the jank is before we start moving code around`,`the window only recycles about twenty rows, so the mount cost should be flat`,`every row height changes when the panel opens, which invalidates the cache`,`please do not use smooth scrolling anywhere inside a timed step`,`prepending history without pinning the anchor makes the viewport jump`],Fi=[`estimate the row height first, then correct after measuring`,`cache measured heights per message id`,`keep the mounted window small and bounded`,`assign scroll offsets explicitly instead of animating`,`recycle rows rather than remounting them`,`break the group when a reply quote is present`,`re-measure only the rows the resize actually touched`],Ii=[{lang:`js`,lines:[`const scroller = scrollerRef.current;`,`scroller.scrollTop = scroller.scrollHeight;`]},{lang:`js`,lines:[`requestAnimationFrame(() => {`,` for (const row of mounted)`,` heights.set(row.id, row.offsetHeight);`,`});`]},{lang:`css`,lines:[`.timeline {`,` overflow-anchor: none;`,` content-visibility: auto;`,`}`]},{lang:`sh`,lines:[`npm run build`,`node debugging/e2e-chatroom.mjs --browser chrome`]},{lang:`json`,lines:[`{`,` "iterationCount": 10,`,` "suites": ["ChatRoom-React"]`,`}`]},{lang:`js`,lines:[`for (const row of rows) {`,` if (!heights.has(row.id))`,` heights.set(row.id, estimate);`,`}`]},{lang:`diff`,lines:[`- scroller.scrollTo({ top, behavior: "smooth" });`,`+ scroller.scrollTop = top;`]},{lang:`js`,lines:[`export function anchorToBottom(node) {`,` node.scrollTop = node.scrollHeight;`,`}`]}];function $(e,t){let n=Math.imul(e+1,2654435761)^Math.imul(t+1,40503);return n^=n>>>15,n=Math.imul(n,2246822519),n^=n>>>13,n=Math.imul(n,3266489917),n^=n>>>16,n>>>0}function Li(e,t,n){return e[$(t,n)%e.length]}function Ri(e){return e.split(` `).map(e=>e[0]).join(``).slice(0,2).toUpperCase()}function zi(e){let t=Si[e%Si.length];return e{if(!n.length)return;let i=r?` `:``,a=e?` `:``;t.push({type:`text`,text:`${i}${n.join(` `)}${a}`}),n=[],r=!1};for(let a of e)typeof a==`string`?n.push(a):(i(!0),t.push(a),r=!0);return i(!1),t}function Ui(e,t,n){if(n===0)return{type:`code`,text:Li(Ai,e,t+11)};if(n===1)return{type:`link`,text:Li(ji,e,t+12),href:`https://example.com/${Li(Mi,e,t+13)}`};if(n===2)return{type:`mention`,name:Li(ki,e,t+14)};let r=$(e,t+15)%yi;return{type:`room`,name:Bi(r),roomId:`room-${r}`}}function Wi(e,t){let n=6+$(e,t)%22,r=$(e,t+1)%Ei.length,i=[],a=!1;for(let o=0;o0&&oString(e).padStart(2,`0`);return`${r(t)}:${r(n)}`}var ia=1440,aa=[];for(let e=0;e[e,t%Ti])),va=new Map(Ci.map(e=>[e,Ri(e)]));function ya(e,t){let n=[],r=0;for(;n.length0&&$(a,201)%100<18){let e=$(a,203)%4==0?1+$(a,204)%Math.min(i,400):1+$(a,202)%6,t=r[Math.max(0,i-e)];c={id:t.id,sender:t.sender,excerpt:ha(t.blocks)}}r.push({id:`room-${e}-msg-${i}`,sender:o,senderInitials:va.get(o),colorIndex:_a.get(o),time:aa[a%ia],dayIndex:n[i],blocks:s,replyTo:c,grouped:i>0&&t[i-1]===o&&!c,reactions:na[a%ta]})}return r}function xa(){let e=[];for(let t=0;t0,reactions:[]}}var Ea=Y(``);function Da(e,t){Je(t,!0);var n=Ea(),r=F(n);let i;var a=I(r,!0),o=L(r,2),s=F(o),c=I(s,!0),l=I(L(s,2),!0);D(o),D(n),R(()=>{Q(n,`id`,`room-list-item-${t.index??``}`),$r(n,1,qr([`room-list-item`,t.selected&&`room-list-item-selected`])),i=ti(r,``,i,{"background-color":wi[t.room.colorIndex]}),Z(a,t.room.initials),Z(c,t.room.name),Z(l,t.room.lastMessage)}),fr(`click`,n,()=>t.onSelect(t.room.id)),X(e,n),Ye()}pr([`click`]);var Oa=Y(``);function ka(e,t){var n=Oa();zr(n,23,()=>t.rooms,e=>e.id,(e,n,r)=>{{let i=gt(()=>J(n).id===t.selectedRoomId);Da(e,{get index(){return J(r)},get room(){return J(n)},get selected(){return J(i)},get onSelect(){return t.onSelect}})}}),D(n),X(e,n)}var[Aa,ja]=We(),Ma=-1,Na=class{#e;#t;#n;#r;#i;#a;constructor(e,t,n){this.#e=n,this.#t=e,this.#i=t,this.#n=new Float64Array(e).fill(Ma),this.#r=new Float64Array(e+1),this.#a=t}get count(){return this.#t}get first(){return this.#i}extendTo(e){e>=this.#i||(this.#i=e,this.#a=e)}grow(e){if(e<=this.#t)return;let t=new Float64Array(e);t.set(this.#n),t.fill(Ma,this.#t);let n=new Float64Array(e+1);n.set(this.#r),this.#a=Math.min(this.#a,this.#t),this.#n=t,this.#r=n,this.#t=e}heightAt(e){let t=this.#n[e];return t===Ma?this.#e:t}measure(e,t){return this.#n[e]!==t&&(this.#n[e]=t,e>1;t[i]<=e?n=i:r=i-1}return Math.max(this.#i,n)}#o(){if(this.#a>this.#t)return;let e=this.#r;e[this.#i]=0;for(let t=this.#a;t `);function Fa(e,t){Je(t,!0);let n=M(``);function r(e){e.preventDefault();let r=J(n).trim();r&&(t.onSend(r),N(n,``))}function i(e){e.key===`Enter`&&!e.shiftKey&&r(e)}var a=Pa(),o=F(a);ai(o);var s=L(o,2);D(a),R((e,n)=>{Q(o,`aria-label`,`Message ${t.roomName??``}`),Q(o,`placeholder`,`Message #${e??``}`),s.disabled=n},[()=>t.roomName.toLowerCase().replace(/ /g,`-`),()=>J(n).trim().length===0]),dr(`submit`,a,r),fr(`keydown`,o,i),li(o,()=>J(n),e=>N(n,e)),X(e,a),Ye()}pr([`keydown`]);var Ia=Y(``);function La(e,t){Je(t,!0);let n=M(!1);var r=Ia(),i=F(r),a=I(i,!0),o=I(L(i,2),!0);D(r),R(()=>{$r(r,1,qr([`reaction`,J(n)&&`reaction-mine`])),Q(r,`aria-pressed`,J(n)),Z(a,t.reaction.emoji),Z(o,t.reaction.count+ +!!J(n))}),fr(`click`,r,()=>N(n,!J(n))),X(e,r),Ye()}pr([`click`]);var Ra=Y(` `),za=Y(` `),Ba=Y(` `),Va=Y(``),Ha=Y(`
 
`),Ua=Y(`
`),Wa=Y(``),Ga=Y(` `),Ka=Y(`
  • `),qa=Y(`
      `),Ja=Y(`

      `);function Ya(e,t){Je(t,!0);let n=(e,t=d)=>{var n=Sr();zr(sn(n),17,t,Fr,(e,t)=>{var n=Sr(),a=sn(n),o=e=>{var n=Ra(),r=I(n,!0);R(()=>Z(r,J(t).text)),X(e,n)},s=e=>{var n=za(),r=I(n,!0);R(()=>{Q(n,`href`,J(t).href),Z(r,J(t).text)}),fr(`click`,n,i),X(e,n)},c=e=>{var n=Ba(),r=I(n);R(()=>Z(r,`@${J(t).name??``}`)),X(e,n)},l=e=>{var n=Va(),i=I(n);R(()=>Z(i,`#${J(t).name??``}`)),fr(`click`,n,()=>r(J(t).roomId)),X(e,n)},u=e=>{var n=xr();R(()=>Z(n,J(t).text)),X(e,n)};Mr(a,e=>{J(t).type===`code`?e(o):J(t).type===`link`?e(s,1):J(t).type===`mention`?e(c,2):J(t).type===`room`?e(l,3):e(u,-1)}),X(e,n)}),X(e,n)},{selectRoom:r}=Aa(),i=e=>e.preventDefault();var a=Sr();zr(sn(a),17,()=>t.blocks,Fr,(e,t)=>{var r=Sr(),a=sn(r),o=e=>{var n=Ha(),r=I(F(n),!0);D(n),R(e=>{Q(n,`data-lang`,J(t).lang),Z(r,e)},[()=>J(t).lines.join(` +`)]),X(e,n)},s=e=>{var r=Ua(),i=F(r);n(i,()=>J(t).spans),D(r),X(e,r)},c=e=>{var n=Wa();R(()=>{Q(n,`src`,J(t).src),Q(n,`width`,J(t).width),Q(n,`height`,J(t).height),Q(n,`alt`,J(t).alt)}),X(e,n)},l=e=>{var n=Ga(),r=F(n),a=L(r,2),o=F(a),s=I(o,!0),c=L(o,2),l=I(c,!0),u=I(L(c,2),!0);D(a),D(n),R(()=>{Q(n,`href`,J(t).href),Q(r,`src`,J(t).thumbSrc),Q(r,`width`,J(t).thumbWidth),Q(r,`height`,J(t).thumbHeight),Z(s,J(t).site),Z(l,J(t).title),Z(u,J(t).description)}),fr(`click`,n,i),X(e,n)},u=e=>{var r=qa();zr(r,21,()=>J(t).items,Fr,(e,t)=>{var r=Ka(),i=F(r);n(i,()=>J(t)),D(r),X(e,r)}),D(r),X(e,r)},d=e=>{var r=Ja(),i=F(r);n(i,()=>J(t).spans),D(r),X(e,r)};Mr(a,e=>{J(t).type===`code`?e(o):J(t).type===`quote`?e(s,1):J(t).type===`image`?e(c,2):J(t).type===`unfurl`?e(l,3):J(t).type===`list`?e(u,4):e(d,-1)}),X(e,r)}),X(e,a),Ye()}pr([`click`]);var Xa=Y(`
      `),Za=Y(`
      New
      `),Qa=Y(` `),$a=Y(` `),eo=Y(``),to=Y(`
      `),no=Y(`
      `),ro=Y(`
    • `);function io(e,t){Je(t,!0);let{jumpToMessage:n}=Aa();var r=ro(),i=F(r),a=e=>{var n=Xa(),r=I(F(n),!0);D(n),R(()=>Z(r,t.dateLabel)),X(e,n)};Mr(i,e=>{t.dateLabel!==null&&e(a)});var o=L(i,2),s=e=>{X(e,Za())};Mr(o,e=>{t.unreadBelow&&e(s)});var c=L(o,2),l=F(c),u=e=>{var n=Qa(),r=I(n,!0);R(()=>Z(r,t.message.time)),X(e,n)},d=e=>{var n=$a();let r;var i=I(n,!0);R(()=>{r=ti(n,``,r,{"background-color":wi[t.message.colorIndex]}),Z(i,t.message.senderInitials)}),X(e,n)};Mr(l,e=>{t.message.grouped?e(u):e(d,-1)});var f=L(l,2),p=F(f),m=e=>{var r=eo(),i=F(r),a=I(i,!0),o=I(L(i,2),!0);D(r),R(()=>{Z(a,t.message.replyTo.sender),Z(o,t.message.replyTo.excerpt)}),fr(`click`,r,()=>n(t.message.replyTo.id)),X(e,r)};Mr(p,e=>{t.message.replyTo&&e(m)});var h=L(p,2),g=e=>{var n=to(),r=F(n),i=I(r,!0),a=I(L(r,2),!0);D(n),R(()=>{Z(i,t.message.sender),Z(a,t.message.time)}),X(e,n)};Mr(h,e=>{t.message.grouped||e(g)});var _=L(h,2);Ya(F(_),{get blocks(){return t.message.blocks}}),D(_);var v=L(_,2),y=e=>{var n=no();zr(n,21,()=>t.message.reactions,e=>e.emoji,(e,t)=>{La(e,{get reaction(){return J(t)}})}),D(n),X(e,n)};Mr(v,e=>{t.message.reactions.length>0&&e(y)}),D(f),D(c),D(r),R(()=>{$r(r,1,qr([`timeline-message`,t.message.grouped&&`timeline-message-grouped`,t.highlighted&&`timeline-message-highlighted`])),Q(r,`data-message-id`,t.message.id),Q(r,`data-index`,t.index)}),X(e,r),Ye()}pr([`click`]);var ao=Y(`
      `,1);function oo(e,t){Je(t,!0);let n,r=M(null),i=M([]),a=gt(()=>J(i).length?[...t.room.messages,...J(i)]:t.room.messages),o=gt(()=>new Na(t.room.messages.length,Math.max(0,t.room.messages.length-300),100)),s=M(0),c=gt(()=>{let e=J(a),t=null;return n=>(t===null&&(t=new Map(e.map((e,t)=>[e.id,t]))),t.get(n))}),l=M({start:0,end:0}),u=!0,d=null,f=null;function p(e,t){let n=J(o).indexAt(e),r=e+t,i=n;for(;i+10&&n.scrollTopt.onSelectRoom(e),jumpToMessage:y});let x=gt(()=>{let e=J(a)[J(a).length-1].dayIndex,n=[];for(let r=J(l).start;r0?J(a)[r-1]:null,s=o===null||o.dayIndex!==i.dayIndex;n.push({index:r,message:i,dateLabel:s?la(i.dayIndex,e):null,unreadBelow:r===t.room.readUpToIndex+1})}return n}),S=gt(()=>(J(s),{top:J(o).offsetAt(J(l).start),bottom:J(o).totalHeight-J(o).offsetAt(J(l).end)}));yn(()=>{J(x),J(S),J(r),ir(v)});var ee=ao(),te=sn(ee),ne=F(te);let re;var ie=L(ne,2);zr(ie,17,()=>J(x),e=>e.message.id,(e,t)=>{{let n=gt(()=>J(t).message.id===J(r));io(e,{get index(){return J(t).index},get message(){return J(t).message},get highlighted(){return J(n)},get dateLabel(){return J(t).dateLabel},get unreadBelow(){return J(t).unreadBelow}})}});var ae=L(ie,2);let oe;D(te),pi(te,e=>n=e,()=>n),Fa(L(te,2),{get roomName(){return t.room.name},onSend:b}),R(()=>{re=ti(ne,``,re,{height:`${J(S).top??``}px`}),oe=ti(ae,``,oe,{height:`${J(S).bottom??``}px`})}),dr(`scroll`,te,_),X(e,ee),Ye()}var so=Y(`

      `);function co(e,t){Je(t,!0);let n=M(Qt(Sa[0].id)),r=gt(()=>Sa.find(e=>e.id===J(n))),i=e=>{N(n,e,!0)};var a=so(),o=F(a);ka(o,{get rooms(){return Sa},get selectedRoomId(){return J(n)},onSelect:i});var s=L(o,2),c=F(s),l=F(c),u=I(l,!0),d=I(L(l,2),!0);D(c),Pr(L(c,2),()=>J(r).id,e=>{oo(e,{get room(){return J(r)},onSelectRoom:i})}),D(s),D(a),R(()=>{Z(u,J(r).name),Z(d,J(r).topic)}),X(e,a),Ye()}Dr(co,{target:document.getElementById(`root`)}); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/suites-experimental/chat-room-svelte/dist/assets/index.js.map b/suites-experimental/chat-room-svelte/dist/assets/index.js.map new file mode 100644 index 000000000..ba2692d68 --- /dev/null +++ b/suites-experimental/chat-room-svelte/dist/assets/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","names":["clsx","_clsx","root","$.from_html","$.child","$.only_child","$.sibling","$.clsx","$.set_style","$.delegate","root","$.from_html","$.derived","$.get","root","$.from_html","$.state","$.get","$.child","$.sibling","$.set","$.delegate","root","$.from_html","$.state","$.child","$.only_child","$.sibling","$.clsx","$.get","$.set","$.delegate","root","$.from_html","root_1","root_2","root_3","root_4","root_5","root_6","root_7","$.noop","$.comment","$.first_child","$.index","$.only_child","$.set_text","$.get","$.text","$.child","$.sibling","$.delegate","root","$.from_html","$.child","$.only_child","$.set_text","$.sibling","$.set_style","$.get","$.clsx","$.delegate","root","$.from_html","$.state","$.derived","$.get","$.first_child","$.child","$.sibling","$.set_style","$.from_html","$.state","$.proxy","$.derived","$.get","$.child","$.sibling","$.only_child","is_array","index_of","includes","array_from","define_property","get_descriptor","get_descriptors","object_prototype","array_prototype","get_prototype_of","is_extensible","noop","run_all","i","arr","deferred","resolve","reject","res","rej","CLEAN","DIRTY","MAYBE_DIRTY","INERT","DESTROYED","REACTION_RAN","DESTROYING","EFFECT_TRANSPARENT","EFFECT_PRESERVED","USER_EFFECT","EFFECT_OFFSCREEN","REACTION_IS_UPDATING","ASYNC","ERROR_VALUE","STATE_SYMBOL","COMPONENT_SYMBOL","LOADING_ATTR_SYMBOL","ATTRIBUTES_CACHE","CLASS_CACHE","STYLE_CACHE","TEXT_CACHE","FORM_RESET_HANDLER","STALE_REACTION","IS_XHTML","HYDRATION_ERROR","UNINITIALIZED","NAMESPACE_HTML","derived_inert","hydration_mismatch","svelte_boundary_reset_noop","hydrating","set_hydrating","value","hydrate_node","set_hydrate_node","node","hydrate_next","get_next_sibling","reset","next","count","skip_nodes","depth","data","remove","read_hydration_instruction","equals","safe_not_equal","a","b","safe_equals","lifecycle_outside_component","missing_context","async_derived_orphan","each_key_duplicate","effect_in_teardown","effect_in_unowned_derived","effect_orphan","effect_update_depth_exceeded","state_descriptors_fixed","state_prototype_fixed","state_unsafe_mutation","svelte_boundary_reset_onerror","create_context","key","has_context","get_context","set_context","context","get_parent_context","parent","get_or_init_context_map","name","component_context","set_component_context","createContext","getContext","setContext","hasContext","push","props","active_effect","pop","effects","fn","create_user_effect","component","mark_as_component","is_runes","micro_tasks","run_micro_tasks","tasks","queue_micro_task","is_flushing_sync","flush_tasks","STATUS_MASK","set_signal_status","signal","status","update_derived_status","derived","defer_effect","effect","dirty_effects","maybe_dirty_effects","listening_to_form_reset","add_form_reset_listener","evt","e","without_reactive_context","previous_reaction","active_reaction","previous_effect","set_active_reaction","set_active_effect","listen_to_event_and_reset_event","handler","element","event","prev","on_reset","flatten","d","derived_safe_equal","pending","blockers","deriveds","sync","async","restore","capture","blocker_promise","finish","error","invoke_error_boundary","unset_context","decrement_pending","increment_pending","run","async_derived","expression","previous_component_context","previous_batch","current_batch","activate_batch","deactivate_batch","boundary","batch","blocking","flags","OBSOLETE","promise","source","should_suspend","deferreds","async_effect","internal_set","teardown","go","p","fulfil","user_derived","push_reaction_value","destroy_derived_effects","destroy_effect","execute_derived","prev_active_effect","is_destroying_effect","update_reaction","update_derived","increment_write_version","batch_values","effect_tracking","freeze_derived_effects","remove_reactions","destroy_effect_children","unfreeze_derived_effects","update_effect","last_batch","last_scheduled_effect","is_processing","collected_effects","legacy_updates","flush_count","uid","Batch","#next","#prev","#blocking_pending","skipped","#skipped_branches","#unskipped_branches","tracked","callback","roots","#scheduled","covered","#started","#dirty_effects","#maybe_dirty_effects","render_effects","updates","#unlink","infinite_loop_guard","root","#resolve","#traverse","reset_all","#is_deferred","#defer_effects","reset_branch","#process","earlier_batch","#find_earlier_batch","#merge","#commit_callbacks","flush_queued_effects","#deferred","next_batch","#pending","old_values","is_branch","is_dirty","child","is_derived","mark","reactions","reaction","#discard_callbacks","#new_effects","blocking_pending_count","#decrement_queued","flushSync","was_flushing_sync","prev_previous_batch","result","eager_block_effects","length","unlink_effect","ordered_effects","ancestor","j","schedule_effect","eager_effects","eager_effects_deferred","state","s","v","stack","mutable_source","initial_value","immutable","set","untracking","current_sources","should_proxy","proxy","seen","count_deps","mark_reactions","updated_during_traversal","untracked_writes","set_untracked_writes","flush_eager_effects","dirty","update","get","increment","runes","not_dirty","prototype","sources","is_proxied_array","version","parent_version","update_version","with_parent","set_update_version","descriptor","prop","target","exists","receiver","has","other_s","ls","n","own_keys","$window","is_firefox","first_child_getter","next_sibling_getter","init_operations","element_prototype","node_prototype","text_prototype","create_text","get_first_child","is_text","text","merge_text_nodes","first_child","first","only_child","sibling","next_sibling","last_sibling","clear_text_content","should_defer_append","create_element","namespace","is","tag","handle_error","validate_effect","rune","push_effect","parent_last","parent_effect","create_effect","type","user_effect","component_root","options","pause_effect","render_effect","template_effect","values","block","branch","execute_effect_teardown","previously_destroying_effect","set_is_destroying_effect","controller","remove_dom","destroy_block_effect_children","removed","remove_effect_dom","transitions","transition","end","pause_children","destroy","remaining","check","t","local","transparent","resume_effect","resume_children","move_effect","fragment","captured_signals","new_deps","skipped_deps","write_version","read_version","dependencies","dependency","schedule_possible_effect_self_invalidation","previous_deps","previous_skipped_deps","previous_untracked_writes","previous_sources","previous_untracking","previous_update_version","deps","update_dependencies","dep","is_fork","remove_reaction","index","new_length","start_index","tick","depends_on_old_values","should_connect","is_new","reconnect","untrack","PASSIVE_EVENTS","is_passive_event","event_symbol","all_registered_events","root_event_handles","create_event","target_handler","handle_event_propagation","dom","event_name","delegated","delegate","events","last_propagated_event","last_propagated_event_clear_scheduled","handler_element","owner_document","path","current_target","path_idx","handled_at","at_idx","handler_idx","throw_error","other_errors","policy","html","create_trusted_html","create_fragment_from_html","elem","assign_nodes","from_html","is_fragment","use_import_node","has_start","content","clone","start","comment","frag","anchor","append","createSubscriber","subscribers","stop","Boundary","children","transform_error","#effect_pending","#local_pending_count","#anchor","#props","#children","#effect","comment_data","#hydrate_open","server_rendered_pending","serialized_error","#hydrate_failed_content","#hydrate_pending_content","#hydrate_resolved_content","#render","#main_effect","failed","#create_reset","invoke_onerror","#failed_effect","did_reset","calling_on_error","#is_destroyed","#run","err","#pending_effect","#offscreen_fragment","handled","#pending_count","previous_ctx","#update_pending_count","#pending_count_update_queued","#effect_pending_subscriber","#handle_error","handle_error_result","transformed_error","set_text","str","mount","_mount","listeners","unmount","anchor_node","ctx","Component","transformError","registered_events","event_handle","passive","counts","mounted_components","BranchManager","#transition","#batches","onscreen","#onscreen","#outroing","offscreen","#offscreen","k","on_destroy","keys","defer","#commit","#discard","if_block","marker","branches","elseif","update_branch","has_branch","NAN","legacy","get_key","render_fn","pause_effects","to_destroy","group","groups","destroy_effects","fast_path","controlled_anchor","parent_node","preserved_effects","offscreen_anchor","each","items","fallback","each_array","collection","get_collection","first_run","commit","array","reconcile","move","discard","mismatch","item","create_item","fallback_fn","skip_to_branch","is_animated","current","to_animate","matched","stashed","link","destroy_length","dest","next_node","r","f","o","clsx$1","clsx","whitespace","to_class","classname","hash","directives","len","append_styles","separator","important","css","styles","to_css_name","to_style","new_style","normal_styles","important_styles","in_str","in_apo","in_comment","reserved_names","name_index","c","property","set_class","next_class_name","next_classes","is_html","prev_classes","is_present","update_styles","priority","set_style","next_style_attr","next_styles","prev_styles","IS_CUSTOM_ELEMENT","IS_HTML","LINK_TAG","remove_input_defaults","already_removed","remove_defaults","input","set_attribute","checked","attributes","get_attributes","attribute","get_setters","setters_cache","cache_key","setters","descriptors","proto","element_proto","bind_value","batches","is_reset","is_numberlike_input","to_number","is_bound_this","bound_value","element_or_component","bind_this","component_effect","old_parts","parts","get_parts","get_value","original_teardown","SHAPE_VARIANTS","PALETTES","shapesFor","w","width","h","height","variant","bars","barWidth","cache","generatedImage","palette","paletteIndex","shape","cached","from","to","gradientId","svg","src","ROOM_COUNT","MESSAGES_PER_ROOM","MIN_MESSAGES_PER_DAY","ROOM_NAMES","SENDERS","AVATAR_COLORS","AVATAR_COLOR_COUNT","WORDS","INLINE_EMOJIS","REACTION_EMOJIS","MENTION_HANDLES","CODE_TOKENS","LINK_LABELS","LINK_PATHS","UNFURL_LINKS","QUOTE_LINES","LIST_ITEMS","CODE_SNIPPETS","seed","salt","pick","list","initials","part","roomNameFor","baseName","roomSlugFor","pickEmojis","picked","tokensToSpans","spans","words","afterInline","flush","leading","trailing","trailingSpace","token","tokens","buildInlineSpan","roll","roomIndex","buildParagraph","wordCount","lastWasInline","tail","last","buildCodeBlock","snippet","buildList","IMAGE_SIZES","IMAGE_ALTS","buildImage","size","buildUnfurl","buildBlocks","blocks","BODY_POOL_SIZE","BODY_POOL","buildReactions","REACTION_CYCLE","REACTION_POOL","formatTime","hours","minutesInDay","minutes","pad","MINUTES_IN_DAY","TIME_STRINGS","WEEKDAYS","MONTHS","DATE_LABELS","day","dateLabelFor","dayIndex","lastDayIndex","spansToText","span","blocksToText","excerpt","limit","REPLY_EXCERPT_LIMIT","BODY_EXCERPTS","bodyExcerpt","buildSenderSequence","senders","runLength","SENDER_COLOR_INDEX","SENDER_INITIALS","buildDaySequence","days","buildMessages","messages","sender","replyTo","distance","buildRooms","rooms","LOCAL_USER_NAME","LOCAL_USER","createOutgoingMessage","newest","room","previous","sentAt","sequence","root$7","Room_list_item","$$props","button","span_1","span_2","text_1","text_2","$$anchor","root$6","Room_list","nav","$0","getActions","setActions","UNMEASURED","RowHeights","#estimate","estimate","#count","#first","#heights","#offsets","#dirtyFrom","heights","offsets","#recomputeOffsets","low","high","middle","offset","root$5","Composer","draft","send","handleKeyDown","form","$1","$$value","root$4","Reaction","mine","root$3","root_1$1","root_2$1","root_3$1","root_4$1","root_5$1","root_6$1","root_7$1","root_8","root_9","root_10","Rich_text","fragment_1","node_1","consequent","code","consequent_1","preventDefault","consequent_2","consequent_3","text_3","selectRoom","alternate","text_4","$$render","fragment_3","fragment_4","node_3","consequent_4","pre","text_5","consequent_5","blockquote","node_4","consequent_6","img","consequent_7","a_1","img_1","span_3","text_6","span_4","text_7","text_8","consequent_8","ul","li","node_5","alternate_1","node_6","root$2","root_1","root_2","root_3","root_4","root_5","root_6","root_7","Message","div","div_2","node_2","div_3","jumpToMessage","div_4","span_5","div_5","div_6","root$1","Timeline","scroller","highlightedId","sent","heightsVersion","indexById","byId","message","id","range","pinnedToBottom","jumpTarget","rangeFor","scrollTop","bottom","viewportHeight","centeredOffset","centered","updateRange","captureAnchor","handleScroll","settle","captured","changed","row","messageId","handleSend","roomId","rows","startsDay","spacers","ol","li_1","styles_1","App","selectedRoomId","selectedRoom","handleSelect","main","header","h1"],"sources":["../../node_modules/svelte/src/internal/shared/utils.js","../../node_modules/svelte/src/internal/client/constants.js","../../node_modules/svelte/src/constants.js","../../node_modules/svelte/src/internal/client/warnings.js","../../node_modules/svelte/src/internal/client/dom/hydration.js","../../node_modules/svelte/src/internal/client/reactivity/equality.js","../../node_modules/svelte/src/internal/shared/errors.js","../../node_modules/svelte/src/internal/client/errors.js","../../node_modules/svelte/src/internal/flags/index.js","../../node_modules/svelte/src/internal/client/dev/tracing.js","../../node_modules/svelte/src/internal/shared/dev.js","../../node_modules/svelte/src/internal/shared/context.js","../../node_modules/svelte/src/internal/client/context.js","../../node_modules/svelte/src/internal/client/dom/task.js","../../node_modules/svelte/src/internal/client/reactivity/status.js","../../node_modules/svelte/src/internal/client/reactivity/utils.js","../../node_modules/svelte/src/internal/client/dom/elements/misc.js","../../node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js","../../node_modules/svelte/src/internal/client/reactivity/async.js","../../node_modules/svelte/src/internal/client/reactivity/deriveds.js","../../node_modules/svelte/src/internal/client/reactivity/batch.js","../../node_modules/svelte/src/internal/client/reactivity/sources.js","../../node_modules/svelte/src/internal/client/proxy.js","../../node_modules/svelte/src/internal/client/dev/equality.js","../../node_modules/svelte/src/internal/client/dom/operations.js","../../node_modules/svelte/src/internal/client/error-handling.js","../../node_modules/svelte/src/internal/client/reactivity/effects.js","../../node_modules/svelte/src/internal/client/legacy.js","../../node_modules/svelte/src/internal/client/runtime.js","../../node_modules/svelte/src/utils.js","../../node_modules/svelte/src/internal/client/dom/elements/events.js","../../node_modules/svelte/src/internal/client/dom/reconciler.js","../../node_modules/svelte/src/internal/client/dom/template.js","../../node_modules/svelte/src/reactivity/create-subscriber.js","../../node_modules/svelte/src/internal/client/dom/blocks/boundary.js","../../node_modules/svelte/src/internal/client/render.js","../../node_modules/svelte/src/internal/client/dom/blocks/branches.js","../../node_modules/svelte/src/internal/client/dom/blocks/if.js","../../node_modules/svelte/src/internal/client/dom/blocks/key.js","../../node_modules/svelte/src/internal/client/dom/blocks/each.js","../../node_modules/clsx/dist/clsx.mjs","../../node_modules/svelte/src/internal/shared/attributes.js","../../node_modules/svelte/src/internal/client/dom/elements/class.js","../../node_modules/svelte/src/internal/client/dom/elements/style.js","../../node_modules/svelte/src/internal/client/dom/elements/attributes.js","../../node_modules/svelte/src/internal/client/dom/elements/bindings/input.js","../../node_modules/svelte/src/internal/client/dom/elements/bindings/this.js","../../node_modules/svelte/src/legacy/legacy-client.js","../../node_modules/svelte/src/internal/client/dom/elements/custom-element.js","../../node_modules/svelte/src/index-client.js","../../node_modules/svelte/src/internal/disclose-version.js","../../src/data/graphics.js","../../src/data/rooms.js","../../src/components/room-list-item.svelte","../../src/components/room-list.svelte","../../src/actions.js","../../src/row-heights.js","../../src/components/composer.svelte","../../src/components/reaction.svelte","../../src/components/rich-text.svelte","../../src/components/message.svelte","../../src/components/timeline.svelte","../../src/App.svelte","../../src/main.js"],"sourcesContent":["// Store the references to globals in case someone tries to monkey patch these, causing the below\n// to de-opt (this occurs often when using popular extensions).\nexport var is_array = Array.isArray;\nexport var index_of = Array.prototype.indexOf;\nexport var includes = Array.prototype.includes;\nexport var array_from = Array.from;\nexport var object_keys = Object.keys;\nexport var define_property = Object.defineProperty;\nexport var get_descriptor = Object.getOwnPropertyDescriptor;\nexport var get_descriptors = Object.getOwnPropertyDescriptors;\nexport var object_prototype = Object.prototype;\nexport var array_prototype = Array.prototype;\nexport var get_prototype_of = Object.getPrototypeOf;\nexport var is_extensible = Object.isExtensible;\nexport var has_own_property = Object.prototype.hasOwnProperty;\n\n/**\n * @param {any} thing\n * @returns {thing is Function}\n */\nexport function is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\nexport const noop = () => {};\n\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\n\n/**\n * @template [T=any]\n * @param {any} value\n * @returns {value is PromiseLike}\n */\nexport function is_promise(value) {\n\treturn typeof value?.then === 'function';\n}\n\n/** @param {Function} fn */\nexport function run(fn) {\n\treturn fn();\n}\n\n/** @param {Array<() => void>} arr */\nexport function run_all(arr) {\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tarr[i]();\n\t}\n}\n\n/**\n * TODO replace with Promise.withResolvers once supported widely enough\n * @template [T=void]\n */\nexport function deferred() {\n\t/** @type {(value: T) => void} */\n\tvar resolve;\n\n\t/** @type {(reason: any) => void} */\n\tvar reject;\n\n\t/** @type {Promise} */\n\tvar promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\n\t// @ts-expect-error\n\treturn { promise, resolve, reject };\n}\n\n/**\n * @template V\n * @param {V} value\n * @param {V | (() => V)} fallback\n * @param {boolean} [lazy]\n * @returns {V}\n */\nexport function fallback(value, fallback, lazy = false) {\n\treturn value === undefined\n\t\t? lazy\n\t\t\t? /** @type {() => V} */ (fallback)()\n\t\t\t: /** @type {V} */ (fallback)\n\t\t: value;\n}\n\n/**\n * When encountering a situation like `let [a, b, c] = $derived(blah())`,\n * we need to stash an intermediate value that `a`, `b`, and `c` derive\n * from, in case it's an iterable\n * @template T\n * @param {ArrayLike | Iterable} value\n * @param {number} [n]\n * @returns {Array}\n */\nexport function to_array(value, n) {\n\t// return arrays unchanged\n\tif (Array.isArray(value)) {\n\t\treturn value;\n\t}\n\n\t// if value is not iterable, or `n` is unspecified (indicates a rest\n\t// element, which means we're not concerned about unbounded iterables)\n\t// convert to an array with `Array.from`\n\tif (n === undefined || !(Symbol.iterator in value)) {\n\t\treturn Array.from(value);\n\t}\n\n\t// otherwise, populate an array with `n` values\n\n\t/** @type {T[]} */\n\tconst array = [];\n\n\tfor (const element of value) {\n\t\tarray.push(element);\n\t\tif (array.length === n) break;\n\t}\n\n\treturn array;\n}\n\n/**\n * @param {Record} obj\n * @param {Array} keys\n * @returns {Record}\n */\nexport function exclude_from_object(obj, keys) {\n\t/** @type {Record} */\n\tvar result = {};\n\n\tfor (var key in obj) {\n\t\tif (!keys.includes(key)) {\n\t\t\tresult[key] = obj[key];\n\t\t}\n\t}\n\n\tfor (var symbol of Object.getOwnPropertySymbols(obj)) {\n\t\tif (Object.propertyIsEnumerable.call(obj, symbol) && !keys.includes(symbol)) {\n\t\t\tresult[symbol] = obj[symbol];\n\t\t}\n\t}\n\n\treturn result;\n}\n","// General flags\nexport const DERIVED = 1 << 1;\nexport const EFFECT = 1 << 2;\nexport const RENDER_EFFECT = 1 << 3;\n/**\n * An effect that does not destroy its child effects when it reruns.\n * Runs as part of render effects, i.e. not eagerly as part of tree traversal or effect flushing.\n */\nexport const MANAGED_EFFECT = 1 << 24;\n/**\n * An effect that does not destroy its child effects when it reruns (like MANAGED_EFFECT).\n * Runs eagerly as part of tree traversal or effect flushing.\n */\nexport const BLOCK_EFFECT = 1 << 4;\nexport const BRANCH_EFFECT = 1 << 5;\nexport const ROOT_EFFECT = 1 << 6;\nexport const BOUNDARY_EFFECT = 1 << 7;\n/**\n * Set on the effect that `pause_effect` was called on, i.e. the root of a paused subtree,\n * as opposed to its descendants which are merely `INERT`. This allows `resume_effect` on\n * an ancestor to skip subtrees that were paused for their own reasons (such as a block\n * whose condition is still false) rather than resurrecting them\n */\nexport const PAUSED = 1 << 8;\n/**\n * Indicates that a reaction is connected to an effect root โ€” either it is an effect,\n * or it is a derived that is depended on by at least one effect. If a derived has\n * no dependents, we can disconnect it from the graph, allowing it to either be\n * GC'd or reconnected later if an effect comes to depend on it again\n */\nexport const CONNECTED = 1 << 9;\nexport const CLEAN = 1 << 10;\nexport const DIRTY = 1 << 11;\nexport const MAYBE_DIRTY = 1 << 12;\nexport const INERT = 1 << 13;\nexport const DESTROYED = 1 << 14;\n/** Set once a reaction has run for the first time */\nexport const REACTION_RAN = 1 << 15;\n/** Effect is in the process of getting destroyed. Can be observed in child teardown functions */\nexport const DESTROYING = 1 << 25;\n\n// Flags exclusive to effects\n/**\n * 'Transparent' effects do not create a transition boundary.\n * This is on a block effect 99% of the time but may also be on a branch effect if its parent block effect was pruned\n */\nexport const EFFECT_TRANSPARENT = 1 << 16;\nexport const EAGER_EFFECT = 1 << 17;\nexport const HEAD_EFFECT = 1 << 18;\nexport const EFFECT_PRESERVED = 1 << 19;\nexport const USER_EFFECT = 1 << 20;\nexport const EFFECT_OFFSCREEN = 1 << 25;\n\n// Flags used for async\nexport const REACTION_IS_UPDATING = 1 << 21;\nexport const ASYNC = 1 << 22;\n\nexport const ERROR_VALUE = 1 << 23;\n\nexport const STATE_SYMBOL = Symbol('$state');\n/** Marks component export objects, so that `proxy(...)` leaves them untouched */\nexport const COMPONENT_SYMBOL = Symbol('component');\nexport const LEGACY_PROPS = Symbol('legacy props');\nexport const LOADING_ATTR_SYMBOL = Symbol('');\nexport const PROXY_PATH_SYMBOL = Symbol('proxy path');\nexport const ATTRIBUTES_CACHE = Symbol('attributes');\nexport const CLASS_CACHE = Symbol('class');\nexport const STYLE_CACHE = Symbol('style');\nexport const TEXT_CACHE = Symbol('text');\nexport const FORM_RESET_HANDLER = Symbol('form reset');\n/** An anchor might change, via this symbol on the original anchor we can tell HMR about the updated anchor */\nexport const HMR_ANCHOR = Symbol('hmr anchor');\n\n/** allow users to ignore aborted signal errors if `reason.name === 'StaleReactionError` */\nexport const STALE_REACTION = new (class StaleReactionError extends Error {\n\tname = 'StaleReactionError';\n\tmessage = 'The reaction that called `getAbortSignal()` was re-run or destroyed';\n})();\n\nexport const IS_XHTML =\n\t// We gotta write it like this because after downleveling the pure comment may end up in the wrong location\n\t!!globalThis.document?.contentType &&\n\t/* @__PURE__ */ globalThis.document.contentType.includes('xml');\nexport const ELEMENT_NODE = 1;\nexport const TEXT_NODE = 3;\nexport const COMMENT_NODE = 8;\nexport const DOCUMENT_FRAGMENT_NODE = 11;\n","export const EACH_ITEM_REACTIVE = 1;\nexport const EACH_INDEX_REACTIVE = 1 << 1;\n/** See EachBlock interface metadata.is_controlled for an explanation what this is */\nexport const EACH_IS_CONTROLLED = 1 << 2;\nexport const EACH_IS_ANIMATED = 1 << 3;\nexport const EACH_ITEM_IMMUTABLE = 1 << 4;\n\nexport const PROPS_IS_IMMUTABLE = 1;\nexport const PROPS_IS_RUNES = 1 << 1;\nexport const PROPS_IS_UPDATED = 1 << 2;\nexport const PROPS_IS_BINDABLE = 1 << 3;\nexport const PROPS_IS_LAZY_INITIAL = 1 << 4;\n\nexport const TRANSITION_IN = 1;\nexport const TRANSITION_OUT = 1 << 1;\nexport const TRANSITION_GLOBAL = 1 << 2;\n\nexport const TEMPLATE_FRAGMENT = 1;\nexport const TEMPLATE_USE_IMPORT_NODE = 1 << 1;\nexport const TEMPLATE_USE_SVG = 1 << 2;\nexport const TEMPLATE_USE_MATHML = 1 << 3;\n\nexport const HYDRATION_START = '[';\n/** used to indicate that an `{:else}...` block was rendered */\nexport const HYDRATION_START_ELSE = '[!';\n/** used to indicate that a boundary's `failed` snippet was rendered on the server */\nexport const HYDRATION_START_FAILED = '[?';\nexport const HYDRATION_END = ']';\nexport const HYDRATION_ERROR = {};\n\nexport const ELEMENT_IS_NAMESPACED = 1;\nexport const ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;\nexport const ELEMENT_IS_INPUT = 1 << 2;\n\nexport const UNINITIALIZED = Symbol('uninitialized');\n\n// Dev-time component properties\nexport const FILENAME = Symbol('filename');\nexport const HMR = Symbol('hmr');\n\nexport const NAMESPACE_HTML = 'http://www.w3.org/1999/xhtml';\nexport const NAMESPACE_SVG = 'http://www.w3.org/2000/svg';\nexport const NAMESPACE_MATHML = 'http://www.w3.org/1998/Math/MathML';\n\n// we use a list of ignorable runtime warnings because not every runtime warning\n// can be ignored and we want to keep the validation for svelte-ignore in place\nexport const IGNORABLE_RUNTIME_WARNINGS = /** @type {const} */ ([\n\t'await_waterfall',\n\t'await_reactivity_loss',\n\t'state_snapshot_uncloneable',\n\t'binding_property_non_reactive',\n\t'hydration_attribute_changed',\n\t'hydration_html_changed',\n\t'ownership_invalid_binding',\n\t'ownership_invalid_mutation'\n]);\n\n/**\n * Whitespace inside one of these elements will not result in\n * a whitespace node being created in any circumstances. (This\n * list is almost certainly very incomplete)\n * TODO this is currently unused\n */\nexport const ELEMENTS_WITHOUT_TEXT = ['audio', 'datalist', 'dl', 'optgroup', 'select', 'video'];\n\nexport const ATTACHMENT_KEY = '@attach';\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\nvar bold = 'font-weight: bold';\nvar normal = 'font-weight: normal';\n\n/**\n * Assignment to `%property%` property (%location%) will evaluate to the right-hand side, not the value of `%property%` following the assignment. This may result in unexpected behaviour.\n * @param {string} property\n * @param {string} location\n */\nexport function assignment_value_stale(property, location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] assignment_value_stale\\n%cAssignment to \\`${property}\\` property (${location}) will evaluate to the right-hand side, not the value of \\`${property}\\` following the assignment. This may result in unexpected behaviour.\\nhttps://svelte.dev/e/assignment_value_stale`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/assignment_value_stale`);\n\t}\n}\n\n/**\n * Detected reactivity loss when reading `%name%`. This happens when state is read in an async function after an earlier `await`\n * @param {string} name\n */\nexport function await_reactivity_loss(name) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] await_reactivity_loss\\n%cDetected reactivity loss when reading \\`${name}\\`. This happens when state is read in an async function after an earlier \\`await\\`\\nhttps://svelte.dev/e/await_reactivity_loss`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/await_reactivity_loss`);\n\t}\n}\n\n/**\n * An async derived, `%name%` (%location%) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app\n * @param {string} name\n * @param {string} location\n */\nexport function await_waterfall(name, location) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] await_waterfall\\n%cAn async derived, \\`${name}\\` (${location}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app\\nhttps://svelte.dev/e/await_waterfall`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/await_waterfall`);\n\t}\n}\n\n/**\n * `%binding%` (%location%) is binding to a non-reactive property\n * @param {string} binding\n * @param {string | undefined | null} [location]\n */\nexport function binding_property_non_reactive(binding, location) {\n\tif (DEV) {\n\t\tconsole.warn(\n\t\t\t`%c[svelte] binding_property_non_reactive\\n%c${location\n\t\t\t\t? `\\`${binding}\\` (${location}) is binding to a non-reactive property`\n\t\t\t\t: `\\`${binding}\\` is binding to a non-reactive property`}\\nhttps://svelte.dev/e/binding_property_non_reactive`,\n\t\t\tbold,\n\t\t\tnormal\n\t\t);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/binding_property_non_reactive`);\n\t}\n}\n\n/**\n * Your `console.%method%` contained `$state` proxies. Consider using `$inspect(...)` or `$state.snapshot(...)` instead\n * @param {string} method\n */\nexport function console_log_state(method) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] console_log_state\\n%cYour \\`console.${method}\\` contained \\`$state\\` proxies. Consider using \\`$inspect(...)\\` or \\`$state.snapshot(...)\\` instead\\nhttps://svelte.dev/e/console_log_state`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/console_log_state`);\n\t}\n}\n\n/**\n * Reading a derived belonging to a now-destroyed effect may result in stale values\n */\nexport function derived_inert() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] derived_inert\\n%cReading a derived belonging to a now-destroyed effect may result in stale values\\nhttps://svelte.dev/e/derived_inert`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/derived_inert`);\n\t}\n}\n\n/**\n * %handler% should be a function. Did you mean to %suggestion%?\n * @param {string} handler\n * @param {string} suggestion\n */\nexport function event_handler_invalid(handler, suggestion) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] event_handler_invalid\\n%c${handler} should be a function. Did you mean to ${suggestion}?\\nhttps://svelte.dev/e/event_handler_invalid`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/event_handler_invalid`);\n\t}\n}\n\n/**\n * Expected to find a hydratable with key `%key%` during hydration, but did not.\n * @param {string} key\n */\nexport function hydratable_missing_but_expected(key) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] hydratable_missing_but_expected\\n%cExpected to find a hydratable with key \\`${key}\\` during hydration, but did not.\\nhttps://svelte.dev/e/hydratable_missing_but_expected`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydratable_missing_but_expected`);\n\t}\n}\n\n/**\n * The `%attribute%` attribute on `%html%` changed its value between server and client renders. The client value, `%value%`, will be ignored in favour of the server value\n * @param {string} attribute\n * @param {string} html\n * @param {string} value\n */\nexport function hydration_attribute_changed(attribute, html, value) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] hydration_attribute_changed\\n%cThe \\`${attribute}\\` attribute on \\`${html}\\` changed its value between server and client renders. The client value, \\`${value}\\`, will be ignored in favour of the server value\\nhttps://svelte.dev/e/hydration_attribute_changed`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_attribute_changed`);\n\t}\n}\n\n/**\n * The value of an `{@html ...}` block %location% changed between server and client renders. The client value will be ignored in favour of the server value\n * @param {string | undefined | null} [location]\n */\nexport function hydration_html_changed(location) {\n\tif (DEV) {\n\t\tconsole.warn(\n\t\t\t`%c[svelte] hydration_html_changed\\n%c${location\n\t\t\t\t? `The value of an \\`{@html ...}\\` block ${location} changed between server and client renders. The client value will be ignored in favour of the server value`\n\t\t\t\t: 'The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value'}\\nhttps://svelte.dev/e/hydration_html_changed`,\n\t\t\tbold,\n\t\t\tnormal\n\t\t);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_html_changed`);\n\t}\n}\n\n/**\n * Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near %location%\n * @param {string | undefined | null} [location]\n */\nexport function hydration_mismatch(location) {\n\tif (DEV) {\n\t\tconsole.warn(\n\t\t\t`%c[svelte] hydration_mismatch\\n%c${location\n\t\t\t\t? `Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}`\n\t\t\t\t: 'Hydration failed because the initial UI does not match what was rendered on the server'}\\nhttps://svelte.dev/e/hydration_mismatch`,\n\t\t\tbold,\n\t\t\tnormal\n\t\t);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/hydration_mismatch`);\n\t}\n}\n\n/**\n * The `render` function passed to `createRawSnippet` should return HTML for a single element\n */\nexport function invalid_raw_snippet_render() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] invalid_raw_snippet_render\\n%cThe \\`render\\` function passed to \\`createRawSnippet\\` should return HTML for a single element\\nhttps://svelte.dev/e/invalid_raw_snippet_render`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/invalid_raw_snippet_render`);\n\t}\n}\n\n/**\n * Detected a migrated `$:` reactive block in `%filename%` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`.\n * @param {string} filename\n */\nexport function legacy_recursive_reactive_block(filename) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] legacy_recursive_reactive_block\\n%cDetected a migrated \\`$:\\` reactive block in \\`${filename}\\` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an \\`$effect\\`.\\nhttps://svelte.dev/e/legacy_recursive_reactive_block`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/legacy_recursive_reactive_block`);\n\t}\n}\n\n/**\n * Tried to unmount a component that was not mounted\n */\nexport function lifecycle_double_unmount() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] lifecycle_double_unmount\\n%cTried to unmount a component that was not mounted\\nhttps://svelte.dev/e/lifecycle_double_unmount`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/lifecycle_double_unmount`);\n\t}\n}\n\n/**\n * %parent% passed property `%prop%` to %child% with `bind:`, but its parent component %owner% did not declare `%prop%` as a binding. Consider creating a binding between %owner% and %parent% (e.g. `bind:%prop%={...}` instead of `%prop%={...}`)\n * @param {string} parent\n * @param {string} prop\n * @param {string} child\n * @param {string} owner\n */\nexport function ownership_invalid_binding(parent, prop, child, owner) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] ownership_invalid_binding\\n%c${parent} passed property \\`${prop}\\` to ${child} with \\`bind:\\`, but its parent component ${owner} did not declare \\`${prop}\\` as a binding. Consider creating a binding between ${owner} and ${parent} (e.g. \\`bind:${prop}={...}\\` instead of \\`${prop}={...}\\`)\\nhttps://svelte.dev/e/ownership_invalid_binding`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/ownership_invalid_binding`);\n\t}\n}\n\n/**\n * Mutating unbound props (`%name%`, at %location%) is strongly discouraged. Consider using `bind:%prop%={...}` in %parent% (or using a callback) instead\n * @param {string} name\n * @param {string} location\n * @param {string} prop\n * @param {string} parent\n */\nexport function ownership_invalid_mutation(name, location, prop, parent) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] ownership_invalid_mutation\\n%cMutating unbound props (\\`${name}\\`, at ${location}) is strongly discouraged. Consider using \\`bind:${prop}={...}\\` in ${parent} (or using a callback) instead\\nhttps://svelte.dev/e/ownership_invalid_mutation`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/ownership_invalid_mutation`);\n\t}\n}\n\n/**\n * The `value` property of a `\\` element should be an array, but it received a non-array value. The selection will be kept as is.\\nhttps://svelte.dev/e/select_multiple_invalid_value`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/select_multiple_invalid_value`);\n\t}\n}\n\n/**\n * Reactive `$state(...)` proxies and the values they proxy have different identities. Because of this, comparisons with `%operator%` will produce unexpected results\n * @param {string} operator\n */\nexport function state_proxy_equality_mismatch(operator) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] state_proxy_equality_mismatch\\n%cReactive \\`$state(...)\\` proxies and the values they proxy have different identities. Because of this, comparisons with \\`${operator}\\` will produce unexpected results\\nhttps://svelte.dev/e/state_proxy_equality_mismatch`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/state_proxy_equality_mismatch`);\n\t}\n}\n\n/**\n * A `` `reset` function only resets the boundary the first time it is called\n */\nexport function svelte_boundary_reset_noop() {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] svelte_boundary_reset_noop\\n%cA \\`\\` \\`reset\\` function only resets the boundary the first time it is called\\nhttps://svelte.dev/e/svelte_boundary_reset_noop`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);\n\t}\n}\n\n/**\n * The `slide` transition does not work correctly for elements with `display: %value%`\n * @param {string} value\n */\nexport function transition_slide_display(value) {\n\tif (DEV) {\n\t\tconsole.warn(`%c[svelte] transition_slide_display\\n%cThe \\`slide\\` transition does not work correctly for elements with \\`display: ${value}\\`\\nhttps://svelte.dev/e/transition_slide_display`, bold, normal);\n\t} else {\n\t\tconsole.warn(`https://svelte.dev/e/transition_slide_display`);\n\t}\n}","/** @import { TemplateNode } from '#client' */\n\nimport { COMMENT_NODE } from '#client/constants';\nimport {\n\tHYDRATION_END,\n\tHYDRATION_ERROR,\n\tHYDRATION_START,\n\tHYDRATION_START_ELSE\n} from '../../../constants.js';\nimport * as w from '../warnings.js';\nimport { get_next_sibling } from './operations.js';\n\n/**\n * Use this variable to guard everything related to hydration code so it can be treeshaken out\n * if the user doesn't use the `hydrate` method and these code paths are therefore not needed.\n */\nexport let hydrating = false;\n\n/** @param {boolean} value */\nexport function set_hydrating(value) {\n\thydrating = value;\n}\n\n/**\n * The node that is currently being hydrated. This starts out as the first node inside the opening\n * comment, and updates each time a component calls `$.child(...)` or `$.sibling(...)`.\n * When entering a block (e.g. `{#if ...}`), `hydrate_node` is the block opening comment; by the\n * time we leave the block it is the closing comment, which serves as the block's anchor.\n * @type {TemplateNode}\n */\nexport let hydrate_node;\n\n/** @param {TemplateNode | null} node */\nexport function set_hydrate_node(node) {\n\tif (node === null) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\treturn (hydrate_node = node);\n}\n\nexport function hydrate_next() {\n\treturn set_hydrate_node(get_next_sibling(hydrate_node));\n}\n\n/** @param {TemplateNode} node */\nexport function reset(node) {\n\tif (!hydrating) return;\n\n\t// If the node has remaining siblings, something has gone wrong\n\tif (get_next_sibling(hydrate_node) !== null) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\thydrate_node = node;\n}\n\n/**\n * @param {HTMLTemplateElement} template\n */\nexport function hydrate_template(template) {\n\tif (hydrating) {\n\t\t// @ts-expect-error TemplateNode doesn't include DocumentFragment, but it's actually fine\n\t\thydrate_node = template.content;\n\t}\n}\n\nexport function next(count = 1) {\n\tif (hydrating) {\n\t\tvar i = count;\n\t\tvar node = hydrate_node;\n\n\t\twhile (i--) {\n\t\t\tnode = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\t}\n\n\t\thydrate_node = node;\n\t}\n}\n\n/**\n * Skips or removes (depending on {@link remove}) all nodes starting at `hydrate_node` up until the next hydration end comment\n * @param {boolean} remove\n */\nexport function skip_nodes(remove = true) {\n\tvar depth = 0;\n\tvar node = hydrate_node;\n\n\twhile (true) {\n\t\tif (node.nodeType === COMMENT_NODE) {\n\t\t\tvar data = /** @type {Comment} */ (node).data;\n\n\t\t\tif (data === HYDRATION_END) {\n\t\t\t\tif (depth === 0) return node;\n\t\t\t\tdepth -= 1;\n\t\t\t} else if (\n\t\t\t\tdata === HYDRATION_START ||\n\t\t\t\tdata === HYDRATION_START_ELSE ||\n\t\t\t\t// \"[1\", \"[2\", etc. for if blocks\n\t\t\t\t(data[0] === '[' && !isNaN(Number(data.slice(1))))\n\t\t\t) {\n\t\t\t\tdepth += 1;\n\t\t\t}\n\t\t}\n\n\t\tvar next = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tif (remove) node.remove();\n\t\tnode = next;\n\t}\n}\n\n/**\n *\n * @param {TemplateNode} node\n */\nexport function read_hydration_instruction(node) {\n\tif (!node || node.nodeType !== COMMENT_NODE) {\n\t\tw.hydration_mismatch();\n\t\tthrow HYDRATION_ERROR;\n\t}\n\n\treturn /** @type {Comment} */ (node).data;\n}\n","/** @import { Equals } from '#client' */\n\n/** @type {Equals} */\nexport function equals(value) {\n\treturn value === this.v;\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function safe_not_equal(a, b) {\n\treturn a != a\n\t\t? b == b\n\t\t: a !== b || (a !== null && typeof a === 'object') || typeof a === 'function';\n}\n\n/**\n * @param {unknown} a\n * @param {unknown} b\n * @returns {boolean}\n */\nexport function not_equal(a, b) {\n\treturn a !== b;\n}\n\n/** @type {Equals} */\nexport function safe_equals(value) {\n\treturn !safe_not_equal(value, this.v);\n}\n","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\n/**\n * Cannot use `%name%(...)` unless the `experimental.async` compiler option is `true`\n * @param {string} name\n * @returns {never}\n */\nexport function experimental_async_required(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`experimental_async_required\\nCannot use \\`${name}(...)\\` unless the \\`experimental.async\\` compiler option is \\`true\\`\\nhttps://svelte.dev/e/experimental_async_required`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/experimental_async_required`);\n\t}\n}\n\n/**\n * Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead\n * @returns {never}\n */\nexport function invalid_default_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_default_snippet\\nCannot use \\`{@render children(...)}\\` if the parent component uses \\`let:\\` directives. Consider using a named snippet instead\\nhttps://svelte.dev/e/invalid_default_snippet`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_default_snippet`);\n\t}\n}\n\n/**\n * A snippet function was passed invalid arguments. Snippets should only be instantiated via `{@render ...}`\n * @returns {never}\n */\nexport function invalid_snippet_arguments() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_snippet_arguments\\nA snippet function was passed invalid arguments. Snippets should only be instantiated via \\`{@render ...}\\`\\nhttps://svelte.dev/e/invalid_snippet_arguments`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_snippet_arguments`);\n\t}\n}\n\n/**\n * An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app โ€” please open an issue at https://github.com/sveltejs/svelte, citing the following message: \"%message%\"\n * @param {string} message\n * @returns {never}\n */\nexport function invariant_violation(message) {\n\tif (DEV) {\n\t\tconst error = new Error(`invariant_violation\\nAn invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app โ€” please open an issue at https://github.com/sveltejs/svelte, citing the following message: \"${message}\"\\nhttps://svelte.dev/e/invariant_violation`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invariant_violation`);\n\t}\n}\n\n/**\n * `%name%(...)` can only be used during component initialisation\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_outside_component(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_outside_component\\n\\`${name}(...)\\` can only be used during component initialisation\\nhttps://svelte.dev/e/lifecycle_outside_component`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_outside_component`);\n\t}\n}\n\n/**\n * Context was not set in the current component or any of its ancestors\n * @returns {never}\n */\nexport function missing_context() {\n\tif (DEV) {\n\t\tconst error = new Error(`missing_context\\nContext was not set in the current component or any of its ancestors\\nhttps://svelte.dev/e/missing_context`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/missing_context`);\n\t}\n}\n\n/**\n * `setContext` must be called when a component first initializes, not in a subsequent effect or after an `await` expression\n * @returns {never}\n */\nexport function set_context_after_init() {\n\tif (DEV) {\n\t\tconst error = new Error(`set_context_after_init\\n\\`setContext\\` must be called when a component first initializes, not in a subsequent effect or after an \\`await\\` expression\\nhttps://svelte.dev/e/set_context_after_init`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/set_context_after_init`);\n\t}\n}\n\n/**\n * Attempted to render a snippet without a `{@render}` block. This would cause the snippet code to be stringified instead of its content being rendered to the DOM. To fix this, change `{snippet}` to `{@render snippet()}`.\n * @returns {never}\n */\nexport function snippet_without_render_tag() {\n\tif (DEV) {\n\t\tconst error = new Error(`snippet_without_render_tag\\nAttempted to render a snippet without a \\`{@render}\\` block. This would cause the snippet code to be stringified instead of its content being rendered to the DOM. To fix this, change \\`{snippet}\\` to \\`{@render snippet()}\\`.\\nhttps://svelte.dev/e/snippet_without_render_tag`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/snippet_without_render_tag`);\n\t}\n}\n\n/**\n * `%name%` is not a store with a `subscribe` method\n * @param {string} name\n * @returns {never}\n */\nexport function store_invalid_shape(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`store_invalid_shape\\n\\`${name}\\` is not a store with a \\`subscribe\\` method\\nhttps://svelte.dev/e/store_invalid_shape`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/store_invalid_shape`);\n\t}\n}\n\n/**\n * The `this` prop on `` must be a string, if defined\n * @returns {never}\n */\nexport function svelte_element_invalid_this_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`svelte_element_invalid_this_value\\nThe \\`this\\` prop on \\`\\` must be a string, if defined\\nhttps://svelte.dev/e/svelte_element_invalid_this_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/svelte_element_invalid_this_value`);\n\t}\n}","/* This file is generated by scripts/process-messages/index.js. Do not edit! */\n\nimport { DEV } from 'esm-env';\n\nexport * from '../shared/errors.js';\n\n/**\n * Cannot create a `$derived(...)` with an `await` expression outside of an effect tree\n * @returns {never}\n */\nexport function async_derived_orphan() {\n\tif (DEV) {\n\t\tconst error = new Error(`async_derived_orphan\\nCannot create a \\`$derived(...)\\` with an \\`await\\` expression outside of an effect tree\\nhttps://svelte.dev/e/async_derived_orphan`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/async_derived_orphan`);\n\t}\n}\n\n/**\n * Using `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\n * @returns {never}\n */\nexport function bind_invalid_checkbox_value() {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_checkbox_value\\nUsing \\`bind:value\\` together with a checkbox input is not allowed. Use \\`bind:checked\\` instead\\nhttps://svelte.dev/e/bind_invalid_checkbox_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_checkbox_value`);\n\t}\n}\n\n/**\n * Component %component% has an export named `%key%` that a consumer component is trying to access using `bind:%key%`, which is disallowed. Instead, use `bind:this` (e.g. `<%name% bind:this={component} />`) and then access the property on the bound component instance (e.g. `component.%key%`)\n * @param {string} component\n * @param {string} key\n * @param {string} name\n * @returns {never}\n */\nexport function bind_invalid_export(component, key, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_invalid_export\\nComponent ${component} has an export named \\`${key}\\` that a consumer component is trying to access using \\`bind:${key}\\`, which is disallowed. Instead, use \\`bind:this\\` (e.g. \\`<${name} bind:this={component} />\\`) and then access the property on the bound component instance (e.g. \\`component.${key}\\`)\\nhttps://svelte.dev/e/bind_invalid_export`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_invalid_export`);\n\t}\n}\n\n/**\n * A component is attempting to bind to a non-bindable property `%key%` belonging to %component% (i.e. `<%name% bind:%key%={...}>`). To mark a property as bindable: `let { %key% = $bindable() } = $props()`\n * @param {string} key\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function bind_not_bindable(key, component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`bind_not_bindable\\nA component is attempting to bind to a non-bindable property \\`${key}\\` belonging to ${component} (i.e. \\`<${name} bind:${key}={...}>\\`). To mark a property as bindable: \\`let { ${key} = $bindable() } = $props()\\`\\nhttps://svelte.dev/e/bind_not_bindable`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/bind_not_bindable`);\n\t}\n}\n\n/**\n * Calling `%method%` on a component instance (of %component%) is no longer valid in Svelte 5\n * @param {string} method\n * @param {string} component\n * @returns {never}\n */\nexport function component_api_changed(method, component) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_changed\\nCalling \\`${method}\\` on a component instance (of ${component}) is no longer valid in Svelte 5\\nhttps://svelte.dev/e/component_api_changed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_changed`);\n\t}\n}\n\n/**\n * Attempted to instantiate %component% with `new %name%`, which is no longer valid in Svelte 5. If this component is not under your control, set the `compatibility.componentApi` compiler option to `4` to keep it working.\n * @param {string} component\n * @param {string} name\n * @returns {never}\n */\nexport function component_api_invalid_new(component, name) {\n\tif (DEV) {\n\t\tconst error = new Error(`component_api_invalid_new\\nAttempted to instantiate ${component} with \\`new ${name}\\`, which is no longer valid in Svelte 5. If this component is not under your control, set the \\`compatibility.componentApi\\` compiler option to \\`4\\` to keep it working.\\nhttps://svelte.dev/e/component_api_invalid_new`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/component_api_invalid_new`);\n\t}\n}\n\n/**\n * A derived value cannot reference itself recursively\n * @returns {never}\n */\nexport function derived_references_self() {\n\tif (DEV) {\n\t\tconst error = new Error(`derived_references_self\\nA derived value cannot reference itself recursively\\nhttps://svelte.dev/e/derived_references_self`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/derived_references_self`);\n\t}\n}\n\n/**\n * Keyed each block has duplicate key `%value%` at indexes %a% and %b%\n * @param {string} a\n * @param {string} b\n * @param {string | undefined | null} [value]\n * @returns {never}\n */\nexport function each_key_duplicate(a, b, value) {\n\tif (DEV) {\n\t\tconst error = new Error(`each_key_duplicate\\n${value\n\t\t\t? `Keyed each block has duplicate key \\`${value}\\` at indexes ${a} and ${b}`\n\t\t\t: `Keyed each block has duplicate key at indexes ${a} and ${b}`}\\nhttps://svelte.dev/e/each_key_duplicate`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/each_key_duplicate`);\n\t}\n}\n\n/**\n * Keyed each block has key that is not idempotent โ€” the key for item at index %index% was `%a%` but is now `%b%`. Keys must be the same each time for a given item\n * @param {string} index\n * @param {string} a\n * @param {string} b\n * @returns {never}\n */\nexport function each_key_volatile(index, a, b) {\n\tif (DEV) {\n\t\tconst error = new Error(`each_key_volatile\\nKeyed each block has key that is not idempotent โ€” the key for item at index ${index} was \\`${a}\\` but is now \\`${b}\\`. Keys must be the same each time for a given item\\nhttps://svelte.dev/e/each_key_volatile`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/each_key_volatile`);\n\t}\n}\n\n/**\n * `%rune%` cannot be used inside an effect cleanup function\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_in_teardown(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_teardown\\n\\`${rune}\\` cannot be used inside an effect cleanup function\\nhttps://svelte.dev/e/effect_in_teardown`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_teardown`);\n\t}\n}\n\n/**\n * Effect cannot be created inside a `$derived` value that was not itself created inside an effect\n * @returns {never}\n */\nexport function effect_in_unowned_derived() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_in_unowned_derived\\nEffect cannot be created inside a \\`$derived\\` value that was not itself created inside an effect\\nhttps://svelte.dev/e/effect_in_unowned_derived`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_in_unowned_derived`);\n\t}\n}\n\n/**\n * `%rune%` can only be used inside an effect (e.g. during component initialisation)\n * @param {string} rune\n * @returns {never}\n */\nexport function effect_orphan(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_orphan\\n\\`${rune}\\` can only be used inside an effect (e.g. during component initialisation)\\nhttps://svelte.dev/e/effect_orphan`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_orphan`);\n\t}\n}\n\n/**\n * `$effect.pending()` can only be called inside an effect or derived\n * @returns {never}\n */\nexport function effect_pending_outside_reaction() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_pending_outside_reaction\\n\\`$effect.pending()\\` can only be called inside an effect or derived\\nhttps://svelte.dev/e/effect_pending_outside_reaction`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_pending_outside_reaction`);\n\t}\n}\n\n/**\n * Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state\n * @returns {never}\n */\nexport function effect_update_depth_exceeded() {\n\tif (DEV) {\n\t\tconst error = new Error(`effect_update_depth_exceeded\\nMaximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state\\nhttps://svelte.dev/e/effect_update_depth_exceeded`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/effect_update_depth_exceeded`);\n\t}\n}\n\n/**\n * Cannot use `flushSync` inside an effect\n * @returns {never}\n */\nexport function flush_sync_in_effect() {\n\tif (DEV) {\n\t\tconst error = new Error(`flush_sync_in_effect\\nCannot use \\`flushSync\\` inside an effect\\nhttps://svelte.dev/e/flush_sync_in_effect`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/flush_sync_in_effect`);\n\t}\n}\n\n/**\n * Cannot commit a fork that was already discarded\n * @returns {never}\n */\nexport function fork_discarded() {\n\tif (DEV) {\n\t\tconst error = new Error(`fork_discarded\\nCannot commit a fork that was already discarded\\nhttps://svelte.dev/e/fork_discarded`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/fork_discarded`);\n\t}\n}\n\n/**\n * Cannot create a fork inside an effect or when state changes are pending\n * @returns {never}\n */\nexport function fork_timing() {\n\tif (DEV) {\n\t\tconst error = new Error(`fork_timing\\nCannot create a fork inside an effect or when state changes are pending\\nhttps://svelte.dev/e/fork_timing`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/fork_timing`);\n\t}\n}\n\n/**\n * `getAbortSignal()` can only be called inside an effect or derived\n * @returns {never}\n */\nexport function get_abort_signal_outside_reaction() {\n\tif (DEV) {\n\t\tconst error = new Error(`get_abort_signal_outside_reaction\\n\\`getAbortSignal()\\` can only be called inside an effect or derived\\nhttps://svelte.dev/e/get_abort_signal_outside_reaction`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/get_abort_signal_outside_reaction`);\n\t}\n}\n\n/**\n * Expected to find a hydratable with key `%key%` during hydration, but did not.\n * @param {string} key\n * @returns {never}\n */\nexport function hydratable_missing_but_required(key) {\n\tif (DEV) {\n\t\tconst error = new Error(`hydratable_missing_but_required\\nExpected to find a hydratable with key \\`${key}\\` during hydration, but did not.\\nhttps://svelte.dev/e/hydratable_missing_but_required`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/hydratable_missing_but_required`);\n\t}\n}\n\n/**\n * Failed to hydrate the application\n * @returns {never}\n */\nexport function hydration_failed() {\n\tif (DEV) {\n\t\tconst error = new Error(`hydration_failed\\nFailed to hydrate the application\\nhttps://svelte.dev/e/hydration_failed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/hydration_failed`);\n\t}\n}\n\n/**\n * Could not `{@render}` snippet due to the expression being `null` or `undefined`. Consider using optional chaining `{@render snippet?.()}`\n * @returns {never}\n */\nexport function invalid_snippet() {\n\tif (DEV) {\n\t\tconst error = new Error(`invalid_snippet\\nCould not \\`{@render}\\` snippet due to the expression being \\`null\\` or \\`undefined\\`. Consider using optional chaining \\`{@render snippet?.()}\\`\\nhttps://svelte.dev/e/invalid_snippet`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/invalid_snippet`);\n\t}\n}\n\n/**\n * `%name%(...)` cannot be used in runes mode\n * @param {string} name\n * @returns {never}\n */\nexport function lifecycle_legacy_only(name) {\n\tif (DEV) {\n\t\tconst error = new Error(`lifecycle_legacy_only\\n\\`${name}(...)\\` cannot be used in runes mode\\nhttps://svelte.dev/e/lifecycle_legacy_only`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/lifecycle_legacy_only`);\n\t}\n}\n\n/**\n * Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value\n * @param {string} key\n * @returns {never}\n */\nexport function props_invalid_value(key) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_invalid_value\\nCannot do \\`bind:${key}={undefined}\\` when \\`${key}\\` has a fallback value\\nhttps://svelte.dev/e/props_invalid_value`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_invalid_value`);\n\t}\n}\n\n/**\n * Rest element properties of `$props()` such as `%property%` are readonly\n * @param {string} property\n * @returns {never}\n */\nexport function props_rest_readonly(property) {\n\tif (DEV) {\n\t\tconst error = new Error(`props_rest_readonly\\nRest element properties of \\`$props()\\` such as \\`${property}\\` are readonly\\nhttps://svelte.dev/e/props_rest_readonly`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/props_rest_readonly`);\n\t}\n}\n\n/**\n * The `%rune%` rune is only available inside `.svelte` and `.svelte.js/ts` files\n * @param {string} rune\n * @returns {never}\n */\nexport function rune_outside_svelte(rune) {\n\tif (DEV) {\n\t\tconst error = new Error(`rune_outside_svelte\\nThe \\`${rune}\\` rune is only available inside \\`.svelte\\` and \\`.svelte.js/ts\\` files\\nhttps://svelte.dev/e/rune_outside_svelte`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/rune_outside_svelte`);\n\t}\n}\n\n/**\n * Property descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\n * @returns {never}\n */\nexport function state_descriptors_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_descriptors_fixed\\nProperty descriptors defined on \\`$state\\` objects must contain \\`value\\` and always be \\`enumerable\\`, \\`configurable\\` and \\`writable\\`.\\nhttps://svelte.dev/e/state_descriptors_fixed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_descriptors_fixed`);\n\t}\n}\n\n/**\n * Cannot set prototype of `$state` object\n * @returns {never}\n */\nexport function state_prototype_fixed() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_prototype_fixed\\nCannot set prototype of \\`$state\\` object\\nhttps://svelte.dev/e/state_prototype_fixed`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_prototype_fixed`);\n\t}\n}\n\n/**\n * Updating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\n * @returns {never}\n */\nexport function state_unsafe_mutation() {\n\tif (DEV) {\n\t\tconst error = new Error(`state_unsafe_mutation\\nUpdating state inside \\`$derived(...)\\`, \\`$inspect(...)\\` or a template expression is forbidden. If the value should not be reactive, declare it without \\`$state\\`\\nhttps://svelte.dev/e/state_unsafe_mutation`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/state_unsafe_mutation`);\n\t}\n}\n\n/**\n * A `` `reset` function cannot be called while an error is still being handled\n * @returns {never}\n */\nexport function svelte_boundary_reset_onerror() {\n\tif (DEV) {\n\t\tconst error = new Error(`svelte_boundary_reset_onerror\\nA \\`\\` \\`reset\\` function cannot be called while an error is still being handled\\nhttps://svelte.dev/e/svelte_boundary_reset_onerror`);\n\n\t\terror.name = 'Svelte error';\n\n\t\tthrow error;\n\t} else {\n\t\tthrow new Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`);\n\t}\n}","/** True if experimental.async=true */\nexport let async_mode_flag = false;\n/** True if we're not certain that we only have Svelte 5 code in the compilation */\nexport let legacy_mode_flag = false;\n/** True if $inspect.trace is used */\nexport let tracing_mode_flag = false;\n\nexport function enable_async_mode_flag() {\n\tasync_mode_flag = true;\n}\n\n/** ONLY USE THIS DURING TESTING */\nexport function disable_async_mode_flag() {\n\tasync_mode_flag = false;\n}\n\nexport function enable_legacy_mode_flag() {\n\tlegacy_mode_flag = true;\n}\n\nexport function enable_tracing_mode_flag() {\n\ttracing_mode_flag = true;\n}\n","/** @import { Derived, Reaction, Value } from '#client' */\nimport { UNINITIALIZED } from '../../../constants.js';\nimport { snapshot } from '../../shared/clone.js';\nimport { DERIVED, ASYNC, PROXY_PATH_SYMBOL, STATE_SYMBOL } from '#client/constants';\nimport { effect_tracking } from '../reactivity/effects.js';\nimport { active_reaction, untrack } from '../runtime.js';\n\n/**\n * @typedef {{\n * traces: Error[];\n * }} TraceEntry\n */\n\n/** @type {{ reaction: Reaction | null, entries: Map } | null} */\nexport let tracing_expressions = null;\n\n/**\n * @param {Value} signal\n * @param {TraceEntry} [entry]\n */\nfunction log_entry(signal, entry) {\n\tconst value = signal.v;\n\n\tif (value === UNINITIALIZED) {\n\t\treturn;\n\t}\n\n\tconst type = get_type(signal);\n\tconst current_reaction = /** @type {Reaction} */ (active_reaction);\n\tconst dirty = signal.wv > current_reaction.wv || current_reaction.wv === 0;\n\tconst style = dirty\n\t\t? 'color: CornflowerBlue; font-weight: bold'\n\t\t: 'color: grey; font-weight: normal';\n\n\t// eslint-disable-next-line no-console\n\tconsole.groupCollapsed(\n\t\tsignal.label ? `%c${type}%c ${signal.label}` : `%c${type}%c`,\n\t\tstyle,\n\t\tdirty ? 'font-weight: normal' : style,\n\t\ttypeof value === 'object' && value !== null && STATE_SYMBOL in value\n\t\t\t? snapshot(value, true)\n\t\t\t: value\n\t);\n\n\tif (type === '$derived') {\n\t\tconst deps = new Set(/** @type {Derived} */ (signal).deps);\n\t\tfor (const dep of deps) {\n\t\t\tlog_entry(dep);\n\t\t}\n\t}\n\n\tif (signal.created) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(signal.created);\n\t}\n\n\tif (dirty && signal.updated) {\n\t\tfor (const updated of signal.updated.values()) {\n\t\t\tif (updated.error) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log(updated.error);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (entry) {\n\t\tfor (var trace of entry.traces) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.log(trace);\n\t\t}\n\t}\n\n\t// eslint-disable-next-line no-console\n\tconsole.groupEnd();\n}\n\n/**\n * @param {Value} signal\n * @returns {'$state' | '$derived' | 'store'}\n */\nfunction get_type(signal) {\n\tif ((signal.f & (DERIVED | ASYNC)) !== 0) return '$derived';\n\treturn signal.label?.startsWith('$') ? 'store' : '$state';\n}\n\n/**\n * @template T\n * @param {() => string} label\n * @param {() => T} fn\n */\nexport function trace(label, fn) {\n\tvar previously_tracing_expressions = tracing_expressions;\n\n\ttry {\n\t\ttracing_expressions = { entries: new Map(), reaction: active_reaction };\n\n\t\tvar start = performance.now();\n\t\tvar value = fn();\n\t\tvar time = (performance.now() - start).toFixed(2);\n\n\t\tvar prefix = untrack(label);\n\n\t\tif (!effect_tracking()) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.log(`${prefix} %cran outside of an effect (${time}ms)`, 'color: grey');\n\t\t} else if (tracing_expressions.entries.size === 0) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.log(`${prefix} %cno reactive dependencies (${time}ms)`, 'color: grey');\n\t\t} else {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.group(`${prefix} %c(${time}ms)`, 'color: grey');\n\n\t\t\tvar entries = tracing_expressions.entries;\n\n\t\t\tuntrack(() => {\n\t\t\t\tfor (const [signal, traces] of entries) {\n\t\t\t\t\tlog_entry(signal, traces);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\ttracing_expressions = null;\n\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.groupEnd();\n\t\t}\n\n\t\treturn value;\n\t} finally {\n\t\ttracing_expressions = previously_tracing_expressions;\n\t}\n}\n\n/**\n * @template {Value} T\n * @param {T} source\n * @param {string} label\n * @returns {T}\n */\nexport function tag(source, label) {\n\tsource.label = label;\n\ttag_proxy(source.v, label);\n\n\treturn source;\n}\n\n/**\n * @param {unknown} value\n * @param {string} label\n */\nexport function tag_proxy(value, label) {\n\t// @ts-expect-error\n\tvalue?.[PROXY_PATH_SYMBOL]?.(label);\n\treturn value;\n}\n\n/**\n * @param {unknown} value\n */\nexport function label(value) {\n\tif (typeof value === 'symbol') return `Symbol(${value.description})`;\n\tif (typeof value === 'function') return '';\n\tif (typeof value === 'object' && value) return '';\n\treturn String(value);\n}\n","import { DEV } from 'esm-env';\nimport { define_property } from './utils.js';\nimport * as e from './errors.js';\n\n/**\n * @param {string} label\n * @returns {Error & { stack: string } | null}\n */\nexport function get_error(label) {\n\tconst error = new Error();\n\tconst stack = get_stack();\n\n\tif (stack.length === 0) {\n\t\treturn null;\n\t}\n\n\tstack.unshift('\\n');\n\n\tdefine_property(error, 'stack', {\n\t\tvalue: stack.join('\\n')\n\t});\n\n\tdefine_property(error, 'name', {\n\t\tvalue: label\n\t});\n\n\treturn /** @type {Error & { stack: string }} */ (error);\n}\n\n/**\n * @returns {string[]}\n */\nexport function get_stack() {\n\t// @ts-ignore - doesn't exist everywhere\n\tconst limit = Error.stackTraceLimit;\n\t// @ts-ignore - doesn't exist everywhere\n\tError.stackTraceLimit = Infinity;\n\tconst stack = new Error().stack;\n\t// @ts-ignore - doesn't exist everywhere\n\tError.stackTraceLimit = limit;\n\n\tif (!stack) return [];\n\n\tconst lines = stack.split('\\n');\n\tconst new_lines = [];\n\n\tfor (let i = 0; i < lines.length; i++) {\n\t\tconst line = lines[i];\n\t\tconst posixified = line.replaceAll('\\\\', '/');\n\n\t\tif (line.trim() === 'Error') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (line.includes('validate_each_keys')) {\n\t\t\treturn [];\n\t\t}\n\n\t\tif (posixified.includes('svelte/src/internal') || posixified.includes('node_modules/.vite')) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tnew_lines.push(line);\n\t}\n\n\treturn new_lines;\n}\n\n/**\n * @param {boolean} condition\n * @param {string} message\n */\nexport function invariant(condition, message) {\n\tif (!DEV) {\n\t\tthrow new Error('invariant(...) was not guarded by if (DEV)');\n\t}\n\n\tif (!condition) e.invariant_violation(message);\n}\n","import { lifecycle_outside_component, missing_context } from './errors.js';\n\n/**\n * @template T\n * @param {(key: object) => T} get_context\n * @param {(key: object, context: T) => T} set_context\n * @param {(key: object) => boolean} has_context\n * @returns {[() => T, (context: T) => T, () => boolean]}\n */\nexport function create_context(get_context, set_context, has_context) {\n\tconst key = {};\n\n\treturn [\n\t\t() => {\n\t\t\tif (!has_context(key)) {\n\t\t\t\tmissing_context();\n\t\t\t}\n\n\t\t\treturn get_context(key);\n\t\t},\n\t\t(context) => set_context(key, context),\n\t\t() => has_context(key)\n\t];\n}\n\n/**\n * @typedef {{ p: Context | null, c: Map | null }} Context\n */\n\n/**\n * @param {Context} context\n * @returns {Map | null}\n */\nfunction get_parent_context(context) {\n\tlet parent = context.p;\n\twhile (parent !== null && parent.c === null) {\n\t\tparent = parent.p;\n\t}\n\treturn parent?.c ?? null;\n}\n\n/**\n * @param {Context | null} context\n * @param {string} name\n * @returns {Map}\n */\nexport function get_or_init_context_map(context, name) {\n\tif (context === null) {\n\t\tlifecycle_outside_component(name);\n\t}\n\n\treturn (context.c ??= new Map(get_parent_context(context) || undefined));\n}\n","/** @import { ComponentContext, DevStackEntry, Effect } from '#client' */\nimport { DEV } from 'esm-env';\nimport * as e from './errors.js';\nimport { active_effect, active_reaction } from './runtime.js';\nimport { create_user_effect } from './reactivity/effects.js';\nimport { async_mode_flag, legacy_mode_flag } from '../flags/index.js';\nimport { FILENAME } from '../../constants.js';\nimport { BRANCH_EFFECT, COMPONENT_SYMBOL } from './constants.js';\nimport { define_property } from '../shared/utils.js';\nimport { create_context, get_or_init_context_map } from '../shared/context.js';\n\n/** @type {ComponentContext | null} */\nexport let component_context = null;\n\n/** @param {ComponentContext | null} context */\nexport function set_component_context(context) {\n\tcomponent_context = context;\n}\n\n/** @type {DevStackEntry | null} */\nexport let dev_stack = null;\n\n/** @param {DevStackEntry | null} stack */\nexport function set_dev_stack(stack) {\n\tdev_stack = stack;\n}\n\n/**\n * Execute a callback with a new dev stack entry\n * @param {() => any} callback - Function to execute\n * @param {DevStackEntry['type']} type - Type of block/component\n * @param {any} component - Component function\n * @param {number} line - Line number\n * @param {number} column - Column number\n * @param {Record} [additional] - Any additional properties to add to the dev stack entry\n * @returns {any}\n */\nexport function add_svelte_meta(callback, type, component, line, column, additional) {\n\tconst parent = dev_stack;\n\n\tdev_stack = {\n\t\ttype,\n\t\tfile: component[FILENAME],\n\t\tline,\n\t\tcolumn,\n\t\tparent,\n\t\t...additional\n\t};\n\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tdev_stack = parent;\n\t}\n}\n\n/**\n * The current component function. Different from current component context:\n * ```html\n * \n * \n * \n * \n * ```\n * @type {ComponentContext['function']}\n */\nexport let dev_current_component_function = null;\n\n/** @param {ComponentContext['function']} fn */\nexport function set_dev_current_component_function(fn) {\n\tdev_current_component_function = fn;\n}\n\n/**\n * Returns a `[get, set, has]` triplet of functions for working with context in a type-safe way.\n *\n * `get` will throw an error if `set` has not yet been called in the current component or any of\n * its ancestors.\n *\n * @template T\n * @returns {[() => T, (context: T) => T, () => boolean]}\n * @since 5.40.0\n */\nexport function createContext() {\n\treturn /** @type {[() => T, (context: T) => T, () => boolean]} */ (\n\t\tcreate_context(getContext, setContext, hasContext)\n\t);\n}\n\n/**\n * Retrieves the context set with the specified `key` in the current component or any of its\n * ancestors. If multiple components set the same key, the value from the closest one is returned.\n * A `setContext` call in the current component is only visible to `getContext` calls that run after it.\n * Must be called during component initialisation.\n *\n * [`createContext`](https://svelte.dev/docs/svelte/svelte#createContext) is a type-safe alternative.\n *\n * @template T\n * @param {any} key\n * @returns {T}\n */\nexport function getContext(key) {\n\tconst context_map = get_or_init_context_map(component_context, 'getContext');\n\tconst result = /** @type {T} */ (context_map.get(key));\n\treturn result;\n}\n\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to the component itself and all of its\n * descendants (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * [`createContext`](https://svelte.dev/docs/svelte/svelte#createContext) is a type-safe alternative.\n *\n * @template T\n * @param {any} key\n * @param {T} context\n * @returns {T}\n */\nexport function setContext(key, context) {\n\tconst context_map = get_or_init_context_map(component_context, 'setContext');\n\n\tif (async_mode_flag) {\n\t\tvar flags = /** @type {Effect} */ (active_effect).f;\n\t\tvar valid =\n\t\t\t!active_reaction &&\n\t\t\t(flags & BRANCH_EFFECT) !== 0 &&\n\t\t\t// pop() runs synchronously, so this indicates we're setting context after an await\n\t\t\t!(/** @type {ComponentContext} */ (component_context).i);\n\n\t\tif (!valid) {\n\t\t\te.set_context_after_init();\n\t\t}\n\t}\n\n\tcontext_map.set(key, context);\n\treturn context;\n}\n\n/**\n * Checks whether a given `key` has been set in the context of the current component or any of\n * its ancestors. Must be called during component initialisation.\n *\n * @param {any} key\n * @returns {boolean}\n */\nexport function hasContext(key) {\n\tconst context_map = get_or_init_context_map(component_context, 'hasContext');\n\treturn context_map.has(key);\n}\n\n/**\n * Retrieves the whole context map that belongs to the current component, including entries\n * inherited from its ancestors. Must be called during component initialisation. Useful, for\n * example, if you programmatically create a component and want to pass the existing context to it.\n *\n * @template {Map} [T=Map]\n * @returns {T}\n */\nexport function getAllContexts() {\n\tconst context_map = get_or_init_context_map(component_context, 'getAllContexts');\n\treturn /** @type {T} */ (context_map);\n}\n\n/**\n * @param {Record} props\n * @param {any} runes\n * @param {Function} [fn]\n * @returns {void}\n */\nexport function push(props, runes = false, fn) {\n\tcomponent_context = {\n\t\tp: component_context,\n\t\ti: false,\n\t\tc: null,\n\t\te: null,\n\t\ts: props,\n\t\tx: null,\n\t\tr: /** @type {Effect} */ (active_effect),\n\t\tl: legacy_mode_flag && !runes ? { s: null, u: null, $: [] } : null\n\t};\n\n\tif (DEV) {\n\t\t// component function\n\t\tcomponent_context.function = fn;\n\t\tdev_current_component_function = fn;\n\t}\n}\n\n/**\n * @template {Record} T\n * @param {T} [component]\n * @returns {T}\n */\nexport function pop(component) {\n\tvar context = /** @type {ComponentContext} */ (component_context);\n\tvar effects = context.e;\n\n\tif (effects !== null) {\n\t\tcontext.e = null;\n\n\t\tfor (var fn of effects) {\n\t\t\tcreate_user_effect(fn);\n\t\t}\n\t}\n\n\tif (component !== undefined) {\n\t\tcontext.x = component;\n\t}\n\n\tcontext.i = true;\n\n\tcomponent_context = context.p;\n\n\tif (DEV) {\n\t\tdev_current_component_function = component_context?.function ?? null;\n\t}\n\n\treturn mark_as_component(component);\n}\n\n/**\n * Add a symbol to the object (or create one if undefined) to mark it as a component so it isn't proxified.\n * @param {any} component\n */\nexport function mark_as_component(component = {}) {\n\tdefine_property(component, COMPONENT_SYMBOL, { value: true });\n\treturn component;\n}\n\n/** @returns {boolean} */\nexport function is_runes() {\n\treturn !legacy_mode_flag || (component_context !== null && component_context.l === null);\n}\n","import { run_all } from '../../shared/utils.js';\nimport { is_flushing_sync } from '../reactivity/batch.js';\n\n/** @type {Array<() => void>} */\nlet micro_tasks = [];\n\nfunction run_micro_tasks() {\n\tvar tasks = micro_tasks;\n\tmicro_tasks = [];\n\trun_all(tasks);\n}\n\n/**\n * @param {() => void} fn\n */\nexport function queue_micro_task(fn) {\n\tif (micro_tasks.length === 0 && !is_flushing_sync) {\n\t\tvar tasks = micro_tasks;\n\t\tqueueMicrotask(() => {\n\t\t\t// If this is false, a flushSync happened in the meantime. Do _not_ run new scheduled microtasks in that case\n\t\t\t// as the ordering of microtasks would be broken at that point - consider this case:\n\t\t\t// - queue_micro_task schedules microtask A to flush task X\n\t\t\t// - synchronously after, flushSync runs, processing task X\n\t\t\t// - synchronously after, some other microtask B is scheduled, but not through queue_micro_task but for example a Promise.resolve() in user code\n\t\t\t// - synchronously after, queue_micro_task schedules microtask C to flush task Y\n\t\t\t// - one tick later, microtask A now resolves, flushing task Y before microtask B, which is incorrect\n\t\t\t// This if check prevents that race condition (that realistically will only happen in tests)\n\t\t\tif (tasks === micro_tasks) run_micro_tasks();\n\t\t});\n\t}\n\n\tmicro_tasks.push(fn);\n}\n\n/**\n * Synchronously run any queued tasks.\n */\nexport function flush_tasks() {\n\twhile (micro_tasks.length > 0) {\n\t\trun_micro_tasks();\n\t}\n}\n","/** @import { Derived, Signal } from '#client' */\nimport { CLEAN, CONNECTED, DIRTY, MAYBE_DIRTY } from '#client/constants';\n\nconst STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);\n\n/**\n * @param {Signal} signal\n * @param {number} status\n */\nexport function set_signal_status(signal, status) {\n\tsignal.f = (signal.f & STATUS_MASK) | status;\n}\n\n/**\n * Set a derived's status to CLEAN or MAYBE_DIRTY based on its connection state.\n * @param {Derived} derived\n */\nexport function update_derived_status(derived) {\n\t// Only mark as MAYBE_DIRTY if disconnected and has dependencies.\n\tif ((derived.f & CONNECTED) !== 0 || derived.deps === null) {\n\t\tset_signal_status(derived, CLEAN);\n\t} else {\n\t\tset_signal_status(derived, MAYBE_DIRTY);\n\t}\n}\n","/** @import { Effect } from '#client' */\nimport { CLEAN, DIRTY, MAYBE_DIRTY } from '#client/constants';\nimport { set_signal_status } from './status.js';\n\n/**\n * @param {Effect} effect\n * @param {Set} dirty_effects\n * @param {Set} maybe_dirty_effects\n */\nexport function defer_effect(effect, dirty_effects, maybe_dirty_effects) {\n\tif ((effect.f & DIRTY) !== 0) {\n\t\tdirty_effects.add(effect);\n\t} else if ((effect.f & MAYBE_DIRTY) !== 0) {\n\t\tmaybe_dirty_effects.add(effect);\n\t}\n\n\t// mark as clean so they get scheduled if they depend on pending async state\n\tset_signal_status(effect, CLEAN);\n}\n","import { hydrating } from '../hydration.js';\nimport { clear_text_content, get_first_child } from '../operations.js';\nimport { queue_micro_task } from '../task.js';\nimport { FORM_RESET_HANDLER } from '../../constants.js';\n\n/**\n * @param {HTMLElement} dom\n * @param {boolean} value\n * @returns {void}\n */\nexport function autofocus(dom, value) {\n\tif (value) {\n\t\tconst body = document.body;\n\t\tdom.autofocus = true;\n\n\t\tqueue_micro_task(() => {\n\t\t\tif (document.activeElement === body) {\n\t\t\t\tdom.focus();\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * The child of a textarea actually corresponds to the defaultValue property, so we need\n * to remove it upon hydration to avoid a bug when someone resets the form value.\n * @param {HTMLTextAreaElement} dom\n * @returns {void}\n */\nexport function remove_textarea_child(dom) {\n\tif (hydrating && get_first_child(dom) !== null) {\n\t\tclear_text_content(dom);\n\t}\n}\n\nlet listening_to_form_reset = false;\n\nexport function add_form_reset_listener() {\n\tif (!listening_to_form_reset) {\n\t\tlistening_to_form_reset = true;\n\t\tdocument.addEventListener(\n\t\t\t'reset',\n\t\t\t(evt) => {\n\t\t\t\t// Needs to happen one tick later or else the dom properties of the form\n\t\t\t\t// elements have not updated to their reset values yet\n\t\t\t\tPromise.resolve().then(() => {\n\t\t\t\t\tif (!evt.defaultPrevented) {\n\t\t\t\t\t\tfor (const e of /**@type {HTMLFormElement} */ (evt.target).elements) {\n\t\t\t\t\t\t\t/** @type {any} */ (e)[FORM_RESET_HANDLER]?.();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t// In the capture phase to guarantee we get noticed of it (no possibility of stopPropagation)\n\t\t\t{ capture: true }\n\t\t);\n\t}\n}\n","import { teardown } from '../../../reactivity/effects.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../../runtime.js';\nimport { FORM_RESET_HANDLER } from '../../../constants.js';\nimport { add_form_reset_listener } from '../misc.js';\n\n/**\n * Fires the handler once immediately (unless corresponding arg is set to `false`),\n * then listens to the given events until the render effect context is destroyed\n * @param {EventTarget} target\n * @param {Array} events\n * @param {(event?: Event) => void} handler\n * @param {any} call_handler_immediately\n */\nexport function listen(target, events, handler, call_handler_immediately = true) {\n\tif (call_handler_immediately) {\n\t\thandler();\n\t}\n\n\tfor (var name of events) {\n\t\ttarget.addEventListener(name, handler);\n\t}\n\n\tteardown(() => {\n\t\tfor (var name of events) {\n\t\t\ttarget.removeEventListener(name, handler);\n\t\t}\n\t});\n}\n\n/**\n * @template T\n * @param {() => T} fn\n */\nexport function without_reactive_context(fn) {\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\ttry {\n\t\treturn fn();\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * Listen to the given event, and then instantiate a global form reset listener if not already done,\n * to notify all bindings when the form is reset\n * @param {HTMLElement} element\n * @param {string} event\n * @param {(is_reset?: true) => void} handler\n * @param {(is_reset?: true) => void} [on_reset]\n */\nexport function listen_to_event_and_reset_event(element, event, handler, on_reset = handler) {\n\telement.addEventListener(event, () => without_reactive_context(handler));\n\tconst prev = /** @type {any} */ (element)[FORM_RESET_HANDLER];\n\tif (prev) {\n\t\t// special case for checkbox that can have multiple binds (group & checked)\n\t\t/** @type {any} */ (element)[FORM_RESET_HANDLER] = () => {\n\t\t\tprev();\n\t\t\ton_reset(true);\n\t\t};\n\t} else {\n\t\t/** @type {any} */ (element)[FORM_RESET_HANDLER] = () => on_reset(true);\n\t}\n\n\tadd_form_reset_listener();\n}\n","/** @import { Blocker, Effect, Source, Value } from '#client' */\nimport { DESTROYED, STALE_REACTION } from '#client/constants';\nimport { DEV } from 'esm-env';\nimport {\n\tcomponent_context,\n\tdev_stack,\n\tis_runes,\n\tset_component_context,\n\tset_dev_stack\n} from '../context.js';\nimport { invoke_error_boundary } from '../error-handling.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../runtime.js';\nimport { Batch, current_batch } from './batch.js';\nimport {\n\tasync_derived,\n\treactivity_loss_tracker,\n\tderived,\n\tderived_safe_equal,\n\tset_reactivity_loss_tracker\n} from './deriveds.js';\nimport { aborted } from './effects.js';\n\n/**\n * @param {Blocker[]} blockers\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise>} async\n * @param {(values: Value[]) => any} fn\n */\nexport function flatten(blockers, sync, async, fn) {\n\tconst d = is_runes() ? derived : derived_safe_equal;\n\n\t// Filter out already-settled blockers - no need to wait for them\n\tvar pending = blockers.filter((b) => !b.settled);\n\n\tvar deriveds = sync.map(d);\n\n\tif (DEV) {\n\t\tderiveds.forEach((d, i) => {\n\t\t\t// TODO this is kinda useful for debugging but a lousy implementation โ€”\n\t\t\t// maybe the compiler could pass through the template string\n\t\t\td.label = sync[i]\n\t\t\t\t.toString()\n\t\t\t\t.replace('() => ', '')\n\t\t\t\t.replaceAll('$.eager(() => ', '$state.eager(')\n\t\t\t\t.replace(/\\$\\.get\\((.+?)\\)/g, (_, id) => id);\n\t\t});\n\t}\n\n\tif (async.length === 0 && pending.length === 0) {\n\t\tfn(deriveds);\n\t\treturn;\n\t}\n\n\tvar parent = /** @type {Effect} */ (active_effect);\n\n\tvar restore = capture();\n\tvar blocker_promise =\n\t\tpending.length === 1\n\t\t\t? pending[0].promise\n\t\t\t: pending.length > 1\n\t\t\t\t? Promise.all(pending.map((b) => b.promise))\n\t\t\t\t: null;\n\n\t/**\n\t * @param {Source[]} async\n\t */\n\tfunction finish(async) {\n\t\tif ((parent.f & DESTROYED) !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\trestore();\n\n\t\ttry {\n\t\t\tfn([...deriveds, ...async]);\n\t\t} catch (error) {\n\t\t\tinvoke_error_boundary(error, parent);\n\t\t}\n\n\t\tunset_context();\n\t}\n\n\tvar decrement_pending = increment_pending();\n\n\t// Fast path: blockers but no async expressions\n\tif (async.length === 0) {\n\t\t/** @type {Promise} */ (blocker_promise).then(() => finish([])).finally(decrement_pending);\n\t\treturn;\n\t}\n\n\t// Full path: has async expressions\n\tfunction run() {\n\t\tPromise.all(async.map((expression) => async_derived(expression)))\n\t\t\t.then(finish)\n\t\t\t.catch((error) => invoke_error_boundary(error, parent))\n\t\t\t.finally(decrement_pending);\n\t}\n\n\tif (blocker_promise) {\n\t\tblocker_promise.then(() => {\n\t\t\tif ((parent.f & DESTROYED) !== 0) {\n\t\t\t\tdecrement_pending();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\trestore();\n\t\t\trun();\n\t\t\tunset_context();\n\t\t});\n\t} else {\n\t\trun();\n\t}\n}\n\n/**\n * @param {Blocker[]} blockers\n * @param {(values: Value[]) => any} fn\n */\nexport function run_after_blockers(blockers, fn) {\n\tflatten(blockers, [], [], fn);\n}\n\n/**\n * Captures the current effect context so that we can restore it after\n * some asynchronous work has happened (so that e.g. `await a + b`\n * causes `b` to be registered as a dependency).\n */\nexport function capture() {\n\tvar previous_effect = /** @type {Effect} */ (active_effect);\n\tvar previous_reaction = active_reaction;\n\tvar previous_component_context = component_context;\n\tvar previous_batch = /** @type {Batch} */ (current_batch);\n\n\tif (DEV) {\n\t\tvar previous_dev_stack = dev_stack;\n\t}\n\n\treturn function restore(activate_batch = true) {\n\t\tset_active_effect(previous_effect);\n\t\tset_active_reaction(previous_reaction);\n\t\tset_component_context(previous_component_context);\n\n\t\tif (activate_batch && (previous_effect.f & DESTROYED) === 0) {\n\t\t\t// TODO we only need optional chaining here because `{#await ...}` blocks\n\t\t\t// are anomalous. Once we retire them we can get rid of it\n\t\t\tprevious_batch?.activate();\n\t\t\tprevious_batch?.apply();\n\t\t}\n\n\t\tif (DEV) {\n\t\t\tset_reactivity_loss_tracker(null);\n\t\t\tset_dev_stack(previous_dev_stack);\n\t\t}\n\t};\n}\n\n/** `true` between a `save` thunk restoring a context and the end of that synchronous segment */\nvar restored = false;\n\n/**\n * Wraps an `await` expression in such a way that the effect context that was\n * active before the expression evaluated can be reapplied afterwards โ€”\n * `await a + b` becomes `(await $.save(a))() + b`\n * @template T\n * @param {Promise} promise\n * @returns {Promise<() => T>}\n */\nexport async function save(promise) {\n\tvar restore = capture();\n\t// the context restored by an earlier `save` in this expression must not\n\t// outlive the synchronous segment that is about to end at this `await`\n\tunsave();\n\tvar value = await promise;\n\n\treturn () => {\n\t\trestore();\n\t\trestored = true;\n\t\treturn value;\n\t};\n}\n\n/**\n * Unset the context if a `save` thunk restored it in the current synchronous segment,\n * so that a foreign microtask can never run inside a restored reaction context.\n * Called at every suspension point, and at the end of async expression bodies โ€”\n * `async () => (await $.save(a))().b` becomes `async () => { try { return (await $.save(a))().b; } finally { $.unsave(); } }`\n * @template T\n * @param {T} [value]\n * @returns {T}\n */\nexport function unsave(value) {\n\tif (restored) unset_context();\n\treturn /** @type {T} */ (value);\n}\n\n/**\n * Reset `current_async_effect` after the `promise` resolves, so\n * that we can emit `await_reactivity_loss` warnings\n * @template T\n * @param {Promise} promise\n * @returns {Promise<() => T>}\n */\nexport async function track_reactivity_loss(promise) {\n\tunsave();\n\tvar previous_reactivity_loss_tracker = reactivity_loss_tracker;\n\t// Ensure that unrelated reads after an async operation is kicked off don't cause false positives\n\tqueueMicrotask(() => {\n\t\tif (reactivity_loss_tracker === previous_reactivity_loss_tracker) {\n\t\t\tset_reactivity_loss_tracker(null);\n\t\t}\n\t});\n\n\tvar value = await promise;\n\n\treturn () => {\n\t\tset_reactivity_loss_tracker(previous_reactivity_loss_tracker);\n\t\t// While this can result in false negatives it also guards against the more important\n\t\t// false positives that would occur if this is the last in a chain of async operations,\n\t\t// and the reactivity_loss_tracker would then stay around until the next async operation happens.\n\t\tqueueMicrotask(() => {\n\t\t\tif (reactivity_loss_tracker === previous_reactivity_loss_tracker) {\n\t\t\t\tset_reactivity_loss_tracker(null);\n\t\t\t}\n\t\t});\n\n\t\treturn value;\n\t};\n}\n\n/**\n * Used in `for await` loops in DEV, so\n * that we can emit `await_reactivity_loss` warnings\n * after each `async_iterator` result resolves and\n * after the `async_iterator` return resolves (if it runs)\n * @template T\n * @template TReturn\n * @param {Iterable | AsyncIterable} iterable\n * @returns {AsyncGenerator}\n */\nexport async function* for_await_track_reactivity_loss(iterable) {\n\t// This is based on the algorithms described in ECMA-262:\n\t// ForIn/OfBodyEvaluation\n\t// https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset\n\t// AsyncIteratorClose\n\t// https://tc39.es/ecma262/multipage/abstract-operations.html#sec-asynciteratorclose\n\n\t/** @type {AsyncIterator} */\n\t// @ts-ignore\n\tconst iterator = iterable[Symbol.asyncIterator]?.() ?? iterable[Symbol.iterator]?.();\n\n\tif (iterator === undefined) {\n\t\tthrow new TypeError('value is not async iterable');\n\t}\n\n\t// eslint-disable-next-line no-useless-assignment\n\tlet invoke_return = true;\n\n\ttry {\n\t\twhile (true) {\n\t\t\tconst { done, value } = (await track_reactivity_loss(iterator.next()))();\n\t\t\tif (done) {\n\t\t\t\tinvoke_return = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvar prev = reactivity_loss_tracker;\n\t\t\ttry {\n\t\t\t\tyield value;\n\t\t\t} catch (e) {\n\t\t\t\tset_reactivity_loss_tracker(prev);\n\t\t\t\t// If the yield throws, we need to call `return` but not return its value, instead rethrow\n\t\t\t\tif (iterator.return !== undefined) {\n\t\t\t\t\t(await track_reactivity_loss(iterator.return()))();\n\t\t\t\t}\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t\tset_reactivity_loss_tracker(prev);\n\t\t}\n\t} catch (error) {\n\t\tinvoke_return = false;\n\t\tthrow error;\n\t} finally {\n\t\t// If the iterator had an abrupt completion (break) and `return` is defined on the iterator, call it and return the value\n\t\tif (invoke_return && iterator.return !== undefined) {\n\t\t\t// eslint-disable-next-line no-unsafe-finally\n\t\t\treturn /** @type {TReturn} */ ((await track_reactivity_loss(iterator.return()))().value);\n\t\t}\n\t}\n}\n\nexport function unset_context(deactivate_batch = true) {\n\trestored = false;\n\tset_active_effect(null);\n\tset_active_reaction(null);\n\tset_component_context(null);\n\tif (deactivate_batch) current_batch?.deactivate();\n\n\tif (DEV) {\n\t\tset_reactivity_loss_tracker(null);\n\t\tset_dev_stack(null);\n\t}\n}\n\n/**\n * @param {Array<() => void | Promise>} thunks\n */\nexport function run(thunks) {\n\tconst restore = capture();\n\n\tconst decrement_pending = increment_pending();\n\n\tvar active = /** @type {Effect} */ (active_effect);\n\n\t/** @type {null | { error: any }} */\n\tvar errored = null;\n\n\t/** @param {any} error */\n\tconst handle_error = (error) => {\n\t\terrored = { error }; // wrap in object in case a promise rejects with a falsy value\n\n\t\tif (!aborted(active)) {\n\t\t\tinvoke_error_boundary(error, active);\n\t\t}\n\t};\n\n\tvar promise = Promise.resolve(thunks[0]()).catch(handle_error);\n\n\t/** @type {Blocker} */\n\tvar blocker = { promise, settled: false };\n\tvar blockers = [blocker];\n\n\tpromise.finally(() => {\n\t\tblocker.settled = true;\n\t\tunset_context();\n\t});\n\n\tfor (const fn of thunks.slice(1)) {\n\t\tpromise = promise\n\t\t\t.then(() => {\n\t\t\t\trestore();\n\n\t\t\t\ttry {\n\t\t\t\t\tif (errored) {\n\t\t\t\t\t\tthrow errored.error;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (aborted(active)) {\n\t\t\t\t\t\tthrow STALE_REACTION;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn fn();\n\t\t\t\t} finally {\n\t\t\t\t\t// We gotta unset context directly in case the function returns a promise, in which case\n\t\t\t\t\t// unset_context in .finally() would be too late ...\n\t\t\t\t\tunset_context();\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(handle_error);\n\n\t\tconst blocker = { promise, settled: false };\n\t\tblockers.push(blocker);\n\n\t\tpromise.finally(() => {\n\t\t\tblocker.settled = true;\n\t\t\t// ... but we also need it after such a promise has resolved in case it restores our context\n\t\t\tunset_context();\n\t\t});\n\t}\n\n\tpromise\n\t\t// wait one more tick, so that template effects are\n\t\t// guaranteed to run before `$effect(...)`\n\t\t.then(() => Promise.resolve())\n\t\t.finally(decrement_pending);\n\n\treturn blockers;\n}\n\n/**\n * @param {Blocker[]} blockers\n */\nexport function wait(blockers) {\n\treturn Promise.all(blockers.map((b) => b.promise));\n}\n\n/**\n * @returns {(skip?: boolean) => void}\n */\nexport function increment_pending() {\n\tvar effect = /** @type {Effect} */ (active_effect);\n\tvar boundary = effect.b; // undefined if called outside the render tree, e.g. a standalone $effect.root\n\tvar batch = /** @type {Batch} */ (current_batch);\n\tvar blocking = !!boundary?.is_rendered();\n\n\tboundary?.update_pending_count(1, batch);\n\tbatch.increment(blocking, effect);\n\n\treturn () => {\n\t\tboundary?.update_pending_count(-1, batch);\n\t\tbatch.decrement(blocking, effect);\n\t};\n}\n","/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */\n/** @import { Batch } from './batch.js'; */\n/** @import { Boundary } from '../dom/blocks/boundary.js'; */\nimport { DEV } from 'esm-env';\nimport {\n\tERROR_VALUE,\n\tDERIVED,\n\tDIRTY,\n\tEFFECT_PRESERVED,\n\tSTALE_REACTION,\n\tASYNC,\n\tDESTROYED,\n\tCLEAN,\n\tREACTION_RAN,\n\tINERT\n} from '#client/constants';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tupdate_reaction,\n\tincrement_write_version,\n\tset_active_effect,\n\tpush_reaction_value,\n\tis_destroying_effect,\n\tupdate_effect,\n\tremove_reactions,\n\tskipped_deps,\n\tnew_deps\n} from '../runtime.js';\nimport { without_reactive_context } from '../dom/elements/bindings/shared.js';\nimport { equals, safe_equals } from './equality.js';\nimport * as e from '../errors.js';\nimport * as w from '../warnings.js';\nimport {\n\tasync_effect,\n\tdestroy_effect,\n\tdestroy_effect_children,\n\teffect_tracking,\n\tteardown\n} from './effects.js';\nimport { eager_effects, internal_set, set_eager_effects, source } from './sources.js';\nimport { get_error } from '../../shared/dev.js';\nimport { async_mode_flag, tracing_mode_flag } from '../../flags/index.js';\nimport { component_context } from '../context.js';\nimport { UNINITIALIZED } from '../../../constants.js';\nimport { batch_values, current_batch, previous_batch } from './batch.js';\nimport { increment_pending, unset_context } from './async.js';\nimport { deferred, includes, noop } from '../../shared/utils.js';\nimport { set_signal_status, update_derived_status } from './status.js';\n\n/**\n * This allows us to track 'reactivity loss' that occurs when signals\n * are read after a non-context-restoring `await`. Dev-only\n * @type {{ effect: Effect, effect_deps: Set, warned: boolean } | null}\n */\nexport let reactivity_loss_tracker = null;\n\n/** @param {{ effect: Effect, effect_deps: Set, warned: boolean } | null} v */\nexport function set_reactivity_loss_tracker(v) {\n\treactivity_loss_tracker = v;\n}\n\nexport const recent_async_deriveds = new Set();\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived(fn) {\n\tvar flags = DERIVED | DIRTY;\n\n\tif (active_effect !== null) {\n\t\t// Since deriveds are evaluated lazily, any effects created inside them are\n\t\t// created too late to ensure that the parent effect is added to the tree\n\t\tactive_effect.f |= EFFECT_PRESERVED;\n\t}\n\n\t/** @type {Derived} */\n\tconst signal = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\teffects: null,\n\t\tequals,\n\t\tf: flags,\n\t\tfn,\n\t\treactions: null,\n\t\trv: 0,\n\t\tv: /** @type {V} */ (UNINITIALIZED),\n\t\twv: 0,\n\t\tparent: active_effect,\n\t\tac: null\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = get_error('created at');\n\t}\n\n\treturn signal;\n}\n\nexport const OBSOLETE = Symbol('obsolete');\n\n/**\n * @template V\n * @param {() => V | Promise} fn\n * @param {string} [label]\n * @param {string} [location] If provided, print a warning if the value is not read immediately after update\n * @returns {Promise>}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function async_derived(fn, label, location) {\n\tlet parent = /** @type {Effect | null} */ (active_effect);\n\n\tif (parent === null) {\n\t\te.async_derived_orphan();\n\t}\n\n\tvar promise = /** @type {Promise} */ (/** @type {unknown} */ (undefined));\n\tvar signal = source(/** @type {V} */ (UNINITIALIZED));\n\n\tif (DEV) signal.label = label ?? fn.toString();\n\n\t// only suspend in async deriveds created on initialisation\n\tvar should_suspend = !active_reaction;\n\n\t/** @type {Set>>} */\n\tvar deferreds = new Set();\n\n\tasync_effect(() => {\n\t\tvar effect = /** @type {Effect} */ (active_effect);\n\n\t\tif (DEV) {\n\t\t\treactivity_loss_tracker = { effect, effect_deps: new Set(), warned: false };\n\t\t}\n\n\t\t/** @type {ReturnType>} */\n\t\tvar d = deferred();\n\t\tpromise = d.promise;\n\n\t\ttry {\n\t\t\t// If this code is changed at some point, make sure to still access the then property\n\t\t\t// of fn() to read any signals it might access, so that we track them as dependencies.\n\t\t\t// We call `unset_context` to undo any `save` calls that happen inside `fn()`\n\t\t\tPromise.resolve(fn())\n\t\t\t\t.then(d.resolve, (e) => {\n\t\t\t\t\t// if the promise was rejected by the user, via `getAbortSignal`, then\n\t\t\t\t\t// wait for a subsequent resolution instead of flushing the batch\n\t\t\t\t\tif (e !== STALE_REACTION) d.reject(e);\n\t\t\t\t})\n\t\t\t\t.finally(unset_context);\n\t\t} catch (error) {\n\t\t\td.reject(error);\n\t\t\tunset_context();\n\t\t}\n\n\t\tif (DEV) {\n\t\t\tif (reactivity_loss_tracker) {\n\t\t\t\t// Reused deps from previous run (indices 0 to skipped_deps-1)\n\t\t\t\t// We deliberately only track direct dependencies of the async expression to encourage\n\t\t\t\t// dependencies being directly visible at the point of the expression\n\t\t\t\tif (effect.deps !== null) {\n\t\t\t\t\tfor (let i = 0; i < skipped_deps; i += 1) {\n\t\t\t\t\t\treactivity_loss_tracker.effect_deps.add(effect.deps[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// New deps discovered this run\n\t\t\t\tif (new_deps !== null) {\n\t\t\t\t\tfor (let i = 0; i < new_deps.length; i += 1) {\n\t\t\t\t\t\treactivity_loss_tracker.effect_deps.add(new_deps[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treactivity_loss_tracker = null;\n\t\t}\n\n\t\tvar batch = /** @type {Batch} */ (current_batch);\n\n\t\tif (should_suspend) {\n\t\t\t// we only increment the batch's pending state for updates, not creation, otherwise\n\t\t\t// we will decrement to zero before the work that depends on this promise (e.g. a\n\t\t\t// template effect) has initialized, causing the batch to resolve prematurely\n\t\t\tif ((effect.f & REACTION_RAN) !== 0) {\n\t\t\t\tvar decrement_pending = increment_pending();\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t// boundary can be null if the async derived is inside an $effect.root not connected to the component render tree\n\t\t\t\tparent.b?.is_rendered()\n\t\t\t) {\n\t\t\t\tbatch.async_deriveds.get(effect)?.reject(OBSOLETE);\n\t\t\t} else {\n\t\t\t\t// While the boundary is still showing pending, a new run supersedes all older in-flight runs\n\t\t\t\t// for this async expression. Cancel eagerly so resolution cannot commit stale values.\n\t\t\t\tfor (const d of deferreds.values()) {\n\t\t\t\t\td.reject(OBSOLETE);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdeferreds.add(d);\n\t\t\tbatch.async_deriveds.set(effect, d);\n\t\t}\n\n\t\t/**\n\t\t * @param {any} value\n\t\t * @param {unknown} error\n\t\t */\n\t\tconst handler = (value, error = undefined) => {\n\t\t\tif (DEV) {\n\t\t\t\treactivity_loss_tracker = null;\n\t\t\t}\n\n\t\t\tdecrement_pending?.();\n\t\t\tdeferreds.delete(d);\n\n\t\t\tif (error === OBSOLETE) return;\n\n\t\t\tbatch.activate();\n\n\t\t\tif (error) {\n\t\t\t\tsignal.f |= ERROR_VALUE;\n\n\t\t\t\t// @ts-expect-error the error is the wrong type, but we don't care\n\t\t\t\tinternal_set(signal, error);\n\t\t\t} else {\n\t\t\t\tif ((signal.f & ERROR_VALUE) !== 0) {\n\t\t\t\t\tsignal.f ^= ERROR_VALUE;\n\t\t\t\t}\n\n\t\t\t\tif (DEV && location !== undefined && !signal.equals(value)) {\n\t\t\t\t\trecent_async_deriveds.add(signal);\n\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tif (recent_async_deriveds.has(signal) && (effect.f & DESTROYED) === 0) {\n\t\t\t\t\t\t\tw.await_waterfall(/** @type {string} */ (signal.label), location);\n\t\t\t\t\t\t\trecent_async_deriveds.delete(signal);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tinternal_set(signal, value);\n\t\t\t}\n\n\t\t\tbatch.deactivate();\n\t\t};\n\n\t\td.promise.then(handler, (e) => handler(null, e || 'unknown'));\n\t});\n\n\tteardown(() => {\n\t\tfor (const d of deferreds) {\n\t\t\td.reject(OBSOLETE);\n\t\t}\n\t});\n\n\tif (DEV) {\n\t\t// add a flag that lets this be printed as a derived\n\t\t// when using `$inspect.trace()`\n\t\tsignal.f |= ASYNC;\n\t}\n\n\treturn new Promise((fulfil) => {\n\t\t/** @param {Promise} p */\n\t\tfunction next(p) {\n\t\t\tfunction go() {\n\t\t\t\tif (p === promise) {\n\t\t\t\t\tfulfil(signal);\n\t\t\t\t} else {\n\t\t\t\t\t// if the effect re-runs before the initial promise\n\t\t\t\t\t// resolves, delay resolution until we have a value\n\t\t\t\t\tnext(promise);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tp.then(go, go);\n\t\t}\n\n\t\tnext(promise);\n\t});\n}\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function user_derived(fn) {\n\tconst d = derived(fn);\n\n\tif (!async_mode_flag) push_reaction_value(d);\n\n\treturn d;\n}\n\n/**\n * @template V\n * @param {() => V} fn\n * @returns {Derived}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function derived_safe_equal(fn) {\n\tconst signal = derived(fn);\n\tsignal.equals = safe_equals;\n\treturn signal;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function destroy_derived_effects(derived) {\n\tvar effects = derived.effects;\n\n\tif (effects !== null) {\n\t\tderived.effects = null;\n\n\t\tfor (var i = 0; i < effects.length; i += 1) {\n\t\t\tdestroy_effect(/** @type {Effect} */ (effects[i]));\n\t\t}\n\t}\n}\n\n/**\n * The currently updating deriveds, used to detect infinite recursion\n * in dev mode and provide a nicer error than 'too much recursion'\n * @type {Derived[]}\n */\nlet stack = [];\n\n/**\n * @template T\n * @param {Derived} derived\n * @returns {T}\n */\nexport function execute_derived(derived) {\n\tvar value;\n\tvar prev_active_effect = active_effect;\n\tvar parent = derived.parent;\n\n\tif (\n\t\t!is_destroying_effect &&\n\t\tparent !== null &&\n\t\tderived.v !== UNINITIALIZED && // if it was never evaluated before, it's guaranteed to fail downstream, so we try to execute instead\n\t\t(parent.f & (DESTROYED | INERT)) !== 0\n\t) {\n\t\tw.derived_inert();\n\n\t\treturn derived.v;\n\t}\n\n\tset_active_effect(parent);\n\n\tif (DEV) {\n\t\tlet prev_eager_effects = eager_effects;\n\t\tset_eager_effects(new Set());\n\t\ttry {\n\t\t\tif (includes.call(stack, derived)) {\n\t\t\t\te.derived_references_self();\n\t\t\t}\n\n\t\t\tstack.push(derived);\n\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t\tset_eager_effects(prev_eager_effects);\n\t\t\tstack.pop();\n\t\t}\n\t} else {\n\t\ttry {\n\t\t\tdestroy_derived_effects(derived);\n\t\t\tvalue = update_reaction(derived);\n\t\t} finally {\n\t\t\tset_active_effect(prev_active_effect);\n\t\t}\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {Derived} derived\n * @returns {void}\n */\nexport function update_derived(derived) {\n\tvar value = execute_derived(derived);\n\n\tif (!derived.equals(value)) {\n\t\tderived.wv = increment_write_version();\n\n\t\t// in a fork, we don't update the underlying value, just `batch_values`.\n\t\t// the underlying value will be updated when the fork is committed.\n\t\t// otherwise, the next time we get here after a 'real world' state\n\t\t// change, `derived.equals` may incorrectly return `true`\n\t\tif (!current_batch?.is_fork || derived.deps === null) {\n\t\t\tif (current_batch !== null) {\n\t\t\t\t// We also write to previous_batch because if it exists, it is a sign that we're\n\t\t\t\t// currently in the process of flushing effects. These updates to deriveds may belong\n\t\t\t\t// to the previous batch, not the new one (which can already exist if an earlier\n\t\t\t\t// effect wrote to a source). This can cause bugs when running batch.#commit() later,\n\t\t\t\t// but not adding it to current_batch can, too, so we add it to both.\n\t\t\t\t// See https://github.com/sveltejs/svelte/pull/18117 for more details.\n\t\t\t\tcurrent_batch.capture(derived, value, true);\n\t\t\t\tprevious_batch?.capture(derived, value, true);\n\t\t\t} else {\n\t\t\t\tderived.v = value;\n\t\t\t}\n\n\t\t\t// deriveds without dependencies should never be recomputed\n\t\t\tif (derived.deps === null) {\n\t\t\t\tset_signal_status(derived, CLEAN);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\t// don't mark derived clean if we're reading it inside a\n\t// cleanup function, or it will cache a stale value\n\tif (is_destroying_effect) {\n\t\treturn;\n\t}\n\n\t// During time traveling we don't want to reset the status so that\n\t// traversal of the graph in the other batches still happens\n\tif (batch_values !== null) {\n\t\t// only cache the value if we're in a tracking context, otherwise we won't\n\t\t// clear the cache in `mark_reactions` when dependencies are updated\n\t\tif (effect_tracking() || current_batch?.is_fork) {\n\t\t\tbatch_values.set(derived, value);\n\t\t}\n\t} else {\n\t\tupdate_derived_status(derived);\n\t}\n}\n\n/**\n * @param {Derived} derived\n */\nexport function freeze_derived_effects(derived) {\n\tif (derived.effects === null) return;\n\n\tfor (const e of derived.effects) {\n\t\t// if the effect has a teardown function or abort signal, call it\n\t\tif (e.teardown || e.ac) {\n\t\t\te.teardown?.();\n\t\t\tif (e.ac !== null) {\n\t\t\t\twithout_reactive_context(() => {\n\t\t\t\t\t/** @type {AbortController} */ (e.ac).abort(STALE_REACTION);\n\t\t\t\t\te.ac = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// make it a noop so it doesn't get called again if the derived\n\t\t\t// is unfrozen. we don't set it to `null`, because the existence\n\t\t\t// of a teardown function is what determines whether the\n\t\t\t// effect runs again during unfreezing (but not for teardown-only effects)\n\t\t\tif (e.fn !== null) e.teardown = noop;\n\n\t\t\tremove_reactions(e, 0);\n\t\t\tdestroy_effect_children(e);\n\t\t}\n\t}\n}\n\n/**\n * @param {Derived} derived\n */\nexport function unfreeze_derived_effects(derived) {\n\tif (derived.effects === null) return;\n\n\tfor (const e of derived.effects) {\n\t\t// if the effect was previously frozen โ€” indicated by the presence\n\t\t// of a teardown function โ€” unfreeze it\n\t\tif (e.teardown && e.fn !== null) {\n\t\t\tupdate_effect(e);\n\t\t}\n\t}\n}\n","/** @import { Fork } from 'svelte' */\n/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */\nimport {\n\tBLOCK_EFFECT,\n\tBRANCH_EFFECT,\n\tCLEAN,\n\tDESTROYED,\n\tDIRTY,\n\tEFFECT,\n\tASYNC,\n\tINERT,\n\tRENDER_EFFECT,\n\tROOT_EFFECT,\n\tMAYBE_DIRTY,\n\tDERIVED,\n\tEAGER_EFFECT,\n\tERROR_VALUE,\n\tMANAGED_EFFECT,\n\tREACTION_RAN,\n\tDESTROYING\n} from '#client/constants';\nimport { async_mode_flag } from '../../flags/index.js';\nimport { deferred, define_property, includes } from '../../shared/utils.js';\nimport {\n\tactive_reaction,\n\tget,\n\tincrement_write_version,\n\tis_dirty,\n\tupdate_effect\n} from '../runtime.js';\nimport * as e from '../errors.js';\nimport { flush_tasks, queue_micro_task } from '../dom/task.js';\nimport { DEV } from 'esm-env';\nimport { invoke_error_boundary } from '../error-handling.js';\nimport { flush_eager_effects, old_values, set_eager_effects, source, update } from './sources.js';\nimport { eager_effect, teardown, unlink_effect } from './effects.js';\nimport { defer_effect } from './utils.js';\nimport { UNINITIALIZED } from '../../../constants.js';\nimport { set_signal_status } from './status.js';\nimport { invariant } from '../../shared/dev.js';\nimport { log_effect_tree } from '../dev/debug.js';\nimport { OBSOLETE } from './deriveds.js';\n\n/** @type {Batch | null} */\nlet first_batch = null;\n\n/** @type {Batch | null} */\nlet last_batch = null;\n\n/** @type {Batch | null} */\nexport let current_batch = null;\n\n/**\n * This is needed to avoid overwriting inputs\n * @type {Batch | null}\n */\nexport let previous_batch = null;\n\n/**\n * When time travelling (i.e. working in one batch, while other batches\n * still have ongoing work), we ignore the real values of affected\n * signals in favour of their values within the batch\n * @type {Map | null}\n */\nexport let batch_values = null;\n\n/** @type {Effect | null} */\nlet last_scheduled_effect = null;\n\nexport let is_flushing_sync = false;\nlet is_processing = false;\n\n/**\n * During traversal, this is an array. Newly created effects are (if not immediately\n * executed) pushed to this array, rather than going through the scheduling\n * rigamarole that would cause another turn of the flush loop.\n * @type {Effect[] | null}\n */\nexport let collected_effects = null;\n\n/**\n * An array of effects that are marked during traversal as a result of a `set`\n * (not `internal_set`) call. These will be added to the next batch and\n * trigger another `batch.process()`\n * @type {Effect[] | null}\n * @deprecated when we get rid of legacy mode and stores, we can get rid of this\n */\nexport let legacy_updates = null;\n\nvar flush_count = 0;\n\n/** @type {Set} */\nvar source_stacks = new Set();\n\nlet uid = 1;\n\nexport class Batch {\n\tid = uid++;\n\n\t/** True as soon as `#process` was called */\n\t#started = false;\n\n\tlinked = true;\n\n\t/** @type {Batch | null} */\n\t#prev = null;\n\n\t/** @type {Batch | null} */\n\t#next = null;\n\n\t/** @type {Map>>} */\n\tasync_deriveds = new Map();\n\n\t/**\n\t * The current values of any signals that are updated in this batch.\n\t * Tuple format: [value, is_derived] (note: is_derived is false for deriveds, too, if they were overridden via assignment)\n\t * They keys of this map are identical to `this.#previous`\n\t * @type {Map}\n\t */\n\tcurrent = new Map();\n\n\t/**\n\t * The values of any signals (sources and deriveds) that are updated in this batch _before_ those updates took place.\n\t * They keys of this map are identical to `this.#current`\n\t * @type {Map}\n\t */\n\tprevious = new Map();\n\n\t/**\n\t * When the batch is committed (and the DOM is updated), we need to remove old branches\n\t * and append new ones by calling the functions added inside (if/each/key/etc) blocks\n\t * @type {Set<(batch: Batch) => void>}\n\t */\n\t#commit_callbacks = new Set();\n\n\t/**\n\t * If a fork is discarded, we need to destroy any effects that are no longer needed\n\t * @type {Set<(batch: Batch) => void>}\n\t */\n\t#discard_callbacks = new Set();\n\n\t/**\n\t * The number of async effects that are currently in flight\n\t */\n\t#pending = 0;\n\n\t/**\n\t * Async effects that are currently in flight, _not_ inside a pending boundary\n\t * @type {Map}\n\t */\n\t#blocking_pending = new Map();\n\n\t/**\n\t * A deferred that resolves when the batch is committed, used with `settled()`\n\t * TODO replace with Promise.withResolvers once supported widely enough\n\t * @type {{ promise: Promise, resolve: (value?: any) => void, reject: (reason: unknown) => void } | null}\n\t */\n\t#deferred = null;\n\n\t/**\n\t * Effects that were scheduled in this batch but not yet 'resolved' into the\n\t * root effects that need to be flushed. Resolving โ€” the upwards traversal that\n\t * marks the path to each effect on the shared effect tree (see #resolve) โ€” is\n\t * deferred until the batch is processed, so that the markers are created and\n\t * consumed within a single traversal. Scheduling into other batches (which can\n\t * happen concurrently, e.g. while a batch is committed) can therefore never\n\t * observe (and be confused by) this batch's markers.\n\t * May contain duplicates โ€” deduplication happens during resolving\n\t * @type {Effect[]}\n\t */\n\t#scheduled = [];\n\n\t/**\n\t * Effects created while this batch was active.\n\t * @type {Effect[]}\n\t */\n\t#new_effects = [];\n\n\t/**\n\t * Deferred effects (which run after async work has completed) that are DIRTY\n\t * @type {Set}\n\t */\n\t#dirty_effects = new Set();\n\n\t/**\n\t * Deferred effects that are MAYBE_DIRTY\n\t * @type {Set}\n\t */\n\t#maybe_dirty_effects = new Set();\n\n\t/**\n\t * A map of branches that still exist, but will be destroyed when this batch\n\t * is committed โ€” we skip over these during `process`.\n\t * The value contains child effects that were dirty/maybe_dirty before being reset,\n\t * so they can be rescheduled if the branch survives.\n\t * @type {Map}\n\t */\n\t#skipped_branches = new Map();\n\n\t/**\n\t * Inverse of #skipped_branches which we need to tell prior batches to unskip them when committing\n\t * @type {Set}\n\t */\n\t#unskipped_branches = new Set();\n\n\tis_fork = false;\n\n\t#decrement_queued = false;\n\n\tconstructor() {\n\t\t// link batch\n\t\tif (last_batch === null) {\n\t\t\tfirst_batch = last_batch = this;\n\t\t} else {\n\t\t\tlast_batch.#next = this;\n\t\t\tthis.#prev = last_batch;\n\t\t}\n\n\t\tlast_batch = this;\n\t}\n\n\t#is_deferred() {\n\t\tif (this.is_fork) return true;\n\n\t\tfor (const effect of this.#blocking_pending.keys()) {\n\t\t\tvar e = effect;\n\t\t\tvar skipped = false;\n\n\t\t\twhile (e.parent !== null) {\n\t\t\t\tif (this.#skipped_branches.has(e)) {\n\t\t\t\t\tskipped = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\te = e.parent;\n\t\t\t}\n\n\t\t\tif (!skipped) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Add an effect to the #skipped_branches map and reset its children\n\t * @param {Effect} effect\n\t */\n\tskip_effect(effect) {\n\t\tif (!this.#skipped_branches.has(effect)) {\n\t\t\tthis.#skipped_branches.set(effect, { d: [], m: [] });\n\t\t}\n\t\tthis.#unskipped_branches.delete(effect);\n\t}\n\n\t/**\n\t * Remove an effect from the #skipped_branches map and reschedule\n\t * any tracked dirty/maybe_dirty child effects\n\t * @param {Effect} effect\n\t * @param {(e: Effect) => void} callback\n\t */\n\tunskip_effect(effect, callback = (e) => this.schedule(e)) {\n\t\tvar tracked = this.#skipped_branches.get(effect);\n\t\tif (tracked) {\n\t\t\tthis.#skipped_branches.delete(effect);\n\n\t\t\tfor (var e of tracked.d) {\n\t\t\t\tset_signal_status(e, DIRTY);\n\t\t\t\tcallback(e);\n\t\t\t}\n\n\t\t\tfor (e of tracked.m) {\n\t\t\t\tset_signal_status(e, MAYBE_DIRTY);\n\t\t\t\tcallback(e);\n\t\t\t}\n\t\t}\n\t\tthis.#unskipped_branches.add(effect);\n\t}\n\n\t/**\n\t * Convert the effects that were scheduled in this batch into the root effects\n\t * that need to be traversed, marking the path to each effect (by clearing the\n\t * `CLEAN` flag on ancestor branches) so that the traversal can find them.\n\t * This happens right before traversal rather than at scheduling time, so that\n\t * the markers left on the (shared) effect tree are created and consumed within\n\t * a single traversal โ€” scheduling into other batches can never observe them\n\t * @returns {Effect[]}\n\t */\n\t#resolve() {\n\t\t/** @type {Effect[]} */\n\t\tvar roots = [];\n\n\t\tfor (const effect of this.#scheduled) {\n\t\t\t// skip effects that are destroyed, or that already ran (e.g. because\n\t\t\t// they were reached by the traversal that preceded a drain iteration,\n\t\t\t// or because they were scheduled twice)\n\t\t\tif ((effect.f & DESTROYED) !== 0 || (effect.f & (DIRTY | MAYBE_DIRTY)) === 0) continue;\n\n\t\t\tvar e = effect;\n\t\t\tvar covered = false;\n\n\t\t\twhile (e.parent !== null) {\n\t\t\t\te = e.parent;\n\t\t\t\tvar flags = e.f;\n\n\t\t\t\tif ((flags & (ROOT_EFFECT | BRANCH_EFFECT)) !== 0) {\n\t\t\t\t\tif ((flags & CLEAN) === 0) {\n\t\t\t\t\t\t// the path to the root was already marked, meaning the\n\t\t\t\t\t\t// root was already collected โ€” nothing left to do\n\t\t\t\t\t\tcovered = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\te.f ^= CLEAN;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!covered) {\n\t\t\t\troots.push(e);\n\t\t\t}\n\t\t}\n\n\t\tthis.#scheduled = [];\n\n\t\treturn roots;\n\t}\n\n\t#process() {\n\t\tthis.#started = true;\n\n\t\tif (DEV) {\n\t\t\t// track all the values that were updated during this flush,\n\t\t\t// so that they can be reset afterwards\n\t\t\tfor (const value of this.current.keys()) {\n\t\t\t\tsource_stacks.add(value);\n\t\t\t}\n\t\t}\n\n\t\t// We always reschedule previously-deferred effects, not just when\n\t\t// #is_deferred() is true, because traversing the tree could make\n\t\t// an if block that contains the last blocking pending effect falsy,\n\t\t// causing the block to no longer be deferred.\n\t\tfor (const e of this.#dirty_effects) {\n\t\t\tthis.#maybe_dirty_effects.delete(e);\n\t\t\tset_signal_status(e, DIRTY);\n\t\t\tthis.schedule(e);\n\t\t}\n\n\t\tfor (const e of this.#maybe_dirty_effects) {\n\t\t\tset_signal_status(e, MAYBE_DIRTY);\n\t\t\tthis.schedule(e);\n\t\t}\n\n\t\tthis.apply();\n\n\t\t/** @type {Effect[]} */\n\t\tvar effects = (collected_effects = []);\n\n\t\t/** @type {Effect[]} */\n\t\tvar render_effects = [];\n\n\t\t/**\n\t\t * @type {Effect[]}\n\t\t * @deprecated when we get rid of legacy mode and stores, we can get rid of this\n\t\t */\n\t\tvar updates = (legacy_updates = []);\n\n\t\t// Effects can be scheduled during traversal (e.g. because a parent each/await/etc\n\t\t// block updated an internal source, or because an effect invalidated itself)\n\t\t// hence we loop until there are no more scheduled effects.\n\t\twhile (this.#scheduled.length > 0) {\n\t\t\tif (flush_count++ > 1000) {\n\t\t\t\tthis.#unlink();\n\t\t\t\tinfinite_loop_guard(); // TODO try to reset_all() here?\n\t\t\t}\n\n\t\t\tfor (const root of this.#resolve()) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.#traverse(root, effects, render_effects);\n\t\t\t\t} catch (e) {\n\t\t\t\t\treset_all(root);\n\t\t\t\t\t// If there's no async work left, this branch is now dead and needs\n\t\t\t\t\t// to be discarded to not become a zombie that is never cleaned up.\n\t\t\t\t\t// See https://github.com/sveltejs/svelte/issues/18221#issuecomment-4497918414\n\t\t\t\t\t// for a (non-minimal) reproduction that demonstrates a case where this is necessary\n\t\t\t\t\t// to not get follow-up false-positives via \"batch has scheduled roots\" invariant errors.\n\t\t\t\t\tif (!this.#is_deferred()) this.discard();\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// any writes should take effect in a subsequent batch\n\t\tcurrent_batch = null;\n\n\t\tif (updates.length > 0) {\n\t\t\tvar batch = Batch.ensure();\n\t\t\tfor (const e of updates) {\n\t\t\t\tbatch.schedule(e);\n\t\t\t}\n\t\t}\n\n\t\tcollected_effects = null;\n\t\tlegacy_updates = null;\n\n\t\t// if the batch has outstanding pending work, stash effects and bail\n\t\tif (this.#is_deferred()) {\n\t\t\tthis.#defer_effects(render_effects);\n\t\t\tthis.#defer_effects(effects);\n\n\t\t\tfor (const [e, t] of this.#skipped_branches) {\n\t\t\t\treset_branch(e, t);\n\t\t\t}\n\n\t\t\tif (updates.length > 0) {\n\t\t\t\t/** @type {Batch} */ (/** @type {unknown} */ (current_batch)).#process();\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst earlier_batch = this.#find_earlier_batch();\n\n\t\tif (earlier_batch) {\n\t\t\t// If this batch collected deferred effects during traversal, they still need\n\t\t\t// to run after being merged into the earlier batch.\n\t\t\tthis.#defer_effects(render_effects);\n\t\t\tthis.#defer_effects(effects);\n\t\t\tearlier_batch.#merge(this);\n\t\t\treturn;\n\t\t}\n\n\t\t// clear effects. Those that are still needed will be rescheduled through unskipping the skipped branches.\n\t\tthis.#dirty_effects.clear();\n\t\tthis.#maybe_dirty_effects.clear();\n\n\t\t// append/remove branches\n\t\tfor (const fn of this.#commit_callbacks) fn(this);\n\t\tthis.#commit_callbacks.clear();\n\n\t\tprevious_batch = this;\n\t\tflush_queued_effects(render_effects);\n\t\tflush_queued_effects(effects);\n\t\tprevious_batch = null;\n\n\t\tthis.#deferred?.resolve();\n\n\t\tvar next_batch = /** @type {Batch | null} */ (/** @type {unknown} */ (current_batch));\n\n\t\tif (this.#pending === 0 && (this.#scheduled.length === 0 || next_batch !== null)) {\n\t\t\tthis.#unlink();\n\n\t\t\t// Order matters here - we need to commit and THEN continue flushing new batches, not the other way around,\n\t\t\t// else we could start flushing a new batch and then, if it has pending work, rebase it right afterwards, which is wrong.\n\t\t\t// In sync mode flushSync can cause #commit to wrongfully think that there needs to be a rebase, so we only do it in async mode\n\t\t\t// TODO fix the underlying cause, otherwise this will likely regress when non-async mode is removed\n\t\t\tif (async_mode_flag) {\n\t\t\t\tthis.#commit();\n\t\t\t\t// Rebases can activate other batches or null it out, therefore restore the new one here\n\t\t\t\tcurrent_batch = next_batch;\n\t\t\t}\n\t\t}\n\n\t\t// Edge case: During traversal new branches might create effects that run immediately and set state,\n\t\t// causing an effect to be scheduled again. We need to traverse the current batch\n\t\t// once more in that case - most of the time this will just clean up dirty branches.\n\t\tif (this.#scheduled.length > 0) {\n\t\t\tif (next_batch !== null) {\n\t\t\t\tfor (const e of this.#scheduled) {\n\t\t\t\t\tnext_batch.#scheduled.push(e);\n\t\t\t\t}\n\n\t\t\t\tthis.#scheduled = [];\n\t\t\t} else {\n\t\t\t\tnext_batch = this;\n\t\t\t}\n\t\t}\n\n\t\tif (next_batch !== null) {\n\t\t\told_values.clear();\n\t\t\tnext_batch.#process();\n\t\t}\n\t}\n\n\t/**\n\t * Traverse the effect tree, executing effects or stashing\n\t * them for later execution as appropriate\n\t * @param {Effect} root\n\t * @param {Effect[]} effects\n\t * @param {Effect[]} render_effects\n\t */\n\t#traverse(root, effects, render_effects) {\n\t\troot.f ^= CLEAN;\n\n\t\tvar effect = root.first;\n\n\t\twhile (effect !== null) {\n\t\t\tvar flags = effect.f;\n\t\t\tvar is_branch = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) !== 0;\n\t\t\tvar is_skippable_branch = is_branch && (flags & CLEAN) !== 0;\n\n\t\t\tvar skip = is_skippable_branch || (flags & INERT) !== 0 || this.#skipped_branches.has(effect);\n\n\t\t\tif (!skip && effect.fn !== null) {\n\t\t\t\tif (is_branch) {\n\t\t\t\t\teffect.f ^= CLEAN;\n\t\t\t\t} else if ((flags & EFFECT) !== 0) {\n\t\t\t\t\teffects.push(effect);\n\t\t\t\t} else if (async_mode_flag && (flags & (RENDER_EFFECT | MANAGED_EFFECT)) !== 0) {\n\t\t\t\t\trender_effects.push(effect);\n\t\t\t\t} else if (is_dirty(effect)) {\n\t\t\t\t\tif ((flags & BLOCK_EFFECT) !== 0) this.#maybe_dirty_effects.add(effect);\n\t\t\t\t\tupdate_effect(effect);\n\t\t\t\t}\n\n\t\t\t\tvar child = effect.first;\n\n\t\t\t\tif (child !== null) {\n\t\t\t\t\teffect = child;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile (effect !== null) {\n\t\t\t\tvar next = effect.next;\n\n\t\t\t\tif (next !== null) {\n\t\t\t\t\teffect = next;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\teffect = effect.parent;\n\t\t\t}\n\t\t}\n\t}\n\n\t#find_earlier_batch() {\n\t\tvar batch = this.#prev;\n\n\t\twhile (batch !== null) {\n\t\t\tif (!batch.is_fork) {\n\t\t\t\t// if the batches are connected, break\n\t\t\t\tfor (const [value, [, is_derived]] of this.current) {\n\t\t\t\t\tif (batch.current.has(value) && !is_derived) {\n\t\t\t\t\t\treturn batch;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbatch = batch.#prev;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * @param {Batch} batch\n\t */\n\t#merge(batch) {\n\t\tfor (const [source, value] of batch.current) {\n\t\t\tif (!this.previous.has(source) && batch.previous.has(source)) {\n\t\t\t\tthis.previous.set(source, batch.previous.get(source));\n\t\t\t}\n\n\t\t\tthis.current.set(source, value);\n\t\t}\n\n\t\tfor (const [effect, deferred] of batch.async_deriveds) {\n\t\t\tconst d = this.async_deriveds.get(effect);\n\t\t\tif (d) deferred.promise.then(d.resolve).catch(d.reject);\n\t\t}\n\n\t\t// Clear them or else those that are still pending might get rejected on discard (after merged-into batch is done).\n\t\t// This can happen when batch Y merged into X and Y has a pending boundary and therefore still-pending async deriveds inside.\n\t\tbatch.async_deriveds.clear();\n\n\t\t// Mark is not guaranteed not touch these, so we transfer them\n\t\tthis.transfer_effects(batch.#dirty_effects, batch.#maybe_dirty_effects);\n\n\t\t/**\n\t\t * mark all effects that depend on `batch.current`, except the\n\t\t * async effects that we just resolved (TODO unless they depend\n\t\t * on values in this batch that are NOT in the later batch?).\n\t\t * Through this we also will populate the correct #skipped_branches,\n\t\t * oncommit callbacks etc, so we don't need to merge them separately.\n\t\t * @param {Value} value\n\t\t */\n\t\tconst mark = (value) => {\n\t\t\tvar reactions = value.reactions;\n\t\t\tif (reactions === null) return;\n\t\t\t// skip if value is derived and is neither dirty nor maybe dirty. transitive\n\t\t\t// deriveds (a derived depending on another derived) are only MAYBE_DIRTY, so\n\t\t\t// we must continue traversing them to reach the effects that depend on them\n\t\t\tif ((value.f & DERIVED) !== 0 && (value.f & (DIRTY | MAYBE_DIRTY)) === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (const reaction of reactions) {\n\t\t\t\tvar flags = reaction.f;\n\n\t\t\t\tif ((flags & DERIVED) !== 0) {\n\t\t\t\t\tmark(/** @type {Derived} */ (reaction));\n\t\t\t\t} else {\n\t\t\t\t\tvar effect = /** @type {Effect} */ (reaction);\n\n\t\t\t\t\tif (flags & (ASYNC | BLOCK_EFFECT) && !this.async_deriveds.has(effect)) {\n\t\t\t\t\t\tthis.#maybe_dirty_effects.delete(effect);\n\t\t\t\t\t\tset_signal_status(effect, DIRTY);\n\t\t\t\t\t\tthis.schedule(effect);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tfor (const source of this.current.keys()) {\n\t\t\tmark(source);\n\t\t}\n\n\t\tthis.oncommit(() => batch.discard());\n\t\tbatch.#unlink();\n\n\t\tcurrent_batch = this;\n\t\tthis.#process();\n\t}\n\n\t/**\n\t * @param {Effect[]} effects\n\t */\n\t#defer_effects(effects) {\n\t\tfor (var i = 0; i < effects.length; i += 1) {\n\t\t\tdefer_effect(effects[i], this.#dirty_effects, this.#maybe_dirty_effects);\n\t\t}\n\t}\n\n\t/**\n\t * Associate a change to a given source with the current\n\t * batch, noting its previous and current values\n\t * @param {Value} source\n\t * @param {any} value\n\t * @param {boolean} [is_derived]\n\t */\n\tcapture(source, value, is_derived = false) {\n\t\tif (source.v !== UNINITIALIZED && !this.previous.has(source)) {\n\t\t\tthis.previous.set(source, source.v);\n\t\t}\n\n\t\t// Don't save errors in `batch_values`, or they won't be thrown in `runtime.js#get`\n\t\tif ((source.f & ERROR_VALUE) === 0) {\n\t\t\tthis.current.set(source, [value, is_derived]);\n\t\t\tbatch_values?.set(source, value);\n\t\t}\n\n\t\tif (!this.is_fork) {\n\t\t\tsource.v = value;\n\t\t}\n\t}\n\n\tactivate() {\n\t\tcurrent_batch = this;\n\t}\n\n\tdeactivate() {\n\t\tcurrent_batch = null;\n\t\tbatch_values = null;\n\t}\n\n\tflush() {\n\t\ttry {\n\t\t\tif (DEV) {\n\t\t\t\tsource_stacks.clear();\n\t\t\t}\n\n\t\t\tis_processing = true;\n\t\t\tcurrent_batch = this;\n\n\t\t\tthis.#process();\n\t\t} finally {\n\t\t\tflush_count = 0;\n\t\t\tlast_scheduled_effect = null;\n\t\t\tcollected_effects = null;\n\t\t\tlegacy_updates = null;\n\t\t\tis_processing = false;\n\n\t\t\tcurrent_batch = null;\n\t\t\tbatch_values = null;\n\n\t\t\told_values.clear();\n\n\t\t\tif (DEV) {\n\t\t\t\tfor (const source of source_stacks) {\n\t\t\t\t\tsource.updated = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tdiscard() {\n\t\tfor (const fn of this.#discard_callbacks) fn(this);\n\t\tthis.#discard_callbacks.clear();\n\n\t\tfor (const deferred of this.async_deriveds.values()) {\n\t\t\tdeferred.reject(OBSOLETE);\n\t\t}\n\n\t\tthis.#unlink();\n\t\tthis.#deferred?.resolve();\n\t}\n\n\t/**\n\t * @param {Effect} effect\n\t */\n\tregister_created_effect(effect) {\n\t\tthis.#new_effects.push(effect);\n\t}\n\n\t#commit() {\n\t\t// If there are other pending batches, they now need to be 'rebased' โ€”\n\t\t// in other words, we re-run block/async effects with the newly\n\t\t// committed state, unless the batch in question has a more\n\t\t// recent value for a given source\n\t\tfor (let batch = first_batch; batch !== null; batch = batch.#next) {\n\t\t\tvar is_earlier = batch.id < this.id;\n\n\t\t\t/** @type {Source[]} */\n\t\t\tvar sources = [];\n\n\t\t\tfor (const [source, [value, is_derived]] of this.current) {\n\t\t\t\tif (batch.current.has(source)) {\n\t\t\t\t\tvar batch_value = /** @type {[any, boolean]} */ (batch.current.get(source))[0]; // faster than destructuring\n\n\t\t\t\t\tif (is_earlier && value !== batch_value) {\n\t\t\t\t\t\t// bring the value up to date\n\t\t\t\t\t\tbatch.current.set(source, [value, is_derived]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// same value or later batch has more recent value,\n\t\t\t\t\t\t// no need to re-run these effects\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tsources.push(source);\n\t\t\t}\n\n\t\t\tif (is_earlier) {\n\t\t\t\t// TODO do we need to restart these in some cases, instead of\n\t\t\t\t// immediately resolving them? Likely not because of how this.apply() works.\n\t\t\t\tfor (const [effect, deferred] of this.async_deriveds) {\n\t\t\t\t\tconst d = batch.async_deriveds.get(effect);\n\t\t\t\t\tif (d) deferred.promise.then(d.resolve).catch(d.reject);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar current = [...batch.current.keys()].filter(\n\t\t\t\t(source) => !(/** @type {[any, boolean]} */ (batch.current.get(source))[1])\n\t\t\t);\n\n\t\t\t// If not started yet or no sources to update (which is e.g. possible for the very first batch) then bail\n\t\t\tif (!batch.#started || current.length === 0) continue;\n\n\t\t\t// Re-run async/block effects that depend on distinct values changed in both batches (ignoring deriveds)\n\t\t\tvar others = current.filter((source) => !this.current.has(source));\n\n\t\t\tif (others.length === 0) {\n\t\t\t\tif (is_earlier) {\n\t\t\t\t\t// this batch is now obsolete and can be discarded\n\t\t\t\t\tbatch.discard();\n\t\t\t\t}\n\t\t\t} else if (sources.length > 0) {\n\t\t\t\t// The microtask queue can contain the batch already scheduled to run right\n\t\t\t\t// after this one is finished, so throwing the invariant would be wrong here.\n\t\t\t\tif (DEV && !batch.#decrement_queued) {\n\t\t\t\t\tinvariant(batch.#scheduled.length === 0, 'Batch has scheduled effects');\n\t\t\t\t}\n\n\t\t\t\t// A batch was unskipped in a later batch -> tell prior batches to unskip it, too\n\t\t\t\tif (is_earlier) {\n\t\t\t\t\tfor (const unskipped of this.#unskipped_branches) {\n\t\t\t\t\t\tbatch.unskip_effect(unskipped, (e) => {\n\t\t\t\t\t\t\tif ((e.f & (BLOCK_EFFECT | ASYNC)) !== 0) {\n\t\t\t\t\t\t\t\tbatch.schedule(e);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbatch.#defer_effects([e]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbatch.activate();\n\n\t\t\t\t/** @type {Set} */\n\t\t\t\tvar marked = new Set();\n\n\t\t\t\t/** @type {Map} */\n\t\t\t\tvar checked = new Map();\n\n\t\t\t\tfor (var source of sources) {\n\t\t\t\t\tmark_effects(source, others, marked, checked);\n\t\t\t\t}\n\n\t\t\t\tchecked = new Map();\n\t\t\t\tvar current_unequal = [...batch.current]\n\t\t\t\t\t.filter(([c, v1]) => {\n\t\t\t\t\t\tconst v2 = this.current.get(c);\n\t\t\t\t\t\tif (!v2) return true;\n\t\t\t\t\t\t// Either their values are different or one is a derived but not the other\n\t\t\t\t\t\treturn v2[0] !== v1[0] || v2[1] !== v1[1];\n\t\t\t\t\t})\n\t\t\t\t\t.map(([c]) => c);\n\n\t\t\t\tif (current_unequal.length > 0) {\n\t\t\t\t\tfor (const effect of this.#new_effects) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t(effect.f & (DESTROYED | INERT | EAGER_EFFECT)) === 0 &&\n\t\t\t\t\t\t\tdepends_on(effect, current_unequal, checked)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tif ((effect.f & (ASYNC | BLOCK_EFFECT)) !== 0) {\n\t\t\t\t\t\t\t\tset_signal_status(effect, DIRTY);\n\t\t\t\t\t\t\t\tbatch.schedule(effect);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbatch.#dirty_effects.add(effect);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Only apply and traverse when we know we triggered async work with marking the effects\n\t\t\t\t// and know this won't run anyway right afterwards\n\t\t\t\tif (batch.#scheduled.length > 0 && !batch.#decrement_queued) {\n\t\t\t\t\tbatch.apply();\n\n\t\t\t\t\tfor (var root of batch.#resolve()) {\n\t\t\t\t\t\tbatch.#traverse(root, [], []);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbatch.deactivate();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param {boolean} blocking\n\t * @param {Effect} effect\n\t */\n\tincrement(blocking, effect) {\n\t\tthis.#pending += 1;\n\n\t\tif (blocking) {\n\t\t\tlet blocking_pending_count = this.#blocking_pending.get(effect) ?? 0;\n\t\t\tthis.#blocking_pending.set(effect, blocking_pending_count + 1);\n\t\t}\n\t}\n\n\t/**\n\t * @param {boolean} blocking\n\t * @param {Effect} effect\n\t */\n\tdecrement(blocking, effect) {\n\t\tthis.#pending -= 1;\n\n\t\tif (blocking) {\n\t\t\tlet blocking_pending_count = this.#blocking_pending.get(effect) ?? 0;\n\n\t\t\tif (blocking_pending_count === 1) {\n\t\t\t\tthis.#blocking_pending.delete(effect);\n\t\t\t} else {\n\t\t\t\tthis.#blocking_pending.set(effect, blocking_pending_count - 1);\n\t\t\t}\n\t\t}\n\n\t\tif (this.#decrement_queued) return;\n\t\tthis.#decrement_queued = true;\n\n\t\tqueue_micro_task(() => {\n\t\t\tthis.#decrement_queued = false;\n\n\t\t\tif (this.linked) {\n\t\t\t\tthis.flush();\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * @param {Set} dirty_effects\n\t * @param {Set} maybe_dirty_effects\n\t */\n\ttransfer_effects(dirty_effects, maybe_dirty_effects) {\n\t\tfor (const e of dirty_effects) {\n\t\t\tthis.#dirty_effects.add(e);\n\t\t}\n\n\t\tfor (const e of maybe_dirty_effects) {\n\t\t\tthis.#maybe_dirty_effects.add(e);\n\t\t}\n\n\t\tdirty_effects.clear();\n\t\tmaybe_dirty_effects.clear();\n\t}\n\n\t/** @param {(batch: Batch) => void} fn */\n\toncommit(fn) {\n\t\tthis.#commit_callbacks.add(fn);\n\t}\n\n\t/** @param {(batch: Batch) => void} fn */\n\tondiscard(fn) {\n\t\tthis.#discard_callbacks.add(fn);\n\t}\n\n\tsettled() {\n\t\treturn (this.#deferred ??= deferred()).promise;\n\t}\n\n\tstatic ensure() {\n\t\tif (current_batch === null) {\n\t\t\tconst batch = (current_batch = new Batch());\n\n\t\t\tif (!is_processing && !is_flushing_sync) {\n\t\t\t\tqueue_micro_task(() => {\n\t\t\t\t\tif (!batch.#started) {\n\t\t\t\t\t\tbatch.flush();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn current_batch;\n\t}\n\n\tapply() {\n\t\tif (!async_mode_flag || (!this.is_fork && this.#prev === null && this.#next === null)) {\n\t\t\tbatch_values = null;\n\t\t\treturn;\n\t\t}\n\n\t\t// if there are multiple batches, we are 'time travelling' โ€”\n\t\t// we need to override values with the ones in this batch...\n\t\tbatch_values = new Map();\n\t\tfor (const [source, [value]] of this.current) {\n\t\t\tbatch_values.set(source, value);\n\t\t}\n\n\t\t// ...and undo changes belonging to other batches unless they intersect\n\t\tfor (let batch = first_batch; batch !== null; batch = batch.#next) {\n\t\t\tif (batch === this || batch.is_fork) continue;\n\n\t\t\t// If two batches intersect, the latter batch will be merged into the earlier batch,\n\t\t\t// and we should treat them as a single set of changes\n\t\t\tvar intersects = false;\n\n\t\t\tif (batch.id < this.id) {\n\t\t\t\tfor (const [source, [, is_derived]] of batch.current) {\n\t\t\t\t\t// Derived values don't partake in the intersection mechanism, because a derived could\n\t\t\t\t\t// be triggered in one batch already but not the other one yet, causing a false-positive\n\t\t\t\t\tif (is_derived) continue;\n\n\t\t\t\t\tif (this.current.has(source)) {\n\t\t\t\t\t\tintersects = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Since the latter batch merges into the earlier (if it resolves before the earlier one),\n\t\t\t// we treat the earlier values as \"already applied\". This way we don't need to rerun async\n\t\t\t// effects of the earlier batch in case they are merged.\n\t\t\t// As a result you can think of batch_values as having the latest values of all intersecting\n\t\t\t// batches up until this batch.\n\t\t\tif (!intersects) {\n\t\t\t\tfor (const [source, previous] of batch.previous) {\n\t\t\t\t\tif (!batch_values.has(source)) {\n\t\t\t\t\t\tbatch_values.set(source, previous);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t *\n\t * @param {Effect} effect\n\t */\n\tschedule(effect) {\n\t\tlast_scheduled_effect = effect;\n\n\t\t// defer render effects inside a pending boundary\n\t\t// TODO the `REACTION_RAN` check is only necessary because of legacy `$:` effects AFAICT โ€” we can remove later\n\t\tif (\n\t\t\teffect.b?.is_pending &&\n\t\t\t(effect.f & (EFFECT | RENDER_EFFECT | MANAGED_EFFECT)) !== 0 &&\n\t\t\t(effect.f & REACTION_RAN) === 0\n\t\t) {\n\t\t\teffect.b.defer_effect(effect);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#scheduled.push(effect);\n\t}\n\n\t#unlink() {\n\t\t// #merge calls #unlink, discard later on does it again - prevent\n\t\t// running it multiple times to not corrupt the linked list\n\t\tif (!this.linked) return;\n\n\t\tvar prev = this.#prev;\n\t\tvar next = this.#next;\n\n\t\tif (prev === null) {\n\t\t\tfirst_batch = next;\n\t\t} else {\n\t\t\tprev.#next = next;\n\t\t}\n\n\t\tif (next === null) {\n\t\t\tlast_batch = prev;\n\t\t} else {\n\t\t\tnext.#prev = prev;\n\t\t}\n\n\t\tthis.linked = false;\n\t}\n}\n\n// TODO Svelte@6 think about removing the callback argument.\n/**\n * Synchronously flush any pending updates.\n * Returns void if no callback is provided, otherwise returns the result of calling the callback.\n * @template [T=void]\n * @param {(() => T) | undefined} [fn]\n * @returns {T}\n */\nexport function flushSync(fn) {\n\tvar was_flushing_sync = is_flushing_sync;\n\tvar prev_previous_batch = previous_batch;\n\tprevious_batch = null;\n\tis_flushing_sync = true;\n\n\ttry {\n\t\tvar result;\n\n\t\tif (fn) {\n\t\t\tflushSync(); // flush anything pending through the while loop below\n\n\t\t\tresult = fn();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tflush_tasks();\n\n\t\t\tif (current_batch === null) {\n\t\t\t\treturn /** @type {T} */ (result);\n\t\t\t}\n\n\t\t\tcurrent_batch.flush();\n\t\t}\n\t} finally {\n\t\tis_flushing_sync = was_flushing_sync;\n\t\tprevious_batch = prev_previous_batch;\n\t}\n}\n\nfunction infinite_loop_guard() {\n\tif (DEV) {\n\t\tvar updates = new Map();\n\n\t\tfor (const source of /** @type {Batch} */ (current_batch).current.keys()) {\n\t\t\tfor (const [stack, update] of source.updated ?? []) {\n\t\t\t\tvar entry = updates.get(stack);\n\n\t\t\t\tif (!entry) {\n\t\t\t\t\tentry = { error: update.error, count: 0 };\n\t\t\t\t\tupdates.set(stack, entry);\n\t\t\t\t}\n\n\t\t\t\tentry.count += update.count;\n\t\t\t}\n\t\t}\n\n\t\tfor (const update of updates.values()) {\n\t\t\tif (update.error) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error(update.error);\n\t\t\t}\n\t\t}\n\t}\n\n\ttry {\n\t\te.effect_update_depth_exceeded();\n\t} catch (error) {\n\t\tif (DEV) {\n\t\t\t// stack contains no useful information, replace it\n\t\t\tdefine_property(error, 'stack', { value: '' });\n\t\t}\n\n\t\t// Best effort: invoke the boundary nearest the most recent\n\t\t// effect and hope that it's relevant to the infinite loop\n\t\tinvoke_error_boundary(error, last_scheduled_effect);\n\t}\n}\n\n/** @type {Set | null} */\nexport let eager_block_effects = null;\n\n/**\n * @param {Array} effects\n * @returns {void}\n */\nfunction flush_queued_effects(effects) {\n\tvar length = effects.length;\n\tif (length === 0) return;\n\n\tvar i = 0;\n\n\twhile (i < length) {\n\t\tvar effect = effects[i++];\n\n\t\tif ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) {\n\t\t\teager_block_effects = new Set();\n\n\t\t\tupdate_effect(effect);\n\n\t\t\t// Effects with no dependencies or teardown do not get added to the effect tree.\n\t\t\t// Deferred effects (e.g. `$effect(...)`) _are_ added to the tree because we\n\t\t\t// don't know if we need to keep them until they are executed. Doing the check\n\t\t\t// here (rather than in `update_effect`) allows us to skip the work for\n\t\t\t// immediate effects.\n\t\t\tif (\n\t\t\t\teffect.deps === null &&\n\t\t\t\teffect.first === null &&\n\t\t\t\teffect.nodes === null &&\n\t\t\t\teffect.teardown === null &&\n\t\t\t\teffect.ac === null\n\t\t\t) {\n\t\t\t\t// remove this effect from the graph\n\t\t\t\tunlink_effect(effect);\n\t\t\t}\n\n\t\t\t// If update_effect() has a flushSync() in it, we may have flushed another flush_queued_effects(),\n\t\t\t// which already handled this logic and did set eager_block_effects to null.\n\t\t\tif (eager_block_effects?.size > 0) {\n\t\t\t\told_values.clear();\n\n\t\t\t\tfor (const e of eager_block_effects) {\n\t\t\t\t\t// Skip eager effects that have already been unmounted\n\t\t\t\t\tif ((e.f & (DESTROYED | INERT)) !== 0) continue;\n\n\t\t\t\t\t// Run effects in order from ancestor to descendant, else we could run into nullpointers\n\t\t\t\t\t/** @type {Effect[]} */\n\t\t\t\t\tconst ordered_effects = [e];\n\t\t\t\t\tlet ancestor = e.parent;\n\t\t\t\t\twhile (ancestor !== null) {\n\t\t\t\t\t\tif (eager_block_effects.has(ancestor)) {\n\t\t\t\t\t\t\teager_block_effects.delete(ancestor);\n\t\t\t\t\t\t\tordered_effects.push(ancestor);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tancestor = ancestor.parent;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (let j = ordered_effects.length - 1; j >= 0; j--) {\n\t\t\t\t\t\tconst e = ordered_effects[j];\n\t\t\t\t\t\t// Skip eager effects that have already been unmounted\n\t\t\t\t\t\tif ((e.f & (DESTROYED | INERT)) !== 0) continue;\n\t\t\t\t\t\tupdate_effect(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\teager_block_effects.clear();\n\t\t\t}\n\t\t}\n\t}\n\n\teager_block_effects = null;\n}\n\n/**\n * This is similar to `mark_reactions`, but it only marks async/block effects\n * depending on `value` and at least one of the other `sources`, so that\n * these effects can re-run after another batch has been committed\n * @param {Value} value\n * @param {Source[]} sources\n * @param {Set} marked\n * @param {Map} checked\n */\nfunction mark_effects(value, sources, marked, checked) {\n\tif (marked.has(value)) return;\n\tmarked.add(value);\n\n\tif (value.reactions !== null) {\n\t\tfor (const reaction of value.reactions) {\n\t\t\tconst flags = reaction.f;\n\n\t\t\tif ((flags & DERIVED) !== 0) {\n\t\t\t\tmark_effects(/** @type {Derived} */ (reaction), sources, marked, checked);\n\t\t\t} else if (\n\t\t\t\t(flags & (ASYNC | BLOCK_EFFECT)) !== 0 &&\n\t\t\t\t(flags & DIRTY) === 0 &&\n\t\t\t\tdepends_on(reaction, sources, checked)\n\t\t\t) {\n\t\t\t\tset_signal_status(reaction, DIRTY);\n\t\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * When committing a fork, we need to trigger eager effects so that\n * any `$state.eager(...)` expressions update immediately. This\n * function allows us to discover them\n * @param {Value} value\n * @param {Set} effects\n */\nfunction mark_eager_effects(value, effects) {\n\tif (value.reactions === null) return;\n\n\tfor (const reaction of value.reactions) {\n\t\tconst flags = reaction.f;\n\n\t\tif ((flags & DERIVED) !== 0) {\n\t\t\tmark_eager_effects(/** @type {Derived} */ (reaction), effects);\n\t\t} else if ((flags & EAGER_EFFECT) !== 0) {\n\t\t\tset_signal_status(reaction, DIRTY);\n\t\t\teffects.add(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n\n/**\n * @param {Reaction} reaction\n * @param {Source[]} sources\n * @param {Map} checked\n */\nfunction depends_on(reaction, sources, checked) {\n\tconst depends = checked.get(reaction);\n\tif (depends !== undefined) return depends;\n\n\tif (reaction.deps !== null) {\n\t\tfor (const dep of reaction.deps) {\n\t\t\tif (includes.call(sources, dep)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ((dep.f & DERIVED) !== 0 && depends_on(/** @type {Derived} */ (dep), sources, checked)) {\n\t\t\t\tchecked.set(/** @type {Derived} */ (dep), true);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\tchecked.set(reaction, false);\n\n\treturn false;\n}\n\n/**\n * @param {Effect} effect\n * @returns {void}\n */\nexport function schedule_effect(effect) {\n\t/** @type {Batch} */ (current_batch).schedule(effect);\n}\n\n/** @type {Source[]} */\nlet eager_versions = [];\n\nfunction eager_flush() {\n\tflushSync(() => {\n\t\tconst eager = eager_versions;\n\t\teager_versions = [];\n\t\tfor (const version of eager) {\n\t\t\tupdate(version);\n\t\t}\n\t});\n}\n\n/** @type {Map>} */\nvar version_map = new Map();\n\n/**\n * Implementation of `$state.eager(fn())`\n * @template T\n * @param {() => T} fn\n * @returns {T}\n */\nexport function eager(fn) {\n\tvar initial = true;\n\tvar value = /** @type {T} */ (undefined);\n\n\tif (active_reaction === null) {\n\t\treturn fn();\n\t}\n\n\tlet parent = active_reaction;\n\n\tlet version = version_map.get(parent) ?? source(0);\n\tversion_map.set(parent, version);\n\n\tif (DEV) {\n\t\tversion.label ??= '$state.eager version';\n\t}\n\n\tteardown(() => {\n\t\tif (parent.f & DESTROYING) version_map.delete(parent);\n\t});\n\n\tget(version);\n\n\teager_effect(() => {\n\t\tif (initial) {\n\t\t\t// the first time this runs, we create an eager effect\n\t\t\t// that will run eagerly whenever the expression changes\n\t\t\tvar previous_batch_values = batch_values;\n\n\t\t\ttry {\n\t\t\t\tbatch_values = null;\n\t\t\t\tvalue = fn();\n\t\t\t} finally {\n\t\t\t\tbatch_values = previous_batch_values;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// the second time this effect runs, it's to schedule a\n\t\t// `version` update. since this will recreate the effect,\n\t\t// we don't need to evaluate the expression here\n\t\tif (eager_versions.length === 0) {\n\t\t\tqueue_micro_task(eager_flush);\n\t\t}\n\n\t\teager_versions.push(version);\n\t});\n\n\tinitial = false;\n\n\treturn value;\n}\n\n/**\n * Mark all the effects inside a skipped branch CLEAN, so that\n * they can be correctly rescheduled later. Tracks dirty and maybe_dirty\n * effects so they can be rescheduled if the branch survives.\n * @param {Effect} effect\n * @param {{ d: Effect[], m: Effect[] }} tracked\n */\nfunction reset_branch(effect, tracked) {\n\t// clean branch = nothing dirty inside, no need to traverse further\n\tif ((effect.f & BRANCH_EFFECT) !== 0 && (effect.f & CLEAN) !== 0) {\n\t\treturn;\n\t}\n\n\tif ((effect.f & DIRTY) !== 0) {\n\t\ttracked.d.push(effect);\n\t} else if ((effect.f & MAYBE_DIRTY) !== 0) {\n\t\ttracked.m.push(effect);\n\t}\n\n\tset_signal_status(effect, CLEAN);\n\n\tvar e = effect.first;\n\twhile (e !== null) {\n\t\treset_branch(e, tracked);\n\t\te = e.next;\n\t}\n}\n\n/**\n * Mark an entire effect tree clean following an error\n * @param {Effect} effect\n */\nfunction reset_all(effect) {\n\tset_signal_status(effect, CLEAN);\n\n\tvar e = effect.first;\n\twhile (e !== null) {\n\t\treset_all(e);\n\t\te = e.next;\n\t}\n}\n\n/**\n * Creates a 'fork', in which state changes are evaluated but not applied to the DOM.\n * This is useful for speculatively loading data (for example) when you suspect that\n * the user is about to take some action.\n *\n * Frameworks like SvelteKit can use this to preload data when the user touches or\n * hovers over a link, making any subsequent navigation feel instantaneous.\n *\n * The `fn` parameter is a synchronous function that modifies some state. The\n * state changes will be reverted after the fork is initialised, then reapplied\n * if and when the fork is eventually committed.\n *\n * When it becomes clear that a fork will _not_ be committed (e.g. because the\n * user navigated elsewhere), it must be discarded to avoid leaking memory.\n *\n * @param {() => void} fn\n * @returns {Fork}\n * @since 5.42\n */\nexport function fork(fn) {\n\tif (!async_mode_flag) {\n\t\te.experimental_async_required('fork');\n\t}\n\n\tif (current_batch !== null) {\n\t\te.fork_timing();\n\t}\n\n\tflushSync();\n\n\tvar batch = Batch.ensure();\n\tbatch.is_fork = true;\n\tbatch_values = new Map();\n\n\tvar committed = false;\n\tvar settled = batch.settled();\n\n\tfn();\n\tflushSync();\n\n\treturn {\n\t\tcommit: async () => {\n\t\t\tif (committed) {\n\t\t\t\tawait settled;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!batch.linked) {\n\t\t\t\te.fork_discarded();\n\t\t\t}\n\n\t\t\tcommitted = true;\n\n\t\t\tbatch.is_fork = false;\n\n\t\t\t// apply changes and update write versions so deriveds see the change\n\t\t\tfor (var [source, [value]] of batch.current) {\n\t\t\t\tsource.v = value;\n\t\t\t\tsource.wv = increment_write_version();\n\t\t\t}\n\n\t\t\t// trigger any `$state.eager(...)` expressions with the new state.\n\t\t\t// eager effects don't get scheduled like other effects, so we\n\t\t\t// can't just encounter them during traversal, we need to\n\t\t\t// proactively flush them\n\t\t\t// TODO maybe there's a better implementation?\n\t\t\tflushSync(() => {\n\t\t\t\t/** @type {Set} */\n\t\t\t\tvar eager_effects = new Set();\n\n\t\t\t\tfor (var source of batch.current.keys()) {\n\t\t\t\t\tmark_eager_effects(source, eager_effects);\n\t\t\t\t}\n\n\t\t\t\tset_eager_effects(eager_effects);\n\t\t\t\tflush_eager_effects();\n\t\t\t});\n\n\t\t\tbatch.flush();\n\t\t\tawait settled;\n\t\t},\n\t\tdiscard: () => {\n\t\t\t// cause any MAYBE_DIRTY deriveds to update\n\t\t\t// if they depend on things thath changed\n\t\t\t// inside the discarded fork\n\t\t\tfor (var source of batch.current.keys()) {\n\t\t\t\tsource.wv = increment_write_version();\n\t\t\t}\n\n\t\t\tif (!committed && batch.linked) {\n\t\t\t\tbatch.discard();\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * Forcibly remove all current batches, to prevent cross-talk between tests\n */\nexport function clear() {\n\tfirst_batch = last_batch = null;\n}\n","/** @import { Derived, Effect, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport {\n\tactive_reaction,\n\tactive_effect,\n\tuntracked_writes,\n\tget,\n\tset_untracked_writes,\n\tuntrack,\n\tincrement_write_version,\n\tupdate_effect,\n\tcurrent_sources,\n\tis_dirty,\n\tuntracking,\n\tis_destroying_effect,\n\tpush_reaction_value\n} from '../runtime.js';\nimport { equals, safe_equals } from './equality.js';\nimport {\n\tCLEAN,\n\tDERIVED,\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tEAGER_EFFECT,\n\tMAYBE_DIRTY,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tASYNC\n} from '#client/constants';\nimport * as e from '../errors.js';\nimport { legacy_mode_flag, tracing_mode_flag } from '../../flags/index.js';\nimport { tag_proxy } from '../dev/tracing.js';\nimport { get_error } from '../../shared/dev.js';\nimport { component_context, is_runes } from '../context.js';\nimport {\n\tBatch,\n\tbatch_values,\n\teager_block_effects,\n\tschedule_effect,\n\tlegacy_updates\n} from './batch.js';\nimport { proxy } from '../proxy.js';\nimport { execute_derived } from './deriveds.js';\nimport { set_signal_status, update_derived_status } from './status.js';\n\n/** @type {Set} */\nexport let eager_effects = new Set();\n\n/** @type {Map} */\nexport const old_values = new Map();\n\n/**\n * @param {Set} v\n */\nexport function set_eager_effects(v) {\n\teager_effects = v;\n}\n\nlet eager_effects_deferred = false;\n\nexport function set_eager_effects_deferred() {\n\teager_effects_deferred = true;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {Error | null} [stack]\n * @returns {Source}\n */\n// TODO rename this to `state` throughout the codebase\nexport function source(v, stack) {\n\t/** @type {Value} */\n\tvar signal = {\n\t\tf: 0, // TODO ideally we could skip this altogether, but it causes type errors\n\t\tv,\n\t\treactions: null,\n\t\tequals,\n\t\trv: 0,\n\t\twv: 0\n\t};\n\n\tif (DEV && tracing_mode_flag) {\n\t\tsignal.created = stack ?? get_error('created at');\n\t\tsignal.updated = null;\n\t\tsignal.set_during_effect = false;\n\t\tsignal.trace = null;\n\t}\n\n\treturn signal;\n}\n\n/**\n * @template V\n * @param {V} v\n * @param {Error | null} [stack]\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function state(v, stack) {\n\tconst s = source(v, stack);\n\n\tpush_reaction_value(s);\n\n\treturn s;\n}\n\n/**\n * @template V\n * @param {V} initial_value\n * @param {boolean} [immutable]\n * @returns {Source}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function mutable_source(initial_value, immutable = false, trackable = true) {\n\tconst s = source(initial_value);\n\tif (!immutable) {\n\t\ts.equals = safe_equals;\n\t}\n\n\t// bind the signal to the component context, in case we need to\n\t// track updates to trigger beforeUpdate/afterUpdate callbacks\n\tif (legacy_mode_flag && trackable && component_context !== null && component_context.l !== null) {\n\t\t(component_context.l.s ??= []).push(s);\n\t}\n\n\treturn s;\n}\n\n/**\n * @template V\n * @param {Value} source\n * @param {V} value\n */\nexport function mutate(source, value) {\n\tset(\n\t\tsource,\n\t\tuntrack(() => get(source))\n\t);\n\treturn value;\n}\n\n/**\n * @template V\n * @param {Value} source\n * @param {V} value\n * @param {boolean} [should_proxy]\n * @returns {V}\n */\nexport function set(source, value, should_proxy = false) {\n\tif (\n\t\tactive_reaction !== null &&\n\t\t// since we are untracking the function inside `$inspect.with` we need to add this check\n\t\t// to ensure we error if state is set inside an inspect effect\n\t\t(!untracking || (active_reaction.f & EAGER_EFFECT) !== 0) &&\n\t\tis_runes() &&\n\t\t(active_reaction.f & (DERIVED | BLOCK_EFFECT | ASYNC | EAGER_EFFECT)) !== 0 &&\n\t\t(current_sources === null || !current_sources.has(source))\n\t) {\n\t\te.state_unsafe_mutation();\n\t}\n\n\tlet new_value = should_proxy ? proxy(value) : value;\n\n\tif (DEV) {\n\t\ttag_proxy(new_value, /** @type {string} */ (source.label));\n\t}\n\n\treturn internal_set(source, new_value, legacy_updates);\n}\n\n/**\n * A set of signals we have already seen while traversing in mark_reactions.\n * Not always set to balance the common case of sources only having a couple\n * of (transitive) dependencies (where always creating a Set would be bad for perf)\n * with the edge case of extremely deep or wide dependency arrays with cycles.\n * @type {Set | null}\n */\nvar seen = null;\n/** Number of transitive dependencies, see {@link seen} for more info */\nvar count_deps = 0;\n\n/**\n * @template V\n * @param {Value} source\n * @param {V} value\n * @param {Effect[] | null} [updated_during_traversal]\n * @returns {V}\n */\nexport function internal_set(source, value, updated_during_traversal = null) {\n\tif (!source.equals(value)) {\n\t\tif (is_destroying_effect) {\n\t\t\told_values.set(source, value);\n\t\t} else if (!old_values.has(source)) {\n\t\t\t// only record the value from before the first write in this flush, otherwise a\n\t\t\t// teardown would see the value from before whichever write happened to be last\n\t\t\told_values.set(source, source.v);\n\t\t}\n\n\t\tvar batch = Batch.ensure();\n\t\tbatch.capture(source, value);\n\n\t\tif (DEV) {\n\t\t\tif (tracing_mode_flag || active_effect !== null) {\n\t\t\t\tsource.updated ??= new Map();\n\n\t\t\t\t// For performance reasons, when not using $inspect.trace, we only start collecting stack traces\n\t\t\t\t// after the same source has been updated more than 5 times in the same flush cycle.\n\t\t\t\tconst count = (source.updated.get('')?.count ?? 0) + 1;\n\t\t\t\tsource.updated.set('', { error: /** @type {any} */ (null), count });\n\n\t\t\t\tif (tracing_mode_flag || count > 5) {\n\t\t\t\t\tconst error = get_error('updated at');\n\n\t\t\t\t\tif (error !== null) {\n\t\t\t\t\t\tlet entry = source.updated.get(error.stack);\n\n\t\t\t\t\t\tif (!entry) {\n\t\t\t\t\t\t\tentry = { error, count: 0 };\n\t\t\t\t\t\t\tsource.updated.set(error.stack, entry);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tentry.count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (active_effect !== null) {\n\t\t\t\tsource.set_during_effect = true;\n\t\t\t}\n\t\t}\n\n\t\tif ((source.f & DERIVED) !== 0) {\n\t\t\tconst derived = /** @type {Derived} */ (source);\n\n\t\t\t// if we are assigning to a dirty derived we set it to clean/maybe dirty but we also eagerly execute it to track the dependencies\n\t\t\tif ((source.f & DIRTY) !== 0) {\n\t\t\t\texecute_derived(derived);\n\t\t\t}\n\n\t\t\t// During time traveling we don't want to reset the status so that\n\t\t\t// traversal of the graph in the other batches still happens\n\t\t\tif (batch_values === null) {\n\t\t\t\tupdate_derived_status(derived);\n\t\t\t}\n\t\t}\n\n\t\tsource.wv = increment_write_version();\n\n\t\t// For debugging, in case you want to know which reactions are being scheduled:\n\t\t// log_reactions(source);\n\t\tseen = null;\n\t\tcount_deps = 0;\n\t\tmark_reactions(source, DIRTY, updated_during_traversal);\n\t\tseen = null;\n\n\t\t// It's possible that the current reaction might not have up-to-date dependencies\n\t\t// whilst it's actively running. So in the case of ensuring it registers the reaction\n\t\t// properly for itself, we need to ensure the current effect actually gets\n\t\t// scheduled. i.e: `$effect(() => x++)`\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tactive_effect !== null &&\n\t\t\t(active_effect.f & CLEAN) !== 0 &&\n\t\t\t(active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0\n\t\t) {\n\t\t\tif (untracked_writes === null) {\n\t\t\t\tset_untracked_writes([source]);\n\t\t\t} else {\n\t\t\t\tuntracked_writes.push(source);\n\t\t\t}\n\t\t}\n\n\t\tif (!batch.is_fork && eager_effects.size > 0 && !eager_effects_deferred) {\n\t\t\tflush_eager_effects();\n\t\t}\n\t}\n\n\treturn value;\n}\n\nexport function flush_eager_effects() {\n\teager_effects_deferred = false;\n\n\tfor (const effect of eager_effects) {\n\t\t// Mark clean inspect-effects as maybe dirty and then check their dirtiness\n\t\t// instead of just updating the effects - this way we avoid overfiring.\n\t\tif ((effect.f & CLEAN) !== 0) {\n\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t}\n\n\t\tlet dirty;\n\n\t\ttry {\n\t\t\tdirty = is_dirty(effect);\n\t\t} catch {\n\t\t\t// Dirty-checking can evaluate derived dependencies and throw in cases where\n\t\t\t// parent effects are about to destroy this eager effect. Run the effect so\n\t\t\t// its own error handling can deal with transient failures.\n\t\t\tdirty = true;\n\t\t}\n\n\t\tif (dirty) {\n\t\t\tupdate_effect(effect);\n\t\t}\n\t}\n\n\teager_effects.clear();\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update(source, d = 1) {\n\tvar value = get(source);\n\tvar result = d === 1 ? value++ : value--;\n\n\tset(source, value);\n\n\t// @ts-expect-error\n\treturn result;\n}\n\n/**\n * @template {number | bigint} T\n * @param {Source} source\n * @param {1 | -1} [d]\n * @returns {T}\n */\nexport function update_pre(source, d = 1) {\n\tvar value = get(source);\n\n\t// @ts-expect-error\n\t// eslint-disable-next-line no-useless-assignment -- `++`/`--` used for return value, not side effect on `value`\n\treturn set(source, d === 1 ? ++value : --value);\n}\n\n/**\n * Silently (without using `get`) increment a source\n * @param {Source} source\n */\nexport function increment(source) {\n\tset(source, source.v + 1);\n}\n\n/**\n * @param {Value} signal\n * @param {number} status should be DIRTY or MAYBE_DIRTY\n * @param {Effect[] | null} updated_during_traversal\n * @returns {void}\n */\nfunction mark_reactions(signal, status, updated_during_traversal) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tvar runes = is_runes();\n\tvar length = reactions.length;\n\n\tcount_deps += length;\n\t// Activate the `seen` Set if we think from the unusually high number of deps that\n\t// there might be cycles in the graph, to avoid repeated lookups for reactions\n\t// Example: https://github.com/sveltejs/svelte/issues/16658 has a graph with one source\n\t// reaching ~10000 distinct deriveds/effects each, resulting in 65 million walks through repeated visits.\n\tif (count_deps > 100000 && seen === null) seen = new Set();\n\n\tif (seen !== null) {\n\t\tif (seen.has(signal)) return;\n\t\tseen.add(signal);\n\t}\n\n\tfor (var i = 0; i < length; i++) {\n\t\tvar reaction = reactions[i];\n\t\tvar flags = reaction.f;\n\n\t\t// In legacy mode, skip the current effect to prevent infinite loops\n\t\tif (!runes && reaction === active_effect) continue;\n\n\t\tvar not_dirty = (flags & DIRTY) === 0;\n\n\t\t// don't set a DIRTY reaction to MAYBE_DIRTY\n\t\tif (not_dirty) {\n\t\t\tset_signal_status(reaction, status);\n\t\t}\n\n\t\tif ((flags & EAGER_EFFECT) !== 0) {\n\t\t\t// Eager effects need to run immediately:\n\t\t\t// - for $inspect so that the stack trace makes sense\n\t\t\t// - for $state.eager because they might be without an effect parent\n\t\t\teager_effects.add(/** @type {Effect} */ (reaction));\n\t\t} else if ((flags & DERIVED) !== 0) {\n\t\t\tvar derived = /** @type {Derived} */ (reaction);\n\n\t\t\tbatch_values?.delete(derived);\n\t\t\tmark_reactions(derived, MAYBE_DIRTY, updated_during_traversal);\n\t\t} else if (not_dirty) {\n\t\t\tvar effect = /** @type {Effect} */ (reaction);\n\n\t\t\tif ((flags & BLOCK_EFFECT) !== 0 && eager_block_effects !== null) {\n\t\t\t\teager_block_effects.add(effect);\n\t\t\t}\n\n\t\t\tif (updated_during_traversal !== null) {\n\t\t\t\tupdated_during_traversal.push(effect);\n\t\t\t} else {\n\t\t\t\tschedule_effect(effect);\n\t\t\t}\n\t\t}\n\t}\n}\n","/** @import { Source } from '#client' */\nimport { DEV } from 'esm-env';\nimport {\n\tget,\n\tactive_effect,\n\tupdate_version,\n\tactive_reaction,\n\tset_update_version,\n\tset_active_reaction\n} from './runtime.js';\nimport {\n\tarray_prototype,\n\tget_descriptor,\n\tget_prototype_of,\n\tis_array,\n\tobject_prototype\n} from '../shared/utils.js';\nimport {\n\tstate as source,\n\tset,\n\tincrement,\n\tflush_eager_effects,\n\tset_eager_effects_deferred\n} from './reactivity/sources.js';\nimport { COMPONENT_SYMBOL, PROXY_PATH_SYMBOL, STATE_SYMBOL } from '#client/constants';\nimport { UNINITIALIZED } from '../../constants.js';\nimport * as e from './errors.js';\nimport { tag } from './dev/tracing.js';\nimport { get_error } from '../shared/dev.js';\nimport { tracing_mode_flag } from '../flags/index.js';\n\n// TODO move all regexes into shared module?\nconst regex_is_valid_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;\n\n/**\n * @template T\n * @param {T} value\n * @returns {T}\n */\nexport function proxy(value) {\n\t// if non-proxyable, a component instance, or already a proxy, return `value`\n\tif (\n\t\ttypeof value !== 'object' ||\n\t\tvalue === null ||\n\t\tSTATE_SYMBOL in value ||\n\t\tCOMPONENT_SYMBOL in value\n\t) {\n\t\treturn value;\n\t}\n\n\tconst prototype = get_prototype_of(value);\n\n\tif (prototype !== object_prototype && prototype !== array_prototype) {\n\t\treturn value;\n\t}\n\n\t/** @type {Map>} */\n\tvar sources = new Map();\n\tvar is_proxied_array = is_array(value);\n\tvar version = source(0);\n\n\tvar stack = DEV && tracing_mode_flag ? get_error('created at') : null;\n\tvar parent_version = update_version;\n\n\t/**\n\t * Executes the proxy in the context of the reaction it was originally created in, if any\n\t * @template T\n\t * @param {() => T} fn\n\t */\n\tvar with_parent = (fn) => {\n\t\tif (update_version === parent_version) {\n\t\t\treturn fn();\n\t\t}\n\n\t\t// child source is being created after the initial proxy โ€”\n\t\t// prevent it from being associated with the current reaction\n\t\tvar reaction = active_reaction;\n\t\tvar version = update_version;\n\n\t\tset_active_reaction(null);\n\t\tset_update_version(parent_version);\n\n\t\tvar result = fn();\n\n\t\tset_active_reaction(reaction);\n\t\tset_update_version(version);\n\n\t\treturn result;\n\t};\n\n\tif (is_proxied_array) {\n\t\t// We need to create the length source eagerly to ensure that\n\t\t// mutations to the array are properly synced with our proxy\n\t\tsources.set('length', source(/** @type {any[]} */ (value).length, stack));\n\t\tif (DEV) {\n\t\t\tvalue = /** @type {any} */ (inspectable_array(/** @type {any[]} */ (value)));\n\t\t}\n\t}\n\n\t/** Used in dev for $inspect.trace() */\n\tvar path = '';\n\tlet updating = false;\n\t/** @param {string} new_path */\n\tfunction update_path(new_path) {\n\t\tif (updating) return;\n\t\tupdating = true;\n\t\tpath = new_path;\n\n\t\ttag(version, `${path} version`);\n\n\t\t// rename all child sources and child proxies\n\t\tfor (const [prop, source] of sources) {\n\t\t\ttag(source, get_label(path, prop));\n\t\t}\n\t\tupdating = false;\n\t}\n\n\treturn new Proxy(/** @type {any} */ (value), {\n\t\tdefineProperty(_, prop, descriptor) {\n\t\t\tif (\n\t\t\t\t!('value' in descriptor) ||\n\t\t\t\tdescriptor.configurable === false ||\n\t\t\t\tdescriptor.enumerable === false ||\n\t\t\t\tdescriptor.writable === false\n\t\t\t) {\n\t\t\t\t// we disallow non-basic descriptors, because unless they are applied to the\n\t\t\t\t// target object โ€” which we avoid, so that state can be forked โ€” we will run\n\t\t\t\t// afoul of the various invariants\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/getOwnPropertyDescriptor#invariants\n\t\t\t\te.state_descriptors_fixed();\n\t\t\t}\n\t\t\tvar s = sources.get(prop);\n\t\t\tif (s === undefined) {\n\t\t\t\twith_parent(() => {\n\t\t\t\t\tvar s = source(descriptor.value, stack);\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t\tif (DEV && typeof prop === 'string') {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t\treturn s;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tset(s, descriptor.value, true);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tdeleteProperty(target, prop) {\n\t\t\tvar s = sources.get(prop);\n\n\t\t\tif (s === undefined) {\n\t\t\t\tif (prop in target) {\n\t\t\t\t\tconst s = with_parent(() => source(UNINITIALIZED, stack));\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t\tincrement(version);\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tset(s, UNINITIALIZED);\n\t\t\t\tincrement(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\tget(target, prop, receiver) {\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\tif (DEV && prop === PROXY_PATH_SYMBOL) {\n\t\t\t\treturn update_path;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar exists = prop in target;\n\n\t\t\t// create a source, but only if it's an own property and not a prototype property\n\t\t\tif (s === undefined && (!exists || get_descriptor(target, prop)?.writable)) {\n\t\t\t\ts = with_parent(() => {\n\t\t\t\t\tvar p = proxy(exists ? target[prop] : UNINITIALIZED);\n\t\t\t\t\tvar s = source(p, stack);\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\n\t\t\t\t\treturn s;\n\t\t\t\t});\n\n\t\t\t\tsources.set(prop, s);\n\t\t\t}\n\n\t\t\tif (s !== undefined) {\n\t\t\t\tvar v = get(s);\n\t\t\t\treturn v === UNINITIALIZED ? undefined : v;\n\t\t\t}\n\n\t\t\treturn Reflect.get(target, prop, receiver);\n\t\t},\n\n\t\tgetOwnPropertyDescriptor(target, prop) {\n\t\t\tthis.has?.(target, prop);\n\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\t\t\tvar s = sources.get(prop);\n\n\t\t\tif (s !== undefined) {\n\t\t\t\tvar value = get(s);\n\n\t\t\t\tif (value === UNINITIALIZED) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\tif (descriptor && 'value' in descriptor) {\n\t\t\t\t\tdescriptor.value = value;\n\t\t\t\t} else {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tenumerable: true,\n\t\t\t\t\t\tconfigurable: true,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t\twritable: true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn descriptor;\n\t\t},\n\n\t\thas(target, prop) {\n\t\t\tif (prop === STATE_SYMBOL) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = (s !== undefined && s.v !== UNINITIALIZED) || Reflect.has(target, prop);\n\n\t\t\tif (\n\t\t\t\ts !== undefined ||\n\t\t\t\t(active_effect !== null && (!has || get_descriptor(target, prop)?.writable))\n\t\t\t) {\n\t\t\t\tif (s === undefined) {\n\t\t\t\t\ts = with_parent(() => {\n\t\t\t\t\t\tvar p = has ? proxy(target[prop]) : UNINITIALIZED;\n\t\t\t\t\t\tvar s = source(p, stack);\n\n\t\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn s;\n\t\t\t\t\t});\n\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\n\t\t\t\tvar value = get(s);\n\t\t\t\tif (value === UNINITIALIZED) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn has;\n\t\t},\n\n\t\tset(target, prop, value, receiver) {\n\t\t\tvar s = sources.get(prop);\n\t\t\tvar has = prop in target;\n\n\t\t\t// variable.length = value -> clear all signals with index >= value\n\t\t\tif (is_proxied_array && prop === 'length') {\n\t\t\t\tfor (var i = value; i < /** @type {Source} */ (s).v; i += 1) {\n\t\t\t\t\tvar other_s = sources.get(i + '');\n\t\t\t\t\tif (other_s !== undefined) {\n\t\t\t\t\t\tset(other_s, UNINITIALIZED);\n\t\t\t\t\t} else if (i in target) {\n\t\t\t\t\t\t// If the item exists in the original, we need to create an uninitialized source,\n\t\t\t\t\t\t// else a later read of the property would result in a source being created with\n\t\t\t\t\t\t// the value of the original item at that index.\n\t\t\t\t\t\tother_s = with_parent(() => source(UNINITIALIZED, stack));\n\t\t\t\t\t\tsources.set(i + '', other_s);\n\n\t\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\t\ttag(other_s, get_label(path, i));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we haven't yet created a source for this property, we need to ensure\n\t\t\t// we do so otherwise if we read it later, then the write won't be tracked and\n\t\t\t// the heuristics of effects will be different vs if we had read the proxied\n\t\t\t// object property before writing to that property.\n\t\t\tif (s === undefined) {\n\t\t\t\tif (!has || get_descriptor(target, prop)?.writable) {\n\t\t\t\t\ts = with_parent(() => source(undefined, stack));\n\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, get_label(path, prop));\n\t\t\t\t\t}\n\t\t\t\t\tset(s, proxy(value));\n\n\t\t\t\t\tsources.set(prop, s);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thas = s.v !== UNINITIALIZED;\n\n\t\t\t\tvar p = with_parent(() => proxy(value));\n\t\t\t\tset(s, p);\n\t\t\t}\n\n\t\t\tvar descriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n\n\t\t\t// Set the new value before updating any signals so that any listeners get the new value\n\t\t\tif (descriptor?.set) {\n\t\t\t\tdescriptor.set.call(receiver, value);\n\t\t\t}\n\n\t\t\tif (!has) {\n\t\t\t\t// If we have mutated an array directly, we might need to\n\t\t\t\t// signal that length has also changed. Do it before updating metadata\n\t\t\t\t// to ensure that iterating over the array as a result of a metadata update\n\t\t\t\t// will not cause the length to be out of sync.\n\t\t\t\tif (is_proxied_array && typeof prop === 'string') {\n\t\t\t\t\tvar ls = /** @type {Source} */ (sources.get('length'));\n\t\t\t\t\tvar n = Number(prop);\n\n\t\t\t\t\tif (Number.isInteger(n) && n >= ls.v) {\n\t\t\t\t\t\tset(ls, n + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tincrement(version);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t},\n\n\t\townKeys(target) {\n\t\t\tget(version);\n\n\t\t\tvar own_keys = Reflect.ownKeys(target).filter((key) => {\n\t\t\t\tvar source = sources.get(key);\n\t\t\t\treturn source === undefined || source.v !== UNINITIALIZED;\n\t\t\t});\n\n\t\t\tfor (var [key, source] of sources) {\n\t\t\t\tif (source.v !== UNINITIALIZED && !(key in target)) {\n\t\t\t\t\town_keys.push(key);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn own_keys;\n\t\t},\n\n\t\tsetPrototypeOf() {\n\t\t\te.state_prototype_fixed();\n\t\t}\n\t});\n}\n\n/**\n * @param {string} path\n * @param {string | symbol} prop\n */\nfunction get_label(path, prop) {\n\tif (typeof prop === 'symbol') return `${path}[Symbol(${prop.description ?? ''})]`;\n\tif (regex_is_valid_identifier.test(prop)) return `${path}.${prop}`;\n\treturn /^\\d+$/.test(prop) ? `${path}[${prop}]` : `${path}['${prop}']`;\n}\n\n/**\n * @param {any} value\n */\nexport function get_proxied_value(value) {\n\ttry {\n\t\tif (value !== null && typeof value === 'object' && STATE_SYMBOL in value) {\n\t\t\treturn value[STATE_SYMBOL];\n\t\t}\n\t} catch {\n\t\t// the above if check can throw an error if the value in question\n\t\t// is the contentWindow of an iframe on another domain, in which\n\t\t// case we want to just return the value (because it's definitely\n\t\t// not a proxied value) so we don't break any JavaScript interacting\n\t\t// with that iframe (such as various payment companies client side\n\t\t// JavaScript libraries interacting with their iframes on the same\n\t\t// domain)\n\t}\n\n\treturn value;\n}\n\n/**\n * @param {any} a\n * @param {any} b\n */\nexport function is(a, b) {\n\treturn Object.is(get_proxied_value(a), get_proxied_value(b));\n}\n\nconst ARRAY_MUTATING_METHODS = new Set([\n\t'copyWithin',\n\t'fill',\n\t'pop',\n\t'push',\n\t'reverse',\n\t'shift',\n\t'sort',\n\t'splice',\n\t'unshift'\n]);\n\n/**\n * Wrap array mutating methods so $inspect is triggered only once and\n * to prevent logging an array in intermediate state (e.g. with an empty slot)\n * @param {any[]} array\n */\nfunction inspectable_array(array) {\n\treturn new Proxy(array, {\n\t\tget(target, prop, receiver) {\n\t\t\tvar value = Reflect.get(target, prop, receiver);\n\t\t\tif (!ARRAY_MUTATING_METHODS.has(/** @type {string} */ (prop))) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @this {any[]}\n\t\t\t * @param {any[]} args\n\t\t\t */\n\t\t\treturn function (...args) {\n\t\t\t\tset_eager_effects_deferred();\n\t\t\t\tvar result = value.apply(this, args);\n\t\t\t\tflush_eager_effects();\n\t\t\t\treturn result;\n\t\t\t};\n\t\t}\n\t});\n}\n","import * as w from '../warnings.js';\nimport { get_proxied_value } from '../proxy.js';\n\nexport function init_array_prototype_warnings() {\n\tconst array_prototype = Array.prototype;\n\t// The REPL ends up here over and over, and this prevents it from adding more and more patches\n\t// of the same kind to the prototype, which would slow down everything over time.\n\t// @ts-expect-error\n\tconst cleanup = Array.__svelte_cleanup;\n\tif (cleanup) {\n\t\tcleanup();\n\t}\n\n\tconst { indexOf, lastIndexOf, includes } = array_prototype;\n\n\tarray_prototype.indexOf = function (item, from_index) {\n\t\tconst index = indexOf.call(this, item, from_index);\n\n\t\tif (index === -1) {\n\t\t\tfor (let i = from_index ?? 0; i < this.length; i += 1) {\n\t\t\t\tif (get_proxied_value(this[i]) === item) {\n\t\t\t\t\tw.state_proxy_equality_mismatch('array.indexOf(...)');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn index;\n\t};\n\n\tarray_prototype.lastIndexOf = function (item, from_index) {\n\t\t// we need to specify this.length - 1 because it's probably using something like\n\t\t// `arguments` inside so passing undefined is different from not passing anything\n\t\tconst index = lastIndexOf.call(this, item, from_index ?? this.length - 1);\n\n\t\tif (index === -1) {\n\t\t\tfor (let i = 0; i <= (from_index ?? this.length - 1); i += 1) {\n\t\t\t\tif (get_proxied_value(this[i]) === item) {\n\t\t\t\t\tw.state_proxy_equality_mismatch('array.lastIndexOf(...)');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn index;\n\t};\n\n\tarray_prototype.includes = function (item, from_index) {\n\t\tconst has = includes.call(this, item, from_index);\n\n\t\tif (!has) {\n\t\t\tfor (let i = 0; i < this.length; i += 1) {\n\t\t\t\tif (get_proxied_value(this[i]) === item) {\n\t\t\t\t\tw.state_proxy_equality_mismatch('array.includes(...)');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn has;\n\t};\n\n\t// @ts-expect-error\n\tArray.__svelte_cleanup = () => {\n\t\tarray_prototype.indexOf = indexOf;\n\t\tarray_prototype.lastIndexOf = lastIndexOf;\n\t\tarray_prototype.includes = includes;\n\t};\n}\n\n/**\n * @param {any} a\n * @param {any} b\n * @param {boolean} equal\n * @returns {boolean}\n */\nexport function strict_equals(a, b, equal = true) {\n\t// try-catch needed because this tries to read properties of `a` and `b`,\n\t// which could be disallowed for example in a secure context\n\ttry {\n\t\tif ((a === b) !== (get_proxied_value(a) === get_proxied_value(b))) {\n\t\t\tw.state_proxy_equality_mismatch(equal ? '===' : '!==');\n\t\t}\n\t} catch {}\n\n\treturn (a === b) === equal;\n}\n\n/**\n * @param {any} a\n * @param {any} b\n * @param {boolean} equal\n * @returns {boolean}\n */\nexport function equals(a, b, equal = true) {\n\tif ((a == b) !== (get_proxied_value(a) == get_proxied_value(b))) {\n\t\tw.state_proxy_equality_mismatch(equal ? '==' : '!=');\n\t}\n\n\treturn (a == b) === equal;\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { hydrate_node, hydrating, reset, set_hydrate_node } from './hydration.js';\nimport { DEV } from 'esm-env';\nimport { init_array_prototype_warnings } from '../dev/equality.js';\nimport { get_descriptor, is_extensible } from '../../shared/utils.js';\nimport { active_effect } from '../runtime.js';\nimport { async_mode_flag } from '../../flags/index.js';\nimport {\n\tATTRIBUTES_CACHE,\n\tCLASS_CACHE,\n\tREACTION_RAN,\n\tSTYLE_CACHE,\n\tTEXT_CACHE,\n\tTEXT_NODE\n} from '#client/constants';\nimport { eager_block_effects } from '../reactivity/batch.js';\nimport { NAMESPACE_HTML } from '../../../constants.js';\n\n// export these for reference in the compiled code, making global name deduplication unnecessary\n/** @type {Window} */\nexport var $window;\n\n/** @type {Document} */\nexport var $document;\n\n/** @type {boolean} */\nexport var is_firefox;\n\n/** @type {() => Node | null} */\nvar first_child_getter;\n/** @type {() => Node | null} */\nvar next_sibling_getter;\n\n/**\n * Initialize these lazily to avoid issues when using the runtime in a server context\n * where these globals are not available while avoiding a separate server entry point\n */\nexport function init_operations() {\n\tif ($window !== undefined) {\n\t\treturn;\n\t}\n\n\t$window = window;\n\t$document = document;\n\tis_firefox = /Firefox/.test(navigator.userAgent);\n\n\tvar element_prototype = Element.prototype;\n\tvar node_prototype = Node.prototype;\n\tvar text_prototype = Text.prototype;\n\n\t// @ts-ignore\n\tfirst_child_getter = get_descriptor(node_prototype, 'firstChild').get;\n\t// @ts-ignore\n\tnext_sibling_getter = get_descriptor(node_prototype, 'nextSibling').get;\n\n\tif (is_extensible(element_prototype)) {\n\t\t// the following assignments improve perf of lookups on DOM nodes\n\t\t/** @type {any} */ (element_prototype)[CLASS_CACHE] = undefined;\n\t\t/** @type {any} */ (element_prototype)[ATTRIBUTES_CACHE] = null;\n\t\t/** @type {any} */ (element_prototype)[STYLE_CACHE] = undefined;\n\t\t// @ts-expect-error\n\t\telement_prototype.__e = undefined;\n\t}\n\n\tif (is_extensible(text_prototype)) {\n\t\t/** @type {any} */ (text_prototype)[TEXT_CACHE] = undefined;\n\t}\n\n\tif (DEV) {\n\t\t// @ts-expect-error\n\t\telement_prototype.__svelte_meta = null;\n\n\t\tinit_array_prototype_warnings();\n\t}\n}\n\n/**\n * @param {string} value\n * @returns {Text}\n */\nexport function create_text(value = '') {\n\treturn document.createTextNode(value);\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_first_child(node) {\n\treturn /** @type {TemplateNode | null} */ (first_child_getter.call(node));\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function get_next_sibling(node) {\n\treturn /** @type {TemplateNode | null} */ (next_sibling_getter.call(node));\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @template {Node} N\n * @param {N} node\n * @param {boolean} is_text\n * @returns {TemplateNode | null}\n */\nexport function child(node, is_text) {\n\tif (!hydrating) {\n\t\treturn get_first_child(node);\n\t}\n\n\tvar child = get_first_child(hydrate_node);\n\n\t// Child can be null if we have an element with a single child, like `

      {text}

      `, where `text` is empty\n\tif (child === null) {\n\t\tchild = hydrate_node.appendChild(create_text());\n\t} else if (is_text && child.nodeType !== TEXT_NODE) {\n\t\tvar text = create_text();\n\t\tchild?.before(text);\n\t\tset_hydrate_node(text);\n\t\treturn text;\n\t}\n\n\tif (is_text) {\n\t\tmerge_text_nodes(/** @type {Text} */ (child));\n\t}\n\n\tset_hydrate_node(child);\n\treturn child;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {TemplateNode} node\n * @param {boolean} [is_text]\n * @returns {TemplateNode | null}\n */\nexport function first_child(node, is_text = false) {\n\tif (!hydrating) {\n\t\tvar first = get_first_child(node);\n\n\t\t// TODO prevent user comments with the empty string when preserveComments is true\n\t\tif (first instanceof Comment && first.data === '') return get_next_sibling(first);\n\n\t\treturn first;\n\t}\n\n\tif (is_text) {\n\t\t// if an {expression} is empty during SSR, there might be no\n\t\t// text node to hydrate โ€” we must therefore create one\n\t\tif (hydrate_node?.nodeType !== TEXT_NODE) {\n\t\t\tvar text = create_text();\n\n\t\t\thydrate_node?.before(text);\n\t\t\tset_hydrate_node(text);\n\t\t\treturn text;\n\t\t}\n\n\t\tmerge_text_nodes(/** @type {Text} */ (hydrate_node));\n\t}\n\n\treturn hydrate_node;\n}\n\n/**\n * `child`, for the very common case of an element with exactly one child. Resetting the\n * hydration cursor is part of the same step, so the compiler doesn't have to emit a\n * separate `reset` call for every `

      {text}

      ` in an app.\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {TemplateNode} node\n * @param {boolean} [is_text]\n * @returns {TemplateNode | null}\n */\nexport function only_child(node, is_text = false) {\n\tif (!hydrating) {\n\t\treturn get_first_child(node);\n\t}\n\n\tvar first = child(node, is_text);\n\treset(node);\n\n\treturn first;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {TemplateNode} node\n * @param {number} count\n * @param {boolean} is_text\n * @returns {TemplateNode | null}\n */\nexport function sibling(node, count = 1, is_text = false) {\n\tlet next_sibling = hydrating ? hydrate_node : node;\n\tvar last_sibling;\n\n\twhile (count--) {\n\t\tlast_sibling = next_sibling;\n\t\tnext_sibling = /** @type {TemplateNode} */ (get_next_sibling(next_sibling));\n\t}\n\n\tif (!hydrating) {\n\t\treturn next_sibling;\n\t}\n\n\tif (is_text) {\n\t\t// if a sibling {expression} is empty during SSR, there might be no\n\t\t// text node to hydrate โ€” we must therefore create one\n\t\tif (next_sibling?.nodeType !== TEXT_NODE) {\n\t\t\tvar text = create_text();\n\t\t\t// If the next sibling is `null` and we're handling text then it's because\n\t\t\t// the SSR content was empty for the text, so we need to generate a new text\n\t\t\t// node and insert it after the last sibling\n\t\t\tif (next_sibling === null) {\n\t\t\t\tlast_sibling?.after(text);\n\t\t\t} else {\n\t\t\t\tnext_sibling.before(text);\n\t\t\t}\n\t\t\tset_hydrate_node(text);\n\t\t\treturn text;\n\t\t}\n\n\t\tmerge_text_nodes(/** @type {Text} */ (next_sibling));\n\t}\n\n\tset_hydrate_node(next_sibling);\n\treturn next_sibling;\n}\n\n/**\n * @template {Node} N\n * @param {N} node\n * @returns {void}\n */\nexport function clear_text_content(node) {\n\tnode.textContent = '';\n}\n\n/**\n * Returns `true` if we're updating the current block, for example `condition` in\n * an `{#if condition}` block just changed. In this case, the branch should be\n * appended (or removed) at the same time as other updates within the\n * current ``\n */\nexport function should_defer_append() {\n\tif (!async_mode_flag) return false;\n\tif (eager_block_effects !== null) return false;\n\n\tvar flags = /** @type {Effect} */ (active_effect).f;\n\treturn (flags & REACTION_RAN) !== 0;\n}\n\n/**\n * Branching here is intentional and load-bearing for perf. `createElement(tag)`\n * hits a fast path in Blink that `createElementNS(NAMESPACE_HTML, tag)` doesn't,\n * and passing an explicit `undefined` as the trailing options arg measurably\n * slows both APIs. Funnelling every case through a single `createElementNS(ns,\n * tag, options)` call would be smaller but slower on the HTML path.\n *\n * @template {keyof HTMLElementTagNameMap | string} T\n * @param {T} tag\n * @param {string} [namespace]\n * @param {string} [is]\n * @returns {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element}\n */\nexport function create_element(tag, namespace, is) {\n\tif (namespace == null || namespace === NAMESPACE_HTML) {\n\t\treturn /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ (\n\t\t\tis ? document.createElement(tag, { is }) : document.createElement(tag)\n\t\t);\n\t}\n\treturn /** @type {T extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[T] : Element} */ (\n\t\tis ? document.createElementNS(namespace, tag, { is }) : document.createElementNS(namespace, tag)\n\t);\n}\n\nexport function create_fragment() {\n\treturn document.createDocumentFragment();\n}\n\n/**\n * @param {string} data\n * @returns\n */\nexport function create_comment(data = '') {\n\treturn document.createComment(data);\n}\n\n/**\n * @param {Element} element\n * @param {string} key\n * @param {string} value\n * @returns\n */\nexport function set_attribute(element, key, value = '') {\n\tif (key.startsWith('xlink:')) {\n\t\telement.setAttributeNS('http://www.w3.org/1999/xlink', key, value);\n\t\treturn;\n\t}\n\treturn element.setAttribute(key, value);\n}\n\n/**\n * Browsers split text nodes larger than 65536 bytes when parsing.\n * For hydration to succeed, we need to stitch them back together\n * @param {Text} text\n */\nexport function merge_text_nodes(text) {\n\tif (/** @type {string} */ (text.nodeValue).length < 65536) {\n\t\treturn;\n\t}\n\n\tlet next = text.nextSibling;\n\n\twhile (next !== null && next.nodeType === TEXT_NODE) {\n\t\tnext.remove();\n\n\t\t/** @type {string} */ (text.nodeValue) += /** @type {string} */ (next.nodeValue);\n\n\t\tnext = text.nextSibling;\n\t}\n}\n","/** @import { Derived, Effect } from '#client' */\n/** @import { Boundary } from './dom/blocks/boundary.js' */\nimport { DEV } from 'esm-env';\nimport { FILENAME, HYDRATION_ERROR } from '../../constants.js';\nimport { is_firefox } from './dom/operations.js';\nimport {\n\tERROR_VALUE,\n\tBOUNDARY_EFFECT,\n\tREACTION_RAN,\n\tEFFECT,\n\tDESTROYED,\n\tDESTROYING\n} from './constants.js';\nimport { define_property, get_descriptor } from '../shared/utils.js';\nimport { active_effect, active_reaction } from './runtime.js';\n\nconst adjustments = new WeakMap();\n\n/**\n * @param {unknown} error\n */\nexport function handle_error(error) {\n\tvar effect = active_effect;\n\n\t// for unowned deriveds, don't throw until we read the value\n\tif (effect === null) {\n\t\t/** @type {Derived} */ (active_reaction).f |= ERROR_VALUE;\n\t\treturn error;\n\t}\n\n\tif (DEV && error instanceof Error && !adjustments.has(error)) {\n\t\tadjustments.set(error, get_adjustments(error, effect));\n\t}\n\n\t// if the error occurred while creating this subtree, we let it\n\t// bubble up until it hits a boundary that can handle it, unless\n\t// it's an $effect in which case it doesn't run immediately\n\tif ((effect.f & REACTION_RAN) === 0 && (effect.f & EFFECT) === 0) {\n\t\tif (DEV && !effect.parent && error instanceof Error) {\n\t\t\tapply_adjustments(error);\n\t\t}\n\n\t\tthrow error;\n\t}\n\n\t// otherwise we bubble up the effect tree ourselves\n\tinvoke_error_boundary(error, effect);\n}\n\n/**\n * @param {unknown} error\n * @param {Effect | null} effect\n */\nexport function invoke_error_boundary(error, effect) {\n\tif (error === HYDRATION_ERROR) {\n\t\tthrow error;\n\t}\n\n\tif (effect !== null && (effect.f & DESTROYED) !== 0) {\n\t\treturn;\n\t}\n\n\twhile (effect !== null) {\n\t\t// Skip boundaries that are destroyed/destroying and cannot meaningfully handle the error.\n\t\tif ((effect.f & BOUNDARY_EFFECT) !== 0 && (effect.f & (DESTROYED | DESTROYING)) === 0) {\n\t\t\tif ((effect.f & REACTION_RAN) === 0) {\n\t\t\t\t// we are still creating the boundary effect\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t/** @type {Boundary} */ (effect.b).error(error);\n\t\t\t\treturn;\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\n\t\teffect = effect.parent;\n\t}\n\n\tif (DEV && error instanceof Error) {\n\t\tapply_adjustments(error);\n\t}\n\n\tthrow error;\n}\n\n/**\n * Add useful information to the error message/stack in development\n * @param {Error} error\n * @param {Effect} effect\n */\nfunction get_adjustments(error, effect) {\n\tconst message_descriptor = get_descriptor(error, 'message');\n\n\t// if the message was already changed and it's not configurable we can't change it\n\t// or it will throw a different error swallowing the original error\n\tif (message_descriptor && !message_descriptor.configurable) return;\n\n\tvar indent = is_firefox ? ' ' : '\\t';\n\tvar component_stack = `\\n${indent}in ${effect.fn?.name || ''}`;\n\tvar context = effect.ctx;\n\n\twhile (context !== null) {\n\t\tcomponent_stack += `\\n${indent}in ${context.function?.[FILENAME].split('/').pop()}`;\n\t\tcontext = context.p;\n\t}\n\n\treturn {\n\t\tmessage: error.message + `\\n${component_stack}\\n`,\n\t\tstack: error.stack\n\t\t\t?.split('\\n')\n\t\t\t.filter((line) => !line.includes('svelte/src/internal'))\n\t\t\t.join('\\n')\n\t};\n}\n\n/**\n * @param {Error} error\n */\nfunction apply_adjustments(error) {\n\tconst adjusted = adjustments.get(error);\n\n\tif (adjusted) {\n\t\tdefine_property(error, 'message', {\n\t\t\tvalue: adjusted.message\n\t\t});\n\n\t\tdefine_property(error, 'stack', {\n\t\t\tvalue: adjusted.stack\n\t\t});\n\t}\n}\n","/** @import { Blocker, ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */\nimport {\n\tis_dirty,\n\tactive_effect,\n\tactive_reaction,\n\tupdate_effect,\n\tget,\n\tis_destroying_effect,\n\tremove_reactions,\n\tset_active_reaction,\n\tset_is_destroying_effect,\n\tuntrack,\n\tuntracking,\n\tset_active_effect\n} from '../runtime.js';\nimport {\n\tDIRTY,\n\tBRANCH_EFFECT,\n\tRENDER_EFFECT,\n\tEFFECT,\n\tDESTROYED,\n\tINERT,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tEFFECT_TRANSPARENT,\n\tDERIVED,\n\tCLEAN,\n\tEAGER_EFFECT,\n\tHEAD_EFFECT,\n\tMAYBE_DIRTY,\n\tEFFECT_PRESERVED,\n\tSTALE_REACTION,\n\tUSER_EFFECT,\n\tASYNC,\n\tCONNECTED,\n\tMANAGED_EFFECT,\n\tDESTROYING,\n\tPAUSED\n} from '#client/constants';\nimport { invoke_error_boundary } from '../error-handling.js';\nimport * as e from '../errors.js';\nimport { DEV } from 'esm-env';\nimport { define_property } from '../../shared/utils.js';\nimport { get_next_sibling } from '../dom/operations.js';\nimport { component_context, dev_current_component_function, dev_stack } from '../context.js';\nimport { Batch, collected_effects, current_batch } from './batch.js';\nimport { flatten } from './async.js';\nimport { without_reactive_context } from '../dom/elements/bindings/shared.js';\nimport { set_signal_status } from './status.js';\n\n/**\n * @param {'$effect' | '$effect.pre' | '$inspect'} rune\n */\nexport function validate_effect(rune) {\n\tif (active_effect === null) {\n\t\tif (active_reaction === null) {\n\t\t\te.effect_orphan(rune);\n\t\t}\n\n\t\te.effect_in_unowned_derived();\n\t}\n\n\tif (is_destroying_effect) {\n\t\te.effect_in_teardown(rune);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {Effect} parent_effect\n */\nfunction push_effect(effect, parent_effect) {\n\tvar parent_last = parent_effect.last;\n\tif (parent_last === null) {\n\t\tparent_effect.last = parent_effect.first = effect;\n\t} else {\n\t\tparent_last.next = effect;\n\t\teffect.prev = parent_last;\n\t\tparent_effect.last = effect;\n\t}\n}\n\n/**\n * @param {number} type\n * @param {null | (() => void | (() => void))} fn\n * @returns {Effect}\n */\nfunction create_effect(type, fn) {\n\tvar parent = active_effect;\n\n\tif (DEV) {\n\t\t// Ensure the parent is never an inspect effect\n\t\twhile (parent !== null && (parent.f & EAGER_EFFECT) !== 0) {\n\t\t\tparent = parent.parent;\n\t\t}\n\t}\n\n\tif (parent !== null && (parent.f & INERT) !== 0) {\n\t\ttype |= INERT;\n\t}\n\n\t/** @type {Effect} */\n\tvar effect = {\n\t\tctx: component_context,\n\t\tdeps: null,\n\t\tnodes: null,\n\t\tf: type | DIRTY | CONNECTED,\n\t\tfirst: null,\n\t\tfn,\n\t\tlast: null,\n\t\tnext: null,\n\t\tparent,\n\t\tb: parent && parent.b,\n\t\tprev: null,\n\t\tteardown: null,\n\t\twv: 0,\n\t\tac: null\n\t};\n\n\tif (DEV) {\n\t\teffect.component_function = dev_current_component_function;\n\t}\n\n\tcurrent_batch?.register_created_effect(effect);\n\n\t/** @type {Effect | null} */\n\tvar e = effect;\n\n\tif ((type & EFFECT) !== 0) {\n\t\tif (collected_effects !== null) {\n\t\t\t// created during traversal โ€” collect and run afterwards\n\t\t\tcollected_effects.push(effect);\n\t\t} else {\n\t\t\t// schedule for later\n\t\t\tBatch.ensure().schedule(effect);\n\t\t}\n\t} else if (fn !== null) {\n\t\ttry {\n\t\t\tupdate_effect(effect);\n\t\t} catch (e) {\n\t\t\tdestroy_effect(effect);\n\t\t\tthrow e;\n\t\t}\n\n\t\t// if an effect doesn't need to be kept in the tree (because it\n\t\t// won't re-run, has no DOM, and has no teardown etc)\n\t\t// then we skip it and go to its child (if any)\n\t\tif (\n\t\t\te.deps === null &&\n\t\t\te.teardown === null &&\n\t\t\te.nodes === null &&\n\t\t\te.first === e.last && // either `null`, or a singular child\n\t\t\t(e.f & EFFECT_PRESERVED) === 0\n\t\t) {\n\t\t\te = e.first;\n\t\t\tif ((type & BLOCK_EFFECT) !== 0 && (type & EFFECT_TRANSPARENT) !== 0 && e !== null) {\n\t\t\t\te.f |= EFFECT_TRANSPARENT;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (e !== null) {\n\t\te.parent = parent;\n\n\t\tif (parent !== null) {\n\t\t\tpush_effect(e, parent);\n\t\t}\n\n\t\t// if we're in a derived, add the effect there too\n\t\tif (\n\t\t\tactive_reaction !== null &&\n\t\t\t(active_reaction.f & DERIVED) !== 0 &&\n\t\t\t(type & ROOT_EFFECT) === 0\n\t\t) {\n\t\t\tvar derived = /** @type {Derived} */ (active_reaction);\n\t\t\t(derived.effects ??= []).push(e);\n\t\t}\n\t}\n\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect.tracking()`\n * @returns {boolean}\n */\nexport function effect_tracking() {\n\treturn active_reaction !== null && !untracking;\n}\n\n/**\n * @param {() => void} fn\n */\nexport function teardown(fn) {\n\tconst effect = create_effect(RENDER_EFFECT, null);\n\tset_signal_status(effect, CLEAN);\n\teffect.teardown = fn;\n\treturn effect;\n}\n\n/**\n * Internal representation of `$effect(...)`\n * @param {() => void | (() => void)} fn\n */\nexport function user_effect(fn) {\n\tvalidate_effect('$effect');\n\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect'\n\t\t});\n\t}\n\n\t// Non-nested `$effect(...)` in a component should be deferred\n\t// until the component is mounted\n\tvar flags = /** @type {Effect} */ (active_effect).f;\n\tvar defer =\n\t\t!active_reaction &&\n\t\t(flags & BRANCH_EFFECT) !== 0 &&\n\t\tcomponent_context !== null &&\n\t\t!component_context.i;\n\n\tif (defer) {\n\t\t// Top-level `$effect(...)` in an unmounted component โ€” defer until mount\n\t\tvar context = /** @type {ComponentContext} */ (component_context);\n\t\t(context.e ??= []).push(fn);\n\t} else {\n\t\t// Everything else โ€” create immediately\n\t\treturn create_user_effect(fn);\n\t}\n}\n\n/**\n * @param {() => void | (() => void)} fn\n */\nexport function create_user_effect(fn) {\n\treturn create_effect(EFFECT | USER_EFFECT, fn);\n}\n\n/**\n * Internal representation of `$effect.pre(...)`\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function user_pre_effect(fn) {\n\tvalidate_effect('$effect.pre');\n\tif (DEV) {\n\t\tdefine_property(fn, 'name', {\n\t\t\tvalue: '$effect.pre'\n\t\t});\n\t}\n\treturn create_effect(RENDER_EFFECT | USER_EFFECT, fn);\n}\n\n/** @param {() => void | (() => void)} fn */\nexport function eager_effect(fn) {\n\treturn create_effect(EAGER_EFFECT, fn);\n}\n\n/**\n * Internal representation of `$effect.root(...)`\n * @param {() => void | (() => void)} fn\n * @returns {() => void}\n */\nexport function effect_root(fn) {\n\tBatch.ensure();\n\tconst effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn);\n\n\treturn () => {\n\t\tdestroy_effect(effect);\n\t};\n}\n\n/**\n * An effect root whose children can transition out\n * @param {() => void} fn\n * @returns {(options?: { outro?: boolean }) => Promise}\n */\nexport function component_root(fn) {\n\tBatch.ensure();\n\tconst effect = create_effect(ROOT_EFFECT | EFFECT_PRESERVED, fn);\n\n\treturn (options = {}) => {\n\t\treturn new Promise((fulfil) => {\n\t\t\tif (options.outro) {\n\t\t\t\tpause_effect(effect, () => {\n\t\t\t\t\tdestroy_effect(effect);\n\t\t\t\t\tfulfil(undefined);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tdestroy_effect(effect);\n\t\t\t\tfulfil(undefined);\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function effect(fn) {\n\treturn create_effect(EFFECT, fn);\n}\n\n/**\n * Internal representation of `$: ..`\n * @param {() => any} deps\n * @param {() => void | (() => void)} fn\n */\nexport function legacy_pre_effect(deps, fn) {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\t/** @type {{ effect: null | Effect, ran: boolean, deps: () => any }} */\n\tvar token = { effect: null, ran: false, deps };\n\n\tcontext.l.$.push(token);\n\n\ttoken.effect = render_effect(() => {\n\t\tdeps();\n\n\t\t// If this legacy pre effect has already run before the end of the reset, then\n\t\t// bail out to emulate the same behavior.\n\t\tif (token.ran) return;\n\n\t\ttoken.ran = true;\n\n\t\tvar effect = /** @type {Effect} */ (active_effect);\n\n\t\t// here, we lie: by setting `active_effect` to be the parent branch, any writes\n\t\t// that happen inside `fn` will _not_ cause an unnecessary reschedule, because\n\t\t// the affected effects will be children of `active_effect`. this is safe\n\t\t// because these effects are known to run in the correct order\n\t\ttry {\n\t\t\tset_active_effect(effect.parent);\n\t\t\tuntrack(fn);\n\t\t} finally {\n\t\t\tset_active_effect(effect);\n\t\t}\n\t});\n}\n\nexport function legacy_pre_effect_reset() {\n\tvar context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\trender_effect(() => {\n\t\t// Run dirty `$:` statements\n\t\tfor (var token of context.l.$) {\n\t\t\ttoken.deps();\n\n\t\t\tvar effect = token.effect;\n\n\t\t\t// If the effect is CLEAN, then make it MAYBE_DIRTY. This ensures we traverse through\n\t\t\t// the effects dependencies and correctly ensure each dependency is up-to-date.\n\t\t\tif ((effect.f & CLEAN) !== 0 && effect.deps !== null) {\n\t\t\t\tset_signal_status(effect, MAYBE_DIRTY);\n\t\t\t}\n\n\t\t\tif (is_dirty(effect)) {\n\t\t\t\tupdate_effect(effect);\n\t\t\t}\n\n\t\t\ttoken.ran = false;\n\t\t}\n\t});\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function async_effect(fn) {\n\treturn create_effect(ASYNC | EFFECT_PRESERVED, fn);\n}\n\n/**\n * @param {() => void | (() => void)} fn\n * @returns {Effect}\n */\nexport function render_effect(fn, flags = 0) {\n\treturn create_effect(RENDER_EFFECT | flags, fn);\n}\n\n/**\n * @param {(...expressions: any) => void | (() => void)} fn\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise>} async\n * @param {Blocker[]} blockers\n */\nexport function template_effect(fn, sync = [], async = [], blockers = []) {\n\tflatten(blockers, sync, async, (values) => {\n\t\tcreate_effect(RENDER_EFFECT, () => {\n\t\t\tfn(...values.map(get));\n\t\t});\n\t});\n}\n\n/**\n * Like `template_effect`, but with an effect which is deferred until the batch commits\n * @param {(...expressions: any) => void | (() => void)} fn\n * @param {Array<() => any>} sync\n * @param {Array<() => Promise>} async\n * @param {Blocker[]} blockers\n */\nexport function deferred_template_effect(fn, sync = [], async = [], blockers = []) {\n\tflatten(blockers, sync, async, (values) => {\n\t\tcreate_effect(EFFECT, () => fn(...values.map(get)));\n\t});\n}\n\n/**\n * @param {(() => void)} fn\n * @param {number} flags\n */\nexport function block(fn, flags = 0) {\n\tvar effect = create_effect(BLOCK_EFFECT | flags, fn);\n\tif (DEV) {\n\t\teffect.dev_stack = dev_stack;\n\t}\n\treturn effect;\n}\n\n/**\n * @param {(() => void)} fn\n * @param {number} flags\n */\nexport function managed(fn, flags = 0) {\n\tvar effect = create_effect(MANAGED_EFFECT | flags, fn);\n\tif (DEV) {\n\t\teffect.dev_stack = dev_stack;\n\t}\n\treturn effect;\n}\n\n/**\n * @param {(() => void)} fn\n */\nexport function branch(fn) {\n\treturn create_effect(BRANCH_EFFECT | EFFECT_PRESERVED, fn);\n}\n\n/**\n * @param {Effect} effect\n */\nexport function execute_effect_teardown(effect) {\n\tvar teardown = effect.teardown;\n\tif (teardown !== null) {\n\t\tconst previously_destroying_effect = is_destroying_effect;\n\t\tconst previous_reaction = active_reaction;\n\t\tset_is_destroying_effect(true);\n\t\tset_active_reaction(null);\n\t\ttry {\n\t\t\tteardown.call(null);\n\t\t} catch (error) {\n\t\t\t// Route teardown errors through the boundary system so that a live\n\t\t\t// ancestor can handle them. Boundaries that are\n\t\t\t// themselves mid-teardown are skipped by invoke_error_boundary.\n\t\t\tinvoke_error_boundary(error, effect.parent);\n\t\t} finally {\n\t\t\tset_is_destroying_effect(previously_destroying_effect);\n\t\t\tset_active_reaction(previous_reaction);\n\t\t}\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @param {boolean} remove_dom\n * @returns {void}\n */\nexport function destroy_effect_children(signal, remove_dom = false) {\n\tvar effect = signal.first;\n\tsignal.first = signal.last = null;\n\n\twhile (effect !== null) {\n\t\tconst controller = effect.ac;\n\n\t\tif (controller !== null) {\n\t\t\twithout_reactive_context(() => {\n\t\t\t\tcontroller.abort(STALE_REACTION);\n\t\t\t});\n\t\t}\n\n\t\tvar next = effect.next;\n\n\t\tif ((effect.f & ROOT_EFFECT) !== 0) {\n\t\t\t// this is now an independent root\n\t\t\teffect.parent = null;\n\t\t} else {\n\t\t\tdestroy_effect(effect, remove_dom);\n\t\t}\n\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} signal\n * @returns {void}\n */\nexport function destroy_block_effect_children(signal) {\n\tvar effect = signal.first;\n\n\twhile (effect !== null) {\n\t\tvar next = effect.next;\n\t\tif ((effect.f & BRANCH_EFFECT) === 0) {\n\t\t\tdestroy_effect(effect);\n\t\t}\n\t\teffect = next;\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} [remove_dom]\n * @returns {void}\n */\nexport function destroy_effect(effect, remove_dom = true) {\n\tvar removed = false;\n\n\tif (\n\t\t(remove_dom || (effect.f & HEAD_EFFECT) !== 0) &&\n\t\teffect.nodes !== null &&\n\t\teffect.nodes.end !== null\n\t) {\n\t\tremove_effect_dom(effect.nodes.start, /** @type {TemplateNode} */ (effect.nodes.end));\n\t\tremoved = true;\n\t}\n\n\teffect.f |= DESTROYING;\n\tdestroy_effect_children(effect, remove_dom && !removed);\n\tremove_reactions(effect, 0);\n\n\tvar transitions = effect.nodes && effect.nodes.t;\n\n\tif (transitions !== null) {\n\t\tfor (const transition of transitions) {\n\t\t\ttransition.stop();\n\t\t}\n\t}\n\n\texecute_effect_teardown(effect);\n\n\teffect.f ^= DESTROYING;\n\teffect.f |= DESTROYED;\n\n\tvar parent = effect.parent;\n\n\t// If the parent doesn't have any children, then skip this work altogether\n\tif (parent !== null && parent.first !== null) {\n\t\tunlink_effect(effect);\n\t}\n\n\tif (DEV) {\n\t\teffect.component_function = null;\n\t}\n\n\t// `first` and `child` are nulled out in destroy_effect_children\n\t// we don't null out `parent` so that error propagation can work correctly\n\teffect.next =\n\t\teffect.prev =\n\t\teffect.teardown =\n\t\teffect.ctx =\n\t\teffect.deps =\n\t\teffect.fn =\n\t\teffect.nodes =\n\t\teffect.ac =\n\t\teffect.b =\n\t\t\tnull;\n}\n\n/**\n *\n * @param {TemplateNode | null} node\n * @param {TemplateNode} end\n */\nexport function remove_effect_dom(node, end) {\n\twhile (node !== null) {\n\t\t/** @type {TemplateNode | null} */\n\t\tvar next = node === end ? null : get_next_sibling(node);\n\n\t\tnode.remove();\n\t\tnode = next;\n\t}\n}\n\n/**\n * Detach an effect from the effect tree, freeing up memory and\n * reducing the amount of work that happens on subsequent traversals\n * @param {Effect} effect\n */\nexport function unlink_effect(effect) {\n\tvar parent = effect.parent;\n\tvar prev = effect.prev;\n\tvar next = effect.next;\n\n\tif (prev !== null) prev.next = next;\n\tif (next !== null) next.prev = prev;\n\n\tif (parent !== null) {\n\t\tif (parent.first === effect) parent.first = next;\n\t\tif (parent.last === effect) parent.last = prev;\n\t}\n}\n\n/**\n * When a block effect is removed, we don't immediately destroy it or yank it\n * out of the DOM, because it might have transitions. Instead, we 'pause' it.\n * It stays around (in memory, and in the DOM) until outro transitions have\n * completed, and if the state change is reversed then we _resume_ it.\n * A paused effect does not update, and the DOM subtree becomes inert.\n * @param {Effect} effect\n * @param {() => void} [callback]\n * @param {boolean} [destroy]\n */\nexport function pause_effect(effect, callback, destroy = true) {\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\n\teffect.f |= PAUSED;\n\tpause_children(effect, transitions, true);\n\n\tvar fn = () => {\n\t\tif (destroy) destroy_effect(effect);\n\t\tif (callback) callback();\n\t};\n\n\tvar remaining = transitions.length;\n\tif (remaining > 0) {\n\t\tvar check = () => --remaining || fn();\n\t\tfor (var transition of transitions) {\n\t\t\ttransition.out(check);\n\t\t}\n\t} else {\n\t\tfn();\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @param {TransitionManager[]} transitions\n * @param {boolean} local\n */\nfunction pause_children(effect, transitions, local) {\n\tif ((effect.f & INERT) !== 0) return;\n\teffect.f ^= INERT;\n\n\tvar t = effect.nodes && effect.nodes.t;\n\n\tif (t !== null) {\n\t\tfor (const transition of t) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransitions.push(transition);\n\t\t\t}\n\t\t}\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\n\t\t// If this child is a root effect, then it will become an independent root when its parent\n\t\t// is destroyed, it should therefore not become inert nor partake in transitions.\n\t\tif ((child.f & ROOT_EFFECT) === 0) {\n\t\t\tvar transparent =\n\t\t\t\t(child.f & EFFECT_TRANSPARENT) !== 0 ||\n\t\t\t\t// If this is a branch effect without a block effect parent,\n\t\t\t\t// it means the parent block effect was pruned. In that case,\n\t\t\t\t// transparency information was transferred to the branch effect.\n\t\t\t\t((child.f & BRANCH_EFFECT) !== 0 && (effect.f & BLOCK_EFFECT) !== 0);\n\t\t\t// TODO we don't need to call pause_children recursively with a linked list in place\n\t\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t\t// through the tree.\n\t\t\tpause_children(child, transitions, transparent ? local : false);\n\t\t}\n\n\t\tchild = sibling;\n\t}\n}\n\n/**\n * The opposite of `pause_effect`. We call this if (for example)\n * `x` becomes falsy then truthy: `{#if x}...{/if}`\n * @param {Effect} effect\n */\nexport function resume_effect(effect) {\n\teffect.f &= ~PAUSED;\n\tresume_children(effect, true);\n}\n\n/**\n * @param {Effect} effect\n * @param {boolean} local\n */\nfunction resume_children(effect, local) {\n\t// this subtree was paused for its own reasons (e.g. a block whose condition\n\t// is still false) โ€” its controller will resume or destroy it\n\tif ((effect.f & PAUSED) !== 0) return;\n\n\tif ((effect.f & INERT) === 0) return;\n\teffect.f ^= INERT;\n\n\t// If a dependency of this effect changed while it was paused,\n\t// schedule the effect to update. we don't use `is_dirty`\n\t// here because we don't want to eagerly recompute a derived like\n\t// `{#if foo}{foo.bar()}{/if}` if `foo` is now `undefined\n\tif ((effect.f & CLEAN) === 0) {\n\t\tset_signal_status(effect, DIRTY);\n\t\tBatch.ensure().schedule(effect); // Assumption: This happens during the commit phase of the batch, causing another flush, but it's safe\n\t}\n\n\tvar child = effect.first;\n\n\twhile (child !== null) {\n\t\tvar sibling = child.next;\n\t\tvar transparent = (child.f & EFFECT_TRANSPARENT) !== 0 || (child.f & BRANCH_EFFECT) !== 0;\n\t\t// TODO we don't need to call resume_children recursively with a linked list in place\n\t\t// it's slightly more involved though as we have to account for `transparent` changing\n\t\t// through the tree.\n\t\tresume_children(child, transparent ? local : false);\n\t\tchild = sibling;\n\t}\n\n\tvar t = effect.nodes && effect.nodes.t;\n\n\tif (t !== null) {\n\t\tfor (const transition of t) {\n\t\t\tif (transition.is_global || local) {\n\t\t\t\ttransition.in();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport function aborted(effect = /** @type {Effect} */ (active_effect)) {\n\treturn (effect.f & DESTROYED) !== 0;\n}\n\n/**\n * @param {Effect} effect\n * @param {DocumentFragment} fragment\n */\nexport function move_effect(effect, fragment) {\n\tif (!effect.nodes) return;\n\n\t/** @type {TemplateNode | null} */\n\tvar node = effect.nodes.start;\n\tvar end = effect.nodes.end;\n\n\twhile (node !== null) {\n\t\t/** @type {TemplateNode | null} */\n\t\tvar next = node === end ? null : get_next_sibling(node);\n\n\t\tfragment.append(node);\n\t\tnode = next;\n\t}\n}\n","/** @import { Value } from '#client' */\nimport { internal_set } from './reactivity/sources.js';\nimport { untrack } from './runtime.js';\n\n/**\n * @type {Set | null}\n * @deprecated\n */\nexport let captured_signals = null;\n\n/**\n * Capture an array of all the signals that are read when `fn` is called\n * @template T\n * @param {() => T} fn\n */\nfunction capture_signals(fn) {\n\tvar previous_captured_signals = captured_signals;\n\n\ttry {\n\t\tcaptured_signals = new Set();\n\n\t\tuntrack(fn);\n\n\t\tif (previous_captured_signals !== null) {\n\t\t\tfor (var signal of captured_signals) {\n\t\t\t\tprevious_captured_signals.add(signal);\n\t\t\t}\n\t\t}\n\n\t\treturn captured_signals;\n\t} finally {\n\t\tcaptured_signals = previous_captured_signals;\n\t}\n}\n\n/**\n * Invokes a function and captures all signals that are read during the invocation,\n * then invalidates them.\n * @param {() => any} fn\n * @deprecated\n */\nexport function invalidate_inner_signals(fn) {\n\tfor (var signal of capture_signals(fn)) {\n\t\tinternal_set(signal, signal.v);\n\t}\n}\n","/** @import { Derived, Effect, Reaction, Source, Value } from '#client' */\nimport { DEV } from 'esm-env';\nimport { get_descriptors, get_prototype_of, includes, index_of } from '../shared/utils.js';\nimport {\n\tdestroy_block_effect_children,\n\tdestroy_effect_children,\n\teffect_tracking,\n\texecute_effect_teardown\n} from './reactivity/effects.js';\nimport {\n\tDIRTY,\n\tMAYBE_DIRTY,\n\tCLEAN,\n\tDERIVED,\n\tDESTROYED,\n\tBRANCH_EFFECT,\n\tSTATE_SYMBOL,\n\tBLOCK_EFFECT,\n\tROOT_EFFECT,\n\tCONNECTED,\n\tREACTION_IS_UPDATING,\n\tSTALE_REACTION,\n\tERROR_VALUE,\n\tMANAGED_EFFECT,\n\tREACTION_RAN\n} from './constants.js';\nimport { old_values } from './reactivity/sources.js';\nimport {\n\treactivity_loss_tracker,\n\texecute_derived,\n\tfreeze_derived_effects,\n\trecent_async_deriveds,\n\tunfreeze_derived_effects,\n\tupdate_derived\n} from './reactivity/deriveds.js';\nimport { async_mode_flag, tracing_mode_flag } from '../flags/index.js';\nimport { tracing_expressions } from './dev/tracing.js';\nimport { get_error } from '../shared/dev.js';\nimport {\n\tcomponent_context,\n\tdev_current_component_function,\n\tdev_stack,\n\tis_runes,\n\tset_component_context,\n\tset_dev_current_component_function,\n\tset_dev_stack\n} from './context.js';\nimport {\n\tBatch,\n\tbatch_values,\n\tcurrent_batch,\n\tflushSync,\n\tprevious_batch,\n\tschedule_effect\n} from './reactivity/batch.js';\nimport { handle_error } from './error-handling.js';\nimport { UNINITIALIZED } from '../../constants.js';\nimport { captured_signals } from './legacy.js';\nimport { without_reactive_context } from './dom/elements/bindings/shared.js';\nimport { set_signal_status, update_derived_status } from './reactivity/status.js';\nimport * as w from './warnings.js';\n\nexport let is_destroying_effect = false;\n\n/** @param {boolean} value */\nexport function set_is_destroying_effect(value) {\n\tis_destroying_effect = value;\n}\n\n/** @type {null | Reaction} */\nexport let active_reaction = null;\n\nexport let untracking = false;\n\n/** @param {null | Reaction} reaction */\nexport function set_active_reaction(reaction) {\n\tactive_reaction = reaction;\n}\n\n/** @type {null | Effect} */\nexport let active_effect = null;\n\n/** @param {null | Effect} effect */\nexport function set_active_effect(effect) {\n\tactive_effect = effect;\n}\n\n/**\n * When sources are created within a reaction, reading and writing\n * them within that reaction should not cause a re-run\n * @type {null | Set}\n */\nexport let current_sources = null;\n\n/** @param {Value} value */\nexport function push_reaction_value(value) {\n\tif (\n\t\tactive_reaction !== null &&\n\t\t((!async_mode_flag && (active_reaction.f & REACTION_IS_UPDATING) !== 0) ||\n\t\t\t(active_reaction.f & DERIVED) !== 0)\n\t) {\n\t\t(current_sources ??= new Set()).add(value);\n\t}\n}\n\n/**\n * The dependencies of the reaction that is currently being executed. In many cases,\n * the dependencies are unchanged between runs, and so this will be `null` unless\n * and until a new dependency is accessed โ€” we track this via `skipped_deps`\n * @type {null | Value[]}\n */\nexport let new_deps = null;\n\nexport let skipped_deps = 0;\n\n/**\n * Tracks writes that the effect it's executed in doesn't listen to yet,\n * so that the dependency can be added to the effect later on if it then reads it\n * @type {null | Value[]}\n */\nexport let untracked_writes = null;\n\n/** @param {null | Value[]} value */\nexport function set_untracked_writes(value) {\n\tuntracked_writes = value;\n}\n\n/**\n * @type {number} Used by sources and deriveds for handling updates.\n * Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing\n **/\nexport let write_version = 1;\n\n/** @type {number} Used to version each read of a source of derived to avoid duplicating dependencies inside a reaction */\nlet read_version = 0;\n\nexport let update_version = read_version;\n\n/** @param {number} value */\nexport function set_update_version(value) {\n\tupdate_version = value;\n}\n\nexport function increment_write_version() {\n\treturn ++write_version;\n}\n\n/**\n * Determines whether a derived or effect is dirty.\n * If it is MAYBE_DIRTY, will set the status to CLEAN\n * @param {Reaction} reaction\n * @returns {boolean}\n */\nexport function is_dirty(reaction) {\n\tvar flags = reaction.f;\n\n\tif ((flags & DIRTY) !== 0) {\n\t\treturn true;\n\t}\n\n\tif ((flags & MAYBE_DIRTY) !== 0) {\n\t\tvar dependencies = /** @type {Value[]} */ (reaction.deps);\n\t\tvar length = dependencies.length;\n\n\t\tfor (var i = 0; i < length; i++) {\n\t\t\tvar dependency = dependencies[i];\n\n\t\t\tif (is_dirty(/** @type {Derived} */ (dependency))) {\n\t\t\t\tupdate_derived(/** @type {Derived} */ (dependency));\n\t\t\t}\n\n\t\t\tif (dependency.wv > reaction.wv) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t(flags & CONNECTED) !== 0 &&\n\t\t\t// During time traveling we don't want to reset the status so that\n\t\t\t// traversal of the graph in the other batches still happens\n\t\t\tbatch_values === null\n\t\t) {\n\t\t\tset_signal_status(reaction, CLEAN);\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * @param {Value} signal\n * @param {Effect} effect\n * @param {boolean} [root]\n */\nfunction schedule_possible_effect_self_invalidation(signal, effect, root = true) {\n\tvar reactions = signal.reactions;\n\tif (reactions === null) return;\n\n\tif (!async_mode_flag && current_sources !== null && current_sources.has(signal)) {\n\t\treturn;\n\t}\n\n\tfor (var i = 0; i < reactions.length; i++) {\n\t\tvar reaction = reactions[i];\n\n\t\tif ((reaction.f & DERIVED) !== 0) {\n\t\t\tschedule_possible_effect_self_invalidation(/** @type {Derived} */ (reaction), effect, false);\n\t\t} else if (effect === reaction) {\n\t\t\tif (root) {\n\t\t\t\tset_signal_status(reaction, DIRTY);\n\t\t\t} else if ((reaction.f & CLEAN) !== 0) {\n\t\t\t\tset_signal_status(reaction, MAYBE_DIRTY);\n\t\t\t}\n\t\t\tschedule_effect(/** @type {Effect} */ (reaction));\n\t\t}\n\t}\n}\n\n/** @param {Reaction} reaction */\nexport function update_reaction(reaction) {\n\tvar previous_deps = new_deps;\n\tvar previous_skipped_deps = skipped_deps;\n\tvar previous_untracked_writes = untracked_writes;\n\tvar previous_reaction = active_reaction;\n\tvar previous_sources = current_sources;\n\tvar previous_component_context = component_context;\n\tvar previous_untracking = untracking;\n\tvar previous_update_version = update_version;\n\n\tvar flags = reaction.f;\n\n\tnew_deps = /** @type {null | Value[]} */ (null);\n\tskipped_deps = 0;\n\tuntracked_writes = null;\n\tactive_reaction = (flags & (BRANCH_EFFECT | ROOT_EFFECT)) === 0 ? reaction : null;\n\n\tcurrent_sources = null;\n\tset_component_context(reaction.ctx);\n\tuntracking = false;\n\tupdate_version = ++read_version;\n\n\tif (reaction.ac !== null) {\n\t\twithout_reactive_context(() => {\n\t\t\t/** @type {AbortController} */ (reaction.ac).abort(STALE_REACTION);\n\t\t});\n\n\t\treaction.ac = null;\n\t}\n\n\ttry {\n\t\treaction.f |= REACTION_IS_UPDATING;\n\t\tvar fn = /** @type {Function} */ (reaction.fn);\n\t\tvar result = fn();\n\t\treaction.f |= REACTION_RAN;\n\t\tvar deps = update_dependencies(reaction);\n\n\t\t// If we're inside an effect and we have untracked writes, then we need to\n\t\t// ensure that if any of those untracked writes result in re-invalidation\n\t\t// of the current effect, then that happens accordingly\n\t\tif (\n\t\t\tis_runes() &&\n\t\t\tuntracked_writes !== null &&\n\t\t\t!untracking &&\n\t\t\tdeps !== null &&\n\t\t\t(reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY)) === 0\n\t\t) {\n\t\t\tfor (var i = 0; i < /** @type {Source[]} */ (untracked_writes).length; i++) {\n\t\t\t\tschedule_possible_effect_self_invalidation(\n\t\t\t\t\tuntracked_writes[i],\n\t\t\t\t\t/** @type {Effect} */ (reaction)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// If we are returning to an previous reaction then\n\t\t// we need to increment the read version to ensure that\n\t\t// any dependencies in this reaction aren't marked with\n\t\t// the same version\n\t\tif (previous_reaction !== null && previous_reaction !== reaction) {\n\t\t\tread_version++;\n\n\t\t\t// update the `rv` of the previous reaction's deps โ€” both existing and new โ€”\n\t\t\t// so that they are not added again\n\t\t\tif (previous_reaction.deps !== null) {\n\t\t\t\tfor (let i = 0; i < previous_skipped_deps; i += 1) {\n\t\t\t\t\tprevious_reaction.deps[i].rv = read_version;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (previous_deps !== null) {\n\t\t\t\tfor (const dep of previous_deps) {\n\t\t\t\t\tdep.rv = read_version;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (untracked_writes !== null) {\n\t\t\t\tif (previous_untracked_writes === null) {\n\t\t\t\t\tprevious_untracked_writes = untracked_writes;\n\t\t\t\t} else {\n\t\t\t\t\tprevious_untracked_writes.push(.../** @type {Source[]} */ (untracked_writes));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ((reaction.f & ERROR_VALUE) !== 0) {\n\t\t\treaction.f ^= ERROR_VALUE;\n\t\t}\n\n\t\treturn result;\n\t} catch (error) {\n\t\t// still commit the deps read before the throw, otherwise deriveds connected by this run keep no reader and the reaction never re-runs when they change\n\t\tupdate_dependencies(reaction);\n\n\t\treturn handle_error(error);\n\t} finally {\n\t\treaction.f ^= REACTION_IS_UPDATING;\n\t\tnew_deps = previous_deps;\n\t\tskipped_deps = previous_skipped_deps;\n\t\tuntracked_writes = previous_untracked_writes;\n\t\tactive_reaction = previous_reaction;\n\t\tcurrent_sources = previous_sources;\n\t\tset_component_context(previous_component_context);\n\t\tuntracking = previous_untracking;\n\t\tupdate_version = previous_update_version;\n\t}\n}\n\n/**\n * @param {Reaction} reaction\n */\nfunction update_dependencies(reaction) {\n\tvar deps = reaction.deps;\n\n\t// Don't remove reactions during fork;\n\t// they must remain for when fork is discarded\n\tvar is_fork = current_batch?.is_fork;\n\n\tif (new_deps !== null) {\n\t\tvar i;\n\n\t\tif (!is_fork) {\n\t\t\tremove_reactions(reaction, skipped_deps);\n\t\t}\n\n\t\tif (deps !== null && skipped_deps > 0) {\n\t\t\tdeps.length = skipped_deps + new_deps.length;\n\t\t\tfor (i = 0; i < new_deps.length; i++) {\n\t\t\t\tdeps[skipped_deps + i] = new_deps[i];\n\t\t\t}\n\t\t} else {\n\t\t\treaction.deps = deps = new_deps;\n\t\t}\n\n\t\tif (effect_tracking() && (reaction.f & CONNECTED) !== 0) {\n\t\t\tfor (i = skipped_deps; i < deps.length; i++) {\n\t\t\t\t(deps[i].reactions ??= []).push(reaction);\n\t\t\t}\n\t\t}\n\t} else if (!is_fork && deps !== null && skipped_deps < deps.length) {\n\t\tremove_reactions(reaction, skipped_deps);\n\t\tdeps.length = skipped_deps;\n\t}\n\n\treturn deps;\n}\n\n/**\n * @template V\n * @param {Reaction} signal\n * @param {Value} dependency\n * @returns {void}\n */\nfunction remove_reaction(signal, dependency) {\n\tlet reactions = dependency.reactions;\n\tif (reactions !== null) {\n\t\tvar index = index_of.call(reactions, signal);\n\t\tif (index !== -1) {\n\t\t\tvar new_length = reactions.length - 1;\n\t\t\tif (new_length === 0) {\n\t\t\t\treactions = dependency.reactions = null;\n\t\t\t} else {\n\t\t\t\t// Swap with last element and then remove.\n\t\t\t\treactions[index] = reactions[new_length];\n\t\t\t\treactions.pop();\n\t\t\t}\n\t\t}\n\t}\n\n\t// If the derived has no reactions, then we can disconnect it from the graph,\n\t// allowing it to either reconnect in the future, or be GC'd by the VM.\n\tif (\n\t\treactions === null &&\n\t\t(dependency.f & DERIVED) !== 0 &&\n\t\t// Destroying a child effect while updating a parent effect can cause a dependency to appear\n\t\t// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`\n\t\t// allows us to skip the expensive work of disconnecting and immediately reconnecting it\n\t\t(new_deps === null || !includes.call(new_deps, dependency))\n\t) {\n\t\tvar derived = /** @type {Derived} */ (dependency);\n\n\t\tif ((derived.f & CONNECTED) !== 0) {\n\t\t\tderived.f ^= CONNECTED;\n\t\t}\n\n\t\t// In a fork it's possible that a derived is executed and gets reactions, then commits, but is\n\t\t// never re-executed. This is possible when the derived is only executed once in the context\n\t\t// of a new branch which happens before fork.commit() runs. In this case, the derived still has\n\t\t// UNINITIALIZED as its value, and then when it's losing its reactions we need to ensure it stays\n\t\t// DIRTY so it is reexecuted once someone wants its value again.\n\t\tif (derived.v !== UNINITIALIZED) {\n\t\t\tupdate_derived_status(derived);\n\t\t}\n\n\t\t// Call abort controller, noone's listening to this derived anymore\n\t\tif (derived.ac !== null) {\n\t\t\twithout_reactive_context(() => {\n\t\t\t\t/** @type {AbortController} */ (derived.ac).abort(STALE_REACTION);\n\t\t\t\tderived.ac = null;\n\t\t\t\t// ensure it reruns right away next time instead of potentially returning a rejected promise as its value\n\t\t\t\tset_signal_status(derived, DIRTY);\n\t\t\t});\n\t\t}\n\n\t\t// freeze any effects inside this derived\n\t\tfreeze_derived_effects(derived);\n\n\t\t// Disconnect any reactions owned by this reaction\n\t\tremove_reactions(derived, 0);\n\t}\n}\n\n/**\n * @param {Reaction} signal\n * @param {number} start_index\n * @returns {void}\n */\nexport function remove_reactions(signal, start_index) {\n\tvar dependencies = signal.deps;\n\tif (dependencies === null) return;\n\n\tfor (var i = start_index; i < dependencies.length; i++) {\n\t\tremove_reaction(signal, dependencies[i]);\n\t}\n}\n\n/**\n * @param {Effect} effect\n * @returns {void}\n */\nexport function update_effect(effect) {\n\tvar flags = effect.f;\n\n\tif ((flags & DESTROYED) !== 0) {\n\t\treturn;\n\t}\n\n\tset_signal_status(effect, CLEAN);\n\n\tvar previous_effect = active_effect;\n\n\tactive_effect = effect;\n\n\tif (DEV) {\n\t\tvar previous_component_fn = dev_current_component_function;\n\t\tset_dev_current_component_function(effect.component_function);\n\t\tvar previous_stack = /** @type {any} */ (dev_stack);\n\t\t// only block effects have a dev stack, keep the current one otherwise\n\t\tset_dev_stack(effect.dev_stack ?? dev_stack);\n\t}\n\n\ttry {\n\t\tif ((flags & (BLOCK_EFFECT | MANAGED_EFFECT)) !== 0) {\n\t\t\tdestroy_block_effect_children(effect);\n\t\t} else {\n\t\t\tdestroy_effect_children(effect);\n\t\t}\n\n\t\texecute_effect_teardown(effect);\n\t\tvar teardown = update_reaction(effect);\n\t\teffect.teardown = typeof teardown === 'function' ? teardown : null;\n\t\teffect.wv = write_version;\n\n\t\t// In DEV, increment versions of any sources that were written to during the effect,\n\t\t// so that they are correctly marked as dirty when the effect re-runs\n\t\tif (DEV && tracing_mode_flag && (effect.f & DIRTY) !== 0 && effect.deps !== null) {\n\t\t\tfor (var dep of effect.deps) {\n\t\t\t\tif (dep.set_during_effect) {\n\t\t\t\t\tdep.wv = increment_write_version();\n\t\t\t\t\tdep.set_during_effect = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} finally {\n\t\tactive_effect = previous_effect;\n\n\t\tif (DEV) {\n\t\t\tset_dev_current_component_function(previous_component_fn);\n\t\t\tset_dev_stack(previous_stack);\n\t\t}\n\t}\n}\n\n/**\n * Returns a promise that resolves once any pending state changes have been applied.\n * @returns {Promise}\n */\nexport async function tick() {\n\tif (async_mode_flag) {\n\t\treturn new Promise((f) => {\n\t\t\t// Race them against each other - in almost all cases requestAnimationFrame will fire first,\n\t\t\t// but e.g. in case the window is not focused or a view transition happens, requestAnimationFrame\n\t\t\t// will be delayed and setTimeout helps us resolve fast enough in that case\n\t\t\trequestAnimationFrame(() => f());\n\t\t\tsetTimeout(() => f());\n\t\t});\n\t}\n\n\tawait Promise.resolve();\n\n\t// By calling flushSync we guarantee that any pending state changes are applied after one tick.\n\t// TODO look into whether we can make flushing subsequent updates synchronously in the future.\n\tflushSync();\n}\n\n/**\n * Returns a promise that resolves once any state changes, and asynchronous work resulting from them,\n * have resolved and the DOM has been updated\n * @returns {Promise}\n * @since 5.36\n */\nexport function settled() {\n\treturn Batch.ensure().settled();\n}\n\n/**\n * @template V\n * @param {Value} signal\n * @returns {V}\n */\nexport function get(signal) {\n\tvar flags = signal.f;\n\tvar is_derived = (flags & DERIVED) !== 0;\n\n\tcaptured_signals?.add(signal);\n\n\t// Register the dependency on the current reaction signal.\n\tif (active_reaction !== null && !untracking) {\n\t\t// if we're in a derived that is being read inside an _async_ derived,\n\t\t// it's possible that the effect was already destroyed. In this case,\n\t\t// we don't add the dependency, because that would create a memory leak\n\t\tvar destroyed = active_effect !== null && (active_effect.f & DESTROYED) !== 0;\n\n\t\tif (!destroyed && (current_sources === null || !current_sources.has(signal))) {\n\t\t\tvar deps = active_reaction.deps;\n\n\t\t\tif ((active_reaction.f & REACTION_IS_UPDATING) !== 0) {\n\t\t\t\t// we're in the effect init/update cycle\n\t\t\t\tif (signal.rv < read_version) {\n\t\t\t\t\tsignal.rv = read_version;\n\n\t\t\t\t\t// If the signal is accessing the same dependencies in the same\n\t\t\t\t\t// order as it did last time, increment `skipped_deps`\n\t\t\t\t\t// rather than updating `new_deps`, which creates GC cost\n\t\t\t\t\tif (new_deps === null && deps !== null && deps[skipped_deps] === signal) {\n\t\t\t\t\t\tskipped_deps++;\n\t\t\t\t\t} else if (new_deps === null) {\n\t\t\t\t\t\tnew_deps = [signal];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnew_deps.push(signal);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We're adding a dependency outside the init/update cycle (i.e. after an `await`).\n\t\t\t\t// We have to deduplicate deps/reactions in this case or remove_reactions could\n\t\t\t\t// disconnect deps/reactions that are actually still in use (if skip_deps says\n\t\t\t\t// \"disconnect all after this index\" and some of the signals are also present in\n\t\t\t\t// list prior to the cutoff index, i.e. that should be kept).\n\t\t\t\tactive_reaction.deps ??= [];\n\t\t\t\tif (!includes.call(active_reaction.deps, signal)) {\n\t\t\t\t\tactive_reaction.deps.push(signal);\n\t\t\t\t}\n\n\t\t\t\tvar reactions = signal.reactions;\n\n\t\t\t\tif (reactions === null) {\n\t\t\t\t\tsignal.reactions = [active_reaction];\n\t\t\t\t} else if (!includes.call(reactions, active_reaction)) {\n\t\t\t\t\treactions.push(active_reaction);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (DEV) {\n\t\tif (\n\t\t\t!untracking &&\n\t\t\treactivity_loss_tracker &&\n\t\t\t// By checking that current/previous batch are null we filter out false positives.\n\t\t\t// reactivity_loss_tracker is only reset after a microtask, so if a flush happens\n\t\t\t// before that, we get warnings for things we shouldn't warn on.\n\t\t\tcurrent_batch === null &&\n\t\t\tprevious_batch === null &&\n\t\t\t!reactivity_loss_tracker.warned &&\n\t\t\t(reactivity_loss_tracker.effect.f & REACTION_IS_UPDATING) === 0 &&\n\t\t\t!reactivity_loss_tracker.effect_deps.has(signal)\n\t\t) {\n\t\t\treactivity_loss_tracker.warned = true;\n\n\t\t\tw.await_reactivity_loss(/** @type {string} */ (signal.label));\n\n\t\t\tvar trace = get_error('traced at');\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tif (trace) console.warn(trace);\n\t\t}\n\n\t\trecent_async_deriveds.delete(signal);\n\n\t\tif (\n\t\t\ttracing_mode_flag &&\n\t\t\t!untracking &&\n\t\t\ttracing_expressions !== null &&\n\t\t\tactive_reaction !== null &&\n\t\t\ttracing_expressions.reaction === active_reaction\n\t\t) {\n\t\t\t// Used when mapping state between special blocks like `each`\n\t\t\tif (signal.trace) {\n\t\t\t\tsignal.trace();\n\t\t\t} else {\n\t\t\t\ttrace = get_error('traced at');\n\n\t\t\t\tif (trace) {\n\t\t\t\t\tvar entry = tracing_expressions.entries.get(signal);\n\n\t\t\t\t\tif (entry === undefined) {\n\t\t\t\t\t\tentry = { traces: [] };\n\t\t\t\t\t\ttracing_expressions.entries.set(signal, entry);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar last = entry.traces[entry.traces.length - 1];\n\n\t\t\t\t\t// traces can be duplicated, e.g. by `snapshot` invoking both\n\t\t\t\t\t// both `getOwnPropertyDescriptor` and `get` traps at once\n\t\t\t\t\tif (trace.stack !== last?.stack) {\n\t\t\t\t\t\tentry.traces.push(trace);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (is_destroying_effect && old_values.has(signal)) {\n\t\treturn old_values.get(signal);\n\t}\n\n\tif (is_derived) {\n\t\tvar derived = /** @type {Derived} */ (signal);\n\n\t\tif (is_destroying_effect) {\n\t\t\tvar value = derived.v;\n\n\t\t\t// if the derived is dirty and has reactions, or depends on the values that just changed, re-execute\n\t\t\t// (a derived can be maybe_dirty due to the effect destroy removing its last reaction)\n\t\t\tif (\n\t\t\t\t((derived.f & CLEAN) === 0 && derived.reactions !== null) ||\n\t\t\t\tdepends_on_old_values(derived)\n\t\t\t) {\n\t\t\t\tvalue = execute_derived(derived);\n\t\t\t}\n\n\t\t\told_values.set(derived, value);\n\n\t\t\treturn value;\n\t\t}\n\n\t\t// connect disconnected deriveds when reading them inside a connected reaction\n\t\tvar should_connect =\n\t\t\t(derived.f & CONNECTED) === 0 &&\n\t\t\t!untracking &&\n\t\t\tactive_reaction !== null &&\n\t\t\t(active_reaction.f & CONNECTED) !== 0;\n\n\t\tvar is_new = (derived.f & REACTION_RAN) === 0;\n\n\t\tif (is_dirty(derived)) {\n\t\t\tif (should_connect) {\n\t\t\t\t// set the flag before `update_derived`, so that the derived\n\t\t\t\t// is added as a reaction to its dependencies\n\t\t\t\tderived.f |= CONNECTED;\n\t\t\t}\n\n\t\t\tupdate_derived(derived);\n\t\t}\n\n\t\tif (should_connect && !is_new) {\n\t\t\tunfreeze_derived_effects(derived);\n\t\t\treconnect(derived);\n\t\t}\n\t}\n\n\tif (batch_values?.has(signal)) {\n\t\treturn batch_values.get(signal);\n\t}\n\n\tif ((signal.f & ERROR_VALUE) !== 0) {\n\t\tthrow signal.v;\n\t}\n\n\treturn signal.v;\n}\n\n/**\n * (Re)connect a disconnected derived, so that it is notified\n * of changes in `mark_reactions`\n * @param {Derived} derived\n */\nfunction reconnect(derived) {\n\tderived.f |= CONNECTED;\n\n\tif (derived.deps === null) return;\n\n\tfor (const dep of derived.deps) {\n\t\tvar reactions = dep.reactions;\n\n\t\tif (reactions === null) {\n\t\t\tdep.reactions = [derived];\n\t\t} else if (!includes.call(reactions, derived)) {\n\t\t\treactions.push(derived);\n\t\t}\n\n\t\tif ((dep.f & DERIVED) !== 0 && (dep.f & CONNECTED) === 0) {\n\t\t\tunfreeze_derived_effects(/** @type {Derived} */ (dep));\n\t\t\treconnect(/** @type {Derived} */ (dep));\n\t\t}\n\t}\n}\n\n/** @param {Derived} derived */\nfunction depends_on_old_values(derived) {\n\tif (derived.v === UNINITIALIZED) return true; // we don't know, so assume the worst\n\tif (derived.deps === null) return false;\n\n\tfor (const dep of derived.deps) {\n\t\tif (old_values.has(dep)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ((dep.f & DERIVED) !== 0 && depends_on_old_values(/** @type {Derived} */ (dep))) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Like `get`, but checks for `undefined`. Used for `var` declarations because they can be accessed before being declared\n * @template V\n * @param {Value | undefined} signal\n * @returns {V | undefined}\n */\nexport function safe_get(signal) {\n\treturn signal && get(signal);\n}\n\n/**\n * When used inside a [`$derived`](https://svelte.dev/docs/svelte/$derived) or [`$effect`](https://svelte.dev/docs/svelte/$effect),\n * any state read inside `fn` will not be treated as a dependency.\n *\n * ```ts\n * $effect(() => {\n * // this will run when `data` changes, but not when `time` changes\n * save(data, {\n * timestamp: untrack(() => time)\n * });\n * });\n * ```\n * @template T\n * @param {() => T} fn\n * @returns {T}\n */\nexport function untrack(fn) {\n\tvar previous_untracking = untracking;\n\ttry {\n\t\tuntracking = true;\n\t\treturn fn();\n\t} finally {\n\t\tuntracking = previous_untracking;\n\t}\n}\n\n/**\n * Possibly traverse an object and read all its properties so that they're all reactive in case this is `$state`.\n * Does only check first level of an object for performance reasons (heuristic should be good for 99% of all cases).\n * @param {any} value\n * @returns {void}\n */\nexport function deep_read_state(value) {\n\tif (typeof value !== 'object' || !value || value instanceof EventTarget) {\n\t\treturn;\n\t}\n\n\tif (STATE_SYMBOL in value) {\n\t\tdeep_read(value);\n\t} else if (!Array.isArray(value)) {\n\t\tfor (let key in value) {\n\t\t\tconst prop = value[key];\n\t\t\tif (typeof prop === 'object' && prop && STATE_SYMBOL in prop) {\n\t\t\t\tdeep_read(prop);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Deeply traverse an object and read all its properties\n * so that they're all reactive in case this is `$state`\n * @param {any} value\n * @param {Set} visited\n * @returns {void}\n */\nexport function deep_read(value, visited = new Set()) {\n\tif (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t// We don't want to traverse DOM elements\n\t\t!(value instanceof EventTarget) &&\n\t\t!visited.has(value)\n\t) {\n\t\tvisited.add(value);\n\t\t// When working with a possible SvelteDate, this\n\t\t// will ensure we capture changes to it.\n\t\tif (value instanceof Date) {\n\t\t\tvalue.getTime();\n\t\t}\n\t\tfor (let key in value) {\n\t\t\ttry {\n\t\t\t\tdeep_read(value[key], visited);\n\t\t\t} catch (e) {\n\t\t\t\t// continue\n\t\t\t}\n\t\t}\n\t\tconst proto = get_prototype_of(value);\n\t\tif (\n\t\t\tproto !== Object.prototype &&\n\t\t\tproto !== Array.prototype &&\n\t\t\tproto !== Map.prototype &&\n\t\t\tproto !== Set.prototype &&\n\t\t\tproto !== Date.prototype\n\t\t) {\n\t\t\tconst descriptors = get_descriptors(proto);\n\t\t\tfor (let key in descriptors) {\n\t\t\t\tconst get = descriptors[key].get;\n\t\t\t\tif (get) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tget.call(value);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t// continue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","const regex_return_characters = /\\r/g;\n\n/**\n * @param {string} str\n * @returns {string}\n */\nexport function hash(str) {\n\tstr = str.replace(regex_return_characters, '');\n\tlet hash = 5381;\n\tlet i = str.length;\n\n\twhile (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n\treturn (hash >>> 0).toString(36);\n}\n\nconst VOID_ELEMENT_NAMES = [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr'\n];\n\n/**\n * Returns `true` if `name` is of a void element\n * @param {string} name\n */\nexport function is_void(name) {\n\treturn VOID_ELEMENT_NAMES.includes(name) || name.toLowerCase() === '!doctype';\n}\n\nconst RESERVED_WORDS = [\n\t'arguments',\n\t'await',\n\t'break',\n\t'case',\n\t'catch',\n\t'class',\n\t'const',\n\t'continue',\n\t'debugger',\n\t'default',\n\t'delete',\n\t'do',\n\t'else',\n\t'enum',\n\t'eval',\n\t'export',\n\t'extends',\n\t'false',\n\t'finally',\n\t'for',\n\t'function',\n\t'if',\n\t'implements',\n\t'import',\n\t'in',\n\t'instanceof',\n\t'interface',\n\t'let',\n\t'new',\n\t'null',\n\t'package',\n\t'private',\n\t'protected',\n\t'public',\n\t'return',\n\t'static',\n\t'super',\n\t'switch',\n\t'this',\n\t'throw',\n\t'true',\n\t'try',\n\t'typeof',\n\t'var',\n\t'void',\n\t'while',\n\t'with',\n\t'yield'\n];\n\n/**\n * Returns `true` if `word` is a reserved JavaScript keyword\n * @param {string} word\n */\nexport function is_reserved(word) {\n\treturn RESERVED_WORDS.includes(word);\n}\n\n/**\n * @param {string} name\n */\nexport function is_capture_event(name) {\n\treturn name.endsWith('capture') && name !== 'gotpointercapture' && name !== 'lostpointercapture';\n}\n\n/** List of Element events that will be delegated */\nconst DELEGATED_EVENTS = [\n\t'beforeinput',\n\t'click',\n\t'change',\n\t'dblclick',\n\t'contextmenu',\n\t'focusin',\n\t'focusout',\n\t'input',\n\t'keydown',\n\t'keyup',\n\t'mousedown',\n\t'mousemove',\n\t'mouseout',\n\t'mouseover',\n\t'mouseup',\n\t'pointerdown',\n\t'pointermove',\n\t'pointerout',\n\t'pointerover',\n\t'pointerup',\n\t'touchend',\n\t'touchmove',\n\t'touchstart'\n];\n\n/**\n * Returns `true` if `event_name` is a delegated event\n * @param {string} event_name\n */\nexport function can_delegate_event(event_name) {\n\treturn DELEGATED_EVENTS.includes(event_name);\n}\n\n/**\n * Attributes that are boolean, i.e. they are present or not present.\n */\nconst DOM_BOOLEAN_ATTRIBUTES = [\n\t'allowfullscreen',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'disabled',\n\t'formnovalidate',\n\t'indeterminate',\n\t'inert',\n\t'ismap',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'seamless',\n\t'selected',\n\t'webkitdirectory',\n\t'defer',\n\t'disablepictureinpicture',\n\t'disableremoteplayback'\n];\n\n/**\n * Returns `true` if `name` is a boolean attribute\n * @param {string} name\n */\nexport function is_boolean_attribute(name) {\n\treturn DOM_BOOLEAN_ATTRIBUTES.includes(name);\n}\n\n/**\n * @type {Record}\n * List of attribute names that should be aliased to their property names\n * because they behave differently between setting them as an attribute and\n * setting them as a property.\n */\nconst ATTRIBUTE_ALIASES = {\n\t// no `class: 'className'` because we handle that separately\n\tformnovalidate: 'formNoValidate',\n\tismap: 'isMap',\n\tnomodule: 'noModule',\n\tplaysinline: 'playsInline',\n\treadonly: 'readOnly',\n\tdefaultvalue: 'defaultValue',\n\tdefaultchecked: 'defaultChecked',\n\tsrcobject: 'srcObject',\n\tnovalidate: 'noValidate',\n\tallowfullscreen: 'allowFullscreen',\n\tdisablepictureinpicture: 'disablePictureInPicture',\n\tdisableremoteplayback: 'disableRemotePlayback'\n};\n\n/**\n * @param {string} name\n */\nexport function normalize_attribute(name) {\n\tname = name.toLowerCase();\n\treturn ATTRIBUTE_ALIASES[name] ?? name;\n}\n\nconst DOM_PROPERTIES = [\n\t...DOM_BOOLEAN_ATTRIBUTES,\n\t'formNoValidate',\n\t'isMap',\n\t'noModule',\n\t'playsInline',\n\t'readOnly',\n\t'value',\n\t'volume',\n\t'defaultValue',\n\t'defaultChecked',\n\t'srcObject',\n\t'noValidate',\n\t'allowFullscreen',\n\t'disablePictureInPicture',\n\t'disableRemotePlayback'\n];\n\n/**\n * @param {string} name\n */\nexport function is_dom_property(name) {\n\treturn DOM_PROPERTIES.includes(name);\n}\n\nconst NON_STATIC_PROPERTIES = ['autofocus', 'muted', 'defaultValue', 'defaultChecked'];\n\n/**\n * Returns `true` if the given attribute cannot be set through the template\n * string, i.e. needs some kind of JavaScript handling to work.\n * @param {string} name\n */\nexport function cannot_be_set_statically(name) {\n\treturn NON_STATIC_PROPERTIES.includes(name);\n}\n\n/**\n * Subset of delegated events which should be passive by default.\n * These two are already passive via browser defaults on window, document and body.\n * But since\n * - we're delegating them\n * - they happen often\n * - they apply to mobile which is generally less performant\n * we're marking them as passive by default for other elements, too.\n */\nconst PASSIVE_EVENTS = ['touchstart', 'touchmove'];\n\n/**\n * Returns `true` if `name` is a passive event\n * @param {string} name\n */\nexport function is_passive_event(name) {\n\treturn PASSIVE_EVENTS.includes(name);\n}\n\nconst CONTENT_EDITABLE_BINDINGS = ['textContent', 'innerHTML', 'innerText'];\n\n/** @param {string} name */\nexport function is_content_editable_binding(name) {\n\treturn CONTENT_EDITABLE_BINDINGS.includes(name);\n}\n\nconst LOAD_ERROR_ELEMENTS = [\n\t'body',\n\t'embed',\n\t'iframe',\n\t'img',\n\t'link',\n\t'object',\n\t'script',\n\t'style',\n\t'track'\n];\n\n/**\n * Returns `true` if the element emits `load` and `error` events\n * @param {string} name\n */\nexport function is_load_error_element(name) {\n\treturn LOAD_ERROR_ELEMENTS.includes(name);\n}\n\nconst SVG_ELEMENTS = [\n\t'altGlyph',\n\t'altGlyphDef',\n\t'altGlyphItem',\n\t'animate',\n\t'animateColor',\n\t'animateMotion',\n\t'animateTransform',\n\t'circle',\n\t'clipPath',\n\t'color-profile',\n\t'cursor',\n\t'defs',\n\t'desc',\n\t'discard',\n\t'ellipse',\n\t'feBlend',\n\t'feColorMatrix',\n\t'feComponentTransfer',\n\t'feComposite',\n\t'feConvolveMatrix',\n\t'feDiffuseLighting',\n\t'feDisplacementMap',\n\t'feDistantLight',\n\t'feDropShadow',\n\t'feFlood',\n\t'feFuncA',\n\t'feFuncB',\n\t'feFuncG',\n\t'feFuncR',\n\t'feGaussianBlur',\n\t'feImage',\n\t'feMerge',\n\t'feMergeNode',\n\t'feMorphology',\n\t'feOffset',\n\t'fePointLight',\n\t'feSpecularLighting',\n\t'feSpotLight',\n\t'feTile',\n\t'feTurbulence',\n\t'filter',\n\t'font',\n\t'font-face',\n\t'font-face-format',\n\t'font-face-name',\n\t'font-face-src',\n\t'font-face-uri',\n\t'foreignObject',\n\t'g',\n\t'glyph',\n\t'glyphRef',\n\t'hatch',\n\t'hatchpath',\n\t'hkern',\n\t'image',\n\t'line',\n\t'linearGradient',\n\t'marker',\n\t'mask',\n\t'mesh',\n\t'meshgradient',\n\t'meshpatch',\n\t'meshrow',\n\t'metadata',\n\t'missing-glyph',\n\t'mpath',\n\t'path',\n\t'pattern',\n\t'polygon',\n\t'polyline',\n\t'radialGradient',\n\t'rect',\n\t'set',\n\t'solidcolor',\n\t'stop',\n\t'svg',\n\t'switch',\n\t'symbol',\n\t'text',\n\t'textPath',\n\t'tref',\n\t'tspan',\n\t'unknown',\n\t'use',\n\t'view',\n\t'vkern'\n];\n\n/** @param {string} name */\nexport function is_svg(name) {\n\treturn SVG_ELEMENTS.includes(name);\n}\n\nconst MATHML_ELEMENTS = [\n\t'annotation',\n\t'annotation-xml',\n\t'maction',\n\t'math',\n\t'merror',\n\t'mfrac',\n\t'mi',\n\t'mmultiscripts',\n\t'mn',\n\t'mo',\n\t'mover',\n\t'mpadded',\n\t'mphantom',\n\t'mprescripts',\n\t'mroot',\n\t'mrow',\n\t'ms',\n\t'mspace',\n\t'msqrt',\n\t'mstyle',\n\t'msub',\n\t'msubsup',\n\t'msup',\n\t'mtable',\n\t'mtd',\n\t'mtext',\n\t'mtr',\n\t'munder',\n\t'munderover',\n\t'semantics'\n];\n\n/** @param {string} name */\nexport function is_mathml(name) {\n\treturn MATHML_ELEMENTS.includes(name);\n}\n\nconst STATE_CREATION_RUNES = /** @type {const} */ ([\n\t'$state',\n\t'$state.raw',\n\t'$derived',\n\t'$derived.by'\n]);\n\nexport const RUNES = /** @type {const} */ ([\n\t...STATE_CREATION_RUNES,\n\t'$state.eager',\n\t'$state.snapshot',\n\t'$props',\n\t'$props.id',\n\t'$bindable',\n\t'$effect',\n\t'$effect.pre',\n\t'$effect.tracking',\n\t'$effect.root',\n\t'$effect.pending',\n\t'$inspect',\n\t'$inspect().with',\n\t'$inspect.trace',\n\t'$host'\n]);\n\n/** @typedef {typeof RUNES[number]} RuneName */\n\n/**\n * @param {string} name\n * @returns {name is RuneName}\n */\nexport function is_rune(name) {\n\treturn RUNES.includes(/** @type {RuneName} */ (name));\n}\n\n/** @typedef {typeof STATE_CREATION_RUNES[number]} StateCreationRuneName */\n\n/**\n * @param {string} name\n * @returns {name is StateCreationRuneName}\n */\nexport function is_state_creation_rune(name) {\n\treturn STATE_CREATION_RUNES.includes(/** @type {StateCreationRuneName} */ (name));\n}\n\n/** List of elements that require raw contents and should not have SSR comments put in them */\nconst RAW_TEXT_ELEMENTS = /** @type {const} */ (['textarea', 'script', 'style', 'title']);\n\n/** @param {string} name */\nexport function is_raw_text_element(name) {\n\treturn RAW_TEXT_ELEMENTS.includes(/** @type {typeof RAW_TEXT_ELEMENTS[number]} */ (name));\n}\n\n// Matches valid HTML/SVG/MathML element names and custom element names.\n// https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n//\n// Standard elements: ASCII alpha start, followed by ASCII alphanumerics.\n// Custom elements: ASCII alpha start, followed by any mix of PCENChar (which\n// includes ASCII alphanumerics, `-`, `.`, `_`, and specified Unicode ranges),\n// with at least one hyphen required somewhere after the first character.\n//\n// Rejects strings containing whitespace, quotes, angle brackets, slashes, equals,\n// or other characters that could break out of a tag-name token and enable markup injection.\nexport const REGEX_VALID_TAG_NAME =\n\t/^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9.\\-_\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}]*)?$/u;\n\n/**\n * Prevent devtools trying to make `location` a clickable link by inserting a zero-width space\n * @template {string | undefined} T\n * @param {T} location\n * @returns {T};\n */\nexport function sanitize_location(location) {\n\treturn /** @type {T} */ (location?.replace(/\\//g, '/\\u200b'));\n}\n","import { teardown } from '../../reactivity/effects.js';\nimport { define_property } from '../../../shared/utils.js';\nimport { hydrating } from '../hydration.js';\nimport { queue_micro_task } from '../task.js';\nimport { FILENAME } from '../../../../constants.js';\nimport * as w from '../../warnings.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { without_reactive_context } from './bindings/shared.js';\n\n/**\n * Used on elements, as a map of event type -> event handler,\n * and on events themselves to track which element handled an event\n */\nexport const event_symbol = Symbol('events');\n\n/** @type {Set} */\nexport const all_registered_events = new Set();\n\n/** @type {Set<(events: Array) => void>} */\nexport const root_event_handles = new Set();\n\n/**\n * SSR adds onload and onerror attributes to catch those events before the hydration.\n * This function detects those cases, removes the attributes and replays the events.\n * @param {HTMLElement} dom\n */\nexport function replay_events(dom) {\n\tif (!hydrating) return;\n\n\tdom.removeAttribute('onload');\n\tdom.removeAttribute('onerror');\n\t// @ts-expect-error\n\tconst event = dom.__e;\n\tif (event !== undefined) {\n\t\t// @ts-expect-error\n\t\tdom.__e = undefined;\n\t\tqueueMicrotask(() => {\n\t\t\tif (dom.isConnected) {\n\t\t\t\tdom.dispatchEvent(event);\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * @param {string} event_name\n * @param {EventTarget} dom\n * @param {EventListener} [handler]\n * @param {AddEventListenerOptions} [options]\n */\nexport function create_event(event_name, dom, handler, options = {}) {\n\t/**\n\t * @this {EventTarget}\n\t */\n\tfunction target_handler(/** @type {Event} */ event) {\n\t\tif (!options.capture) {\n\t\t\t// Only call in the bubble phase, else delegated events would be called before the capturing events\n\t\t\thandle_event_propagation.call(dom, event);\n\t\t}\n\t\tif (!event.cancelBubble) {\n\t\t\treturn without_reactive_context(() => {\n\t\t\t\treturn handler?.call(this, event);\n\t\t\t});\n\t\t}\n\t}\n\n\t// Chrome has a bug where pointer events don't work when attached to a DOM element that has been cloned\n\t// with cloneNode() and the DOM element is disconnected from the document. To ensure the event works, we\n\t// defer the attachment till after it's been appended to the document. TODO: remove this once Chrome fixes\n\t// this bug. The same applies to wheel events and touch events.\n\tif (\n\t\tevent_name.startsWith('pointer') ||\n\t\tevent_name.startsWith('touch') ||\n\t\tevent_name === 'wheel'\n\t) {\n\t\ttarget_handler.__removed = false;\n\t\tqueue_micro_task(() => {\n\t\t\tif (!target_handler.__removed) {\n\t\t\t\tdom.addEventListener(event_name, target_handler, options);\n\t\t\t}\n\t\t});\n\t} else {\n\t\tdom.addEventListener(event_name, target_handler, options);\n\t}\n\n\treturn target_handler;\n}\n\n/**\n * Attaches an event handler to an element and returns a function that removes the handler. Using this\n * rather than `addEventListener` will preserve the correct order relative to handlers added declaratively\n * (with attributes like `onclick`), which use event delegation for performance reasons\n *\n * @param {EventTarget} element\n * @param {string} type\n * @param {EventListener} handler\n * @param {AddEventListenerOptions} [options]\n */\nexport function on(element, type, handler, options = {}) {\n\tvar target_handler = create_event(type, element, handler, options);\n\n\treturn () => {\n\t\ttarget_handler.__removed = true;\n\t\telement.removeEventListener(type, target_handler, options);\n\t};\n}\n\n/**\n * @param {string} event_name\n * @param {Element} dom\n * @param {EventListener} [handler]\n * @param {boolean} [capture]\n * @param {boolean} [passive]\n * @returns {void}\n */\nexport function event(event_name, dom, handler, capture, passive) {\n\tvar options = { capture, passive };\n\tvar target_handler = create_event(event_name, dom, handler, options);\n\n\tif (\n\t\tdom === document.body ||\n\t\t// @ts-ignore\n\t\tdom === window ||\n\t\t// @ts-ignore\n\t\tdom === document ||\n\t\t// Firefox has quirky behavior, it can happen that we still get \"canplay\" events when the element is already removed\n\t\tdom instanceof HTMLMediaElement\n\t) {\n\t\tteardown(() => {\n\t\t\ttarget_handler.__removed = true;\n\t\t\tdom.removeEventListener(event_name, target_handler, options);\n\t\t});\n\t}\n}\n\n/**\n * @param {string} event_name\n * @param {Element} element\n * @param {EventListener} [handler]\n * @returns {void}\n */\nexport function delegated(event_name, element, handler) {\n\t// @ts-expect-error\n\t(element[event_symbol] ??= {})[event_name] = handler;\n}\n\n/**\n * @param {Array} events\n * @returns {void}\n */\nexport function delegate(events) {\n\tfor (var i = 0; i < events.length; i++) {\n\t\tall_registered_events.add(events[i]);\n\t}\n\n\tfor (var fn of root_event_handles) {\n\t\tfn(events);\n\t}\n}\n\n// used to store the reference to the currently propagated event\n// to prevent garbage collection between microtasks in Firefox (<= 141)\n// If the event object is GCed too early, the expando __root property\n// set on the event object is lost, causing the event delegation\n// to process the event twice\nlet last_propagated_event = null;\n\n// whether a task is already queued to clear `last_propagated_event`\nlet last_propagated_event_clear_scheduled = false;\n\n/**\n * @this {EventTarget}\n * @param {Event} event\n * @returns {void}\n */\nexport function handle_event_propagation(event) {\n\tvar handler_element = this;\n\tvar owner_document = /** @type {Node} */ (handler_element).ownerDocument;\n\tvar event_name = event.type;\n\tvar path = event.composedPath?.() || [];\n\tvar current_target = /** @type {null | Element} */ (path[0] || event.target);\n\n\tlast_propagated_event = event;\n\n\t// The reference is only needed while the event can still reach another\n\t// delegated root, i.e. during the current (synchronous) dispatch and its\n\t// microtask checkpoints. Clearing it in a later task preserves the\n\t// Firefox workaround while making sure the slot doesn't retain the last\n\t// event forever โ€” through `event.target` it would otherwise keep the\n\t// entire detached subtree of whatever the user last clicked in alive\n\t// until the next delegated event happens to arrive.\n\tif (!last_propagated_event_clear_scheduled) {\n\t\tlast_propagated_event_clear_scheduled = true;\n\t\tsetTimeout(() => {\n\t\t\tlast_propagated_event_clear_scheduled = false;\n\t\t\tlast_propagated_event = null;\n\t\t});\n\t}\n\n\t// composedPath contains list of nodes the event has propagated through.\n\t// We check `event_symbol` to skip all nodes below it in case this is a\n\t// parent of the `event_symbol` node, which indicates that there's nested\n\t// mounted apps. In this case we don't want to trigger events multiple times.\n\tvar path_idx = 0;\n\n\t// the `last_propagated_event === event` check is redundant, but\n\t// without it the variable will be DCE'd and things will\n\t// fail mysteriously in Firefox\n\t// @ts-expect-error is added below\n\tvar handled_at = last_propagated_event === event && event[event_symbol];\n\n\tif (handled_at) {\n\t\tvar at_idx = path.indexOf(handled_at);\n\t\tif (\n\t\t\tat_idx !== -1 &&\n\t\t\t(handler_element === document || handler_element === /** @type {any} */ (window))\n\t\t) {\n\t\t\t// This is the fallback document listener or a window listener, but the event was already handled\n\t\t\t// -> ignore, but set handle_at to document/window so that we're resetting the event\n\t\t\t// chain in case someone manually dispatches the same event object again.\n\t\t\t// @ts-expect-error\n\t\t\tevent[event_symbol] = handler_element;\n\t\t\treturn;\n\t\t}\n\n\t\t// We're deliberately not skipping if the index is higher, because\n\t\t// someone could create an event programmatically and emit it multiple times,\n\t\t// in which case we want to handle the whole propagation chain properly each time.\n\t\t// (this will only be a false negative if the event is dispatched multiple times and\n\t\t// the fallback document listener isn't reached in between, but that's super rare)\n\t\tvar handler_idx = path.indexOf(handler_element);\n\t\tif (handler_idx === -1) {\n\t\t\t// handle_idx can theoretically be -1 (happened in some JSDOM testing scenarios with an event listener on the window object)\n\t\t\t// so guard against that, too, and assume that everything was handled at this point.\n\t\t\treturn;\n\t\t}\n\n\t\tif (at_idx <= handler_idx) {\n\t\t\tpath_idx = at_idx;\n\t\t}\n\t}\n\n\tcurrent_target = /** @type {Element} */ (path[path_idx] || event.target);\n\t// there can only be one delegated event per element, and we either already handled the current target,\n\t// or this is the very first target in the chain which has a non-delegated listener, in which case it's safe\n\t// to handle a possible delegated event on it later (through the root delegation listener for example).\n\tif (current_target === handler_element) return;\n\n\t// Proxy currentTarget to correct target\n\tdefine_property(event, 'currentTarget', {\n\t\tconfigurable: true,\n\t\tget() {\n\t\t\treturn current_target || owner_document;\n\t\t}\n\t});\n\n\t// This started because of Chromium issue https://chromestatus.com/feature/5128696823545856,\n\t// where removal or moving of the DOM can cause sync `blur` events to fire, which can cause logic\n\t// to run inside the current `active_reaction`, which isn't what we want at all. However, on reflection,\n\t// it's probably best that all events handled by Svelte have this behaviour, as we don't really want\n\t// an event handler to run in the context of another reaction or effect.\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\n\ttry {\n\t\t/**\n\t\t * @type {unknown}\n\t\t */\n\t\tvar throw_error;\n\t\t/**\n\t\t * @type {unknown[]}\n\t\t */\n\t\tvar other_errors = [];\n\n\t\twhile (current_target !== null) {\n\t\t\tif (current_target === handler_element) break;\n\n\t\t\ttry {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tvar delegated = current_target[event_symbol]?.[event_name];\n\n\t\t\t\tif (\n\t\t\t\t\tdelegated != null &&\n\t\t\t\t\t(!(/** @type {any} */ (current_target).disabled) ||\n\t\t\t\t\t\t// DOM could've been updated already by the time this is reached, so we check this as well\n\t\t\t\t\t\t// -> the target could not have been disabled because it emits the event in the first place\n\t\t\t\t\t\tevent.target === current_target)\n\t\t\t\t) {\n\t\t\t\t\tdelegated.call(current_target, event);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (throw_error) {\n\t\t\t\t\tother_errors.push(error);\n\t\t\t\t} else {\n\t\t\t\t\tthrow_error = error;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (event.cancelBubble) break;\n\n\t\t\tpath_idx++;\n\t\t\tcurrent_target = path_idx < path.length ? /** @type {Element} */ (path[path_idx]) : null;\n\t\t}\n\n\t\tif (throw_error) {\n\t\t\tfor (let error of other_errors) {\n\t\t\t\t// Throw the rest of the errors, one-by-one on a microtask\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tthrow error;\n\t\t\t\t});\n\t\t\t}\n\t\t\tthrow throw_error;\n\t\t}\n\t} finally {\n\t\t// @ts-expect-error is used above\n\t\tevent[event_symbol] = handler_element;\n\t\t// @ts-ignore remove proxy on currentTarget\n\t\tdelete event.currentTarget;\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t}\n}\n\n/**\n * In dev, warn if an event handler is not a function, as it means the\n * user probably called the handler or forgot to add a `() =>`\n * @param {() => (event: Event, ...args: any) => void} thunk\n * @param {EventTarget} element\n * @param {[Event, ...any]} args\n * @param {any} component\n * @param {[number, number]} [loc]\n * @param {boolean} [remove_parens]\n */\nexport function apply(\n\tthunk,\n\telement,\n\targs,\n\tcomponent,\n\tloc,\n\thas_side_effects = false,\n\tremove_parens = false\n) {\n\tlet handler;\n\tlet error;\n\n\ttry {\n\t\thandler = thunk();\n\t} catch (e) {\n\t\terror = e;\n\t}\n\n\tif (typeof handler !== 'function' && (has_side_effects || handler != null || error)) {\n\t\tconst filename = component?.[FILENAME];\n\t\tconst location = loc ? ` at ${filename}:${loc[0]}:${loc[1]}` : ` in ${filename}`;\n\t\tconst phase = args[0]?.eventPhase < Event.BUBBLING_PHASE ? 'capture' : '';\n\t\tconst event_name = args[0]?.type + phase;\n\t\tconst description = `\\`${event_name}\\` handler${location}`;\n\t\tconst suggestion = remove_parens ? 'remove the trailing `()`' : 'add a leading `() =>`';\n\n\t\tw.event_handler_invalid(description, suggestion);\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\t}\n\thandler?.apply(element, args);\n}\n","import { create_element } from './operations.js';\n\nconst policy =\n\t// We gotta write it like this because after downleveling the pure comment may end up in the wrong location\n\tglobalThis?.window?.trustedTypes &&\n\t/* @__PURE__ */ globalThis.window.trustedTypes.createPolicy('svelte-trusted-html', {\n\t\t/** @param {string} html */\n\t\tcreateHTML: (html) => {\n\t\t\treturn html;\n\t\t}\n\t});\n\n/** @param {string} html */\nexport function create_trusted_html(html) {\n\treturn /** @type {string} */ (policy?.createHTML(html) ?? html);\n}\n\n/**\n * @param {string} html\n */\nexport function create_fragment_from_html(html) {\n\tvar elem = create_element('template');\n\telem.innerHTML = create_trusted_html(html.replaceAll('', '')); // XHTML compliance\n\treturn elem.content;\n}\n","/** @import { Effect, EffectNodes, TemplateNode } from '#client' */\n/** @import { TemplateStructure } from './types' */\nimport { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from './hydration.js';\nimport {\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tis_firefox,\n\tcreate_element,\n\tcreate_fragment,\n\tcreate_comment,\n\tset_attribute,\n\tmerge_text_nodes\n} from './operations.js';\nimport { create_fragment_from_html } from './reconciler.js';\nimport { active_effect } from '../runtime.js';\nimport {\n\tNAMESPACE_MATHML,\n\tNAMESPACE_SVG,\n\tTEMPLATE_FRAGMENT,\n\tTEMPLATE_USE_IMPORT_NODE,\n\tTEMPLATE_USE_MATHML,\n\tTEMPLATE_USE_SVG\n} from '../../../constants.js';\nimport {\n\tCOMMENT_NODE,\n\tDOCUMENT_FRAGMENT_NODE,\n\tIS_XHTML,\n\tREACTION_RAN,\n\tTEXT_NODE\n} from '#client/constants';\n\nconst TEMPLATE_TAG = IS_XHTML ? 'template' : 'TEMPLATE';\nconst SCRIPT_TAG = IS_XHTML ? 'script' : 'SCRIPT';\n\n/**\n * @param {TemplateNode} start\n * @param {TemplateNode | null} end\n */\nexport function assign_nodes(start, end) {\n\tvar effect = /** @type {Effect} */ (active_effect);\n\tif (effect.nodes === null) {\n\t\teffect.nodes = { start, end, a: null, t: null };\n\t}\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_html(content, flags) {\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;\n\n\t/** @type {Node} */\n\tvar node;\n\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('');\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (node === undefined) {\n\t\t\tnode = create_fragment_from_html(has_start ? content : '' + content);\n\t\t\tif (!is_fragment) node = /** @type {TemplateNode} */ (get_first_child(node));\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (\n\t\t\tuse_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)\n\t\t);\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n * @param {'svg' | 'math'} ns\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nfunction from_namespace(content, flags, ns = 'svg') {\n\t/**\n\t * Whether or not the first item is a text/element node. If not, we need to\n\t * create an additional comment node to act as `effect.nodes.start`\n\t */\n\tvar has_start = !content.startsWith('');\n\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar wrapped = `<${ns}>${has_start ? content : '' + content}`;\n\n\t/** @type {Element | DocumentFragment} */\n\tvar node;\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (!node) {\n\t\t\tvar fragment = /** @type {DocumentFragment} */ (create_fragment_from_html(wrapped));\n\t\t\tvar root = /** @type {Element} */ (get_first_child(fragment));\n\n\t\t\tif (is_fragment) {\n\t\t\t\tnode = document.createDocumentFragment();\n\t\t\t\twhile (get_first_child(root)) {\n\t\t\t\t\tnode.appendChild(/** @type {TemplateNode} */ (get_first_child(root)));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnode = /** @type {Element} */ (get_first_child(root));\n\t\t\t}\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (node.cloneNode(true));\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_svg(content, flags) {\n\treturn from_namespace(content, flags, 'svg');\n}\n\n/**\n * @param {string} content\n * @param {number} flags\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_mathml(content, flags) {\n\treturn from_namespace(content, flags, 'math');\n}\n\n/**\n * @param {TemplateStructure[]} structure\n * @param {typeof NAMESPACE_SVG | typeof NAMESPACE_MATHML | undefined} [ns]\n */\nfunction fragment_from_tree(structure, ns) {\n\tvar fragment = create_fragment();\n\n\tfor (var item of structure) {\n\t\tif (typeof item === 'string') {\n\t\t\tfragment.append(create_text(item));\n\t\t\tcontinue;\n\t\t}\n\n\t\t// if `preserveComments === true`, comments are represented as `['// ']`\n\t\tif (item === undefined || item[0][0] === '/') {\n\t\t\tfragment.append(create_comment(item ? item[0].slice(3) : ''));\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst [name, attributes, ...children] = item;\n\n\t\tconst namespace = name === 'svg' ? NAMESPACE_SVG : name === 'math' ? NAMESPACE_MATHML : ns;\n\n\t\tvar element = create_element(name, namespace, attributes?.is);\n\n\t\tfor (var key in attributes) {\n\t\t\tset_attribute(element, key, attributes[key]);\n\t\t}\n\n\t\tif (children.length > 0) {\n\t\t\tvar target =\n\t\t\t\telement.nodeName === TEMPLATE_TAG\n\t\t\t\t\t? /** @type {HTMLTemplateElement} */ (element).content\n\t\t\t\t\t: element;\n\n\t\t\ttarget.append(\n\t\t\t\tfragment_from_tree(children, element.nodeName === 'foreignObject' ? undefined : namespace)\n\t\t\t);\n\t\t}\n\n\t\tfragment.append(element);\n\t}\n\n\treturn fragment;\n}\n\n/**\n * @param {TemplateStructure[]} structure\n * @param {number} flags\n * @returns {() => Node | Node[]}\n */\n/*#__NO_SIDE_EFFECTS__*/\nexport function from_tree(structure, flags) {\n\tvar is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;\n\tvar use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;\n\n\t/** @type {Node} */\n\tvar node;\n\n\treturn () => {\n\t\tif (hydrating) {\n\t\t\tassign_nodes(hydrate_node, null);\n\t\t\treturn hydrate_node;\n\t\t}\n\n\t\tif (node === undefined) {\n\t\t\tconst ns =\n\t\t\t\t(flags & TEMPLATE_USE_SVG) !== 0\n\t\t\t\t\t? NAMESPACE_SVG\n\t\t\t\t\t: (flags & TEMPLATE_USE_MATHML) !== 0\n\t\t\t\t\t\t? NAMESPACE_MATHML\n\t\t\t\t\t\t: undefined;\n\n\t\t\tnode = fragment_from_tree(structure, ns);\n\t\t\tif (!is_fragment) node = /** @type {TemplateNode} */ (get_first_child(node));\n\t\t}\n\n\t\tvar clone = /** @type {TemplateNode} */ (\n\t\t\tuse_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)\n\t\t);\n\n\t\tif (is_fragment) {\n\t\t\tvar start = /** @type {TemplateNode} */ (get_first_child(clone));\n\t\t\tvar end = /** @type {TemplateNode} */ (clone.lastChild);\n\n\t\t\tassign_nodes(start, end);\n\t\t} else {\n\t\t\tassign_nodes(clone, clone);\n\t\t}\n\n\t\treturn clone;\n\t};\n}\n\n/**\n * @param {() => Element | DocumentFragment} fn\n */\nexport function with_script(fn) {\n\treturn () => run_scripts(fn());\n}\n\n/**\n * Creating a document fragment from HTML that contains script tags will not execute\n * the scripts. We need to replace the script tags with new ones so that they are executed.\n * @param {Element | DocumentFragment} node\n * @returns {Node | Node[]}\n */\nfunction run_scripts(node) {\n\t// scripts were SSR'd, in which case they will run\n\tif (hydrating) return node;\n\n\tconst is_fragment = node.nodeType === DOCUMENT_FRAGMENT_NODE;\n\tconst scripts =\n\t\t/** @type {HTMLElement} */ (node).nodeName === SCRIPT_TAG\n\t\t\t? [/** @type {HTMLScriptElement} */ (node)]\n\t\t\t: node.querySelectorAll('script');\n\n\tconst effect = /** @type {Effect & { nodes: EffectNodes }} */ (active_effect);\n\n\tfor (const script of scripts) {\n\t\tconst clone = create_element('script');\n\t\tfor (var attribute of script.attributes) {\n\t\t\tclone.setAttribute(attribute.name, attribute.value);\n\t\t}\n\n\t\tclone.textContent = script.textContent;\n\n\t\t// The script has changed - if it's at the edges, the effect now points at dead nodes\n\t\tif (is_fragment ? node.firstChild === script : node === script) {\n\t\t\teffect.nodes.start = clone;\n\t\t}\n\t\tif (is_fragment ? node.lastChild === script : node === script) {\n\t\t\teffect.nodes.end = clone;\n\t\t}\n\n\t\tscript.replaceWith(clone);\n\t}\n\treturn node;\n}\n\n/**\n * Don't mark this as side-effect-free, hydration needs to walk all nodes\n * @param {any} value\n */\nexport function text(value = '') {\n\tif (!hydrating) {\n\t\tvar t = create_text(value + '');\n\t\tassign_nodes(t, t);\n\t\treturn t;\n\t}\n\n\tvar node = hydrate_node;\n\n\tif (node.nodeType !== TEXT_NODE) {\n\t\t// if an {expression} is empty during SSR, we need to insert an empty text node\n\t\tnode.before((node = create_text()));\n\t\tset_hydrate_node(node);\n\t} else {\n\t\tmerge_text_nodes(/** @type {Text} */ (node));\n\t}\n\n\tassign_nodes(node, node);\n\treturn node;\n}\n\n/**\n * @returns {TemplateNode | DocumentFragment}\n */\nexport function comment() {\n\t// we're not delegating to `template` here for performance reasons\n\tif (hydrating) {\n\t\tassign_nodes(hydrate_node, null);\n\t\treturn hydrate_node;\n\t}\n\n\tvar frag = document.createDocumentFragment();\n\tvar start = document.createComment('');\n\tvar anchor = create_text();\n\tfrag.append(start, anchor);\n\n\tassign_nodes(start, anchor);\n\n\treturn frag;\n}\n\n/**\n * Assign the created (or in hydration mode, traversed) dom elements to the current block\n * and insert the elements into the dom (in client mode).\n * @param {Text | Comment | Element} anchor\n * @param {DocumentFragment | Element} dom\n */\nexport function append(anchor, dom) {\n\tif (hydrating) {\n\t\tvar effect = /** @type {Effect & { nodes: EffectNodes }} */ (active_effect);\n\n\t\t// When hydrating and outer component and an inner component is async, i.e. blocked on a promise,\n\t\t// then by the time the inner resolves we have already advanced to the end of the hydrated nodes\n\t\t// of the parent component. Check for defined for that reason to avoid rewinding the parent's end marker.\n\t\tif ((effect.f & REACTION_RAN) === 0 || effect.nodes.end === null) {\n\t\t\teffect.nodes.end = hydrate_node;\n\t\t}\n\n\t\thydrate_next();\n\t\treturn;\n\t}\n\n\tif (anchor === null) {\n\t\t// edge case โ€” void `` with content\n\t\treturn;\n\t}\n\n\tanchor.before(/** @type {Node} */ (dom));\n}\n\n/**\n * Create (or hydrate) an unique UID for the component instance.\n */\nexport function props_id() {\n\tif (\n\t\thydrating &&\n\t\thydrate_node &&\n\t\thydrate_node.nodeType === COMMENT_NODE &&\n\t\thydrate_node.textContent?.startsWith(`$`)\n\t) {\n\t\tconst id = hydrate_node.textContent.substring(1);\n\t\thydrate_next();\n\t\treturn id;\n\t}\n\n\t// @ts-expect-error This way we ensure the id is unique even across Svelte runtimes\n\t(window.__svelte ??= {}).uid ??= 1;\n\n\t// @ts-expect-error\n\treturn `c${window.__svelte.uid++}`;\n}\n","import { get, tick, untrack } from '../internal/client/runtime.js';\nimport { effect_tracking, render_effect } from '../internal/client/reactivity/effects.js';\nimport { source, increment } from '../internal/client/reactivity/sources.js';\nimport { tag } from '../internal/client/dev/tracing.js';\nimport { DEV } from 'esm-env';\nimport { queue_micro_task } from '../internal/client/dom/task.js';\n\n/**\n * Returns a `subscribe` function that integrates external event-based systems with Svelte's reactivity.\n * It's particularly useful for integrating with web APIs like `MediaQuery`, `IntersectionObserver`, or `WebSocket`.\n *\n * If `subscribe` is called inside an effect (including indirectly, for example inside a getter),\n * the `start` callback will be called with an `update` function. Whenever `update` is called, the effect re-runs.\n *\n * If `start` returns a cleanup function, it will be called when the effect is destroyed.\n *\n * If `subscribe` is called in multiple effects, `start` will only be called once as long as the effects\n * are active, and the returned teardown function will only be called when all effects are destroyed.\n *\n * It's best understood with an example. Here's an implementation of [`MediaQuery`](https://svelte.dev/docs/svelte/svelte-reactivity#MediaQuery):\n *\n * ```js\n * import { createSubscriber } from 'svelte/reactivity';\n * import { on } from 'svelte/events';\n *\n * export class MediaQuery {\n * \t#query;\n * \t#subscribe;\n *\n * \tconstructor(query) {\n * \t\tthis.#query = window.matchMedia(`(${query})`);\n *\n * \t\tthis.#subscribe = createSubscriber((update) => {\n * \t\t\t// when the `change` event occurs, re-run any effects that read `this.current`\n * \t\t\tconst off = on(this.#query, 'change', update);\n *\n * \t\t\t// stop listening when all the effects are destroyed\n * \t\t\treturn () => off();\n * \t\t});\n * \t}\n *\n * \tget current() {\n * \t\t// This makes the getter reactive, if read in an effect\n * \t\tthis.#subscribe();\n *\n * \t\t// Return the current state of the query, whether or not we're in an effect\n * \t\treturn this.#query.matches;\n * \t}\n * }\n * ```\n * @param {(update: () => void) => (() => void) | void} start\n * @since 5.7.0\n */\nexport function createSubscriber(start) {\n\tlet subscribers = 0;\n\tlet version = source(0);\n\t/** @type {(() => void) | void} */\n\tlet stop;\n\n\tif (DEV) {\n\t\ttag(version, 'createSubscriber version');\n\t}\n\n\treturn () => {\n\t\tif (effect_tracking()) {\n\t\t\tget(version);\n\n\t\t\trender_effect(() => {\n\t\t\t\tif (subscribers === 0) {\n\t\t\t\t\tstop = untrack(() => start(() => increment(version)));\n\t\t\t\t}\n\n\t\t\t\tsubscribers += 1;\n\n\t\t\t\treturn () => {\n\t\t\t\t\tqueue_micro_task(() => {\n\t\t\t\t\t\t// Only count down after a microtask, else we would reach 0 before our own render effect reruns,\n\t\t\t\t\t\t// but reach 1 again when the tick callback of the prior teardown runs. That would mean we\n\t\t\t\t\t\t// re-subcribe unnecessarily and create a memory leak because the old subscription is never cleaned up.\n\t\t\t\t\t\tsubscribers -= 1;\n\n\t\t\t\t\t\tif (subscribers === 0) {\n\t\t\t\t\t\t\tstop?.();\n\t\t\t\t\t\t\tstop = undefined;\n\t\t\t\t\t\t\t// Increment the version to ensure any dependent deriveds are marked dirty when the subscription is picked up again later.\n\t\t\t\t\t\t\t// If we didn't do this then the comparison of write versions would determine that the derived has a later version than\n\t\t\t\t\t\t\t// the subscriber, and it would not be re-run.\n\t\t\t\t\t\t\tincrement(version);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t};\n}\n","/** @import { Effect, Source, TemplateNode, } from '#client' */\nimport {\n\tBOUNDARY_EFFECT,\n\tDESTROYED,\n\tDESTROYING,\n\tEFFECT_PRESERVED,\n\tEFFECT_TRANSPARENT\n} from '#client/constants';\nimport {\n\tHYDRATION_ERROR,\n\tHYDRATION_START_ELSE,\n\tHYDRATION_START_FAILED\n} from '../../../../constants.js';\nimport { component_context, set_component_context } from '../../context.js';\nimport { invoke_error_boundary } from '../../error-handling.js';\nimport {\n\tblock,\n\tbranch,\n\tdestroy_effect,\n\tmove_effect,\n\tpause_effect\n} from '../../reactivity/effects.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tget,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tnext,\n\tread_hydration_instruction,\n\tskip_nodes,\n\tset_hydrate_node\n} from '../hydration.js';\nimport { queue_micro_task } from '../task.js';\nimport * as e from '../../errors.js';\nimport * as w from '../../warnings.js';\nimport { DEV } from 'esm-env';\nimport { Batch, current_batch } from '../../reactivity/batch.js';\nimport { internal_set, source } from '../../reactivity/sources.js';\nimport { tag } from '../../dev/tracing.js';\nimport { createSubscriber } from '../../../../reactivity/create-subscriber.js';\nimport { create_text } from '../operations.js';\nimport { defer_effect } from '../../reactivity/utils.js';\n\n/**\n * @typedef {{\n * \t onerror?: ((error: unknown, reset: () => void) => void) | null;\n * failed?: ((anchor: Node, error: () => unknown, reset: () => () => void) => void) | null;\n * pending?: ((anchor: Node) => void) | null;\n * }} BoundaryProps\n */\n\nvar flags = EFFECT_TRANSPARENT | EFFECT_PRESERVED;\n\n/**\n * @param {TemplateNode} node\n * @param {BoundaryProps} props\n * @param {((anchor: Node) => void)} children\n * @param {((error: unknown) => unknown) | undefined} [transform_error]\n * @returns {void}\n */\nexport function boundary(node, props, children, transform_error) {\n\tnew Boundary(node, props, children, transform_error);\n}\n\nexport class Boundary {\n\t/** @type {Boundary | null} */\n\tparent;\n\n\tis_pending = false;\n\n\t/**\n\t * API-level transformError transform function. Transforms errors before they reach the `failed` snippet.\n\t * Inherited from parent boundary, or defaults to identity.\n\t * @type {(error: unknown) => unknown}\n\t */\n\ttransform_error;\n\n\t/** @type {TemplateNode} */\n\t#anchor;\n\n\t/** @type {TemplateNode | null} */\n\t#hydrate_open = hydrating ? hydrate_node : null;\n\n\t/** @type {BoundaryProps} */\n\t#props;\n\n\t/** @type {((anchor: Node) => void)} */\n\t#children;\n\n\t/** @type {Effect} */\n\t#effect;\n\n\t/** @type {Effect | null} */\n\t#main_effect = null;\n\n\t/** @type {Effect | null} */\n\t#pending_effect = null;\n\n\t/** @type {Effect | null} */\n\t#failed_effect = null;\n\n\t/** @type {DocumentFragment | null} */\n\t#offscreen_fragment = null;\n\n\t#local_pending_count = 0;\n\t#pending_count = 0;\n\t#pending_count_update_queued = false;\n\n\t/** @type {Set} */\n\t#dirty_effects = new Set();\n\n\t/** @type {Set} */\n\t#maybe_dirty_effects = new Set();\n\n\t/**\n\t * A source containing the number of pending async deriveds/expressions.\n\t * Only created if `$effect.pending()` is used inside the boundary,\n\t * otherwise updating the source results in needless `Batch.ensure()`\n\t * calls followed by no-op flushes\n\t * @type {Source | null}\n\t */\n\t#effect_pending = null;\n\n\t#effect_pending_subscriber = createSubscriber(() => {\n\t\tthis.#effect_pending = source(this.#local_pending_count);\n\n\t\tif (DEV) {\n\t\t\ttag(this.#effect_pending, '$effect.pending()');\n\t\t}\n\n\t\treturn () => {\n\t\t\tthis.#effect_pending = null;\n\t\t};\n\t});\n\n\t/**\n\t * @param {TemplateNode} node\n\t * @param {BoundaryProps} props\n\t * @param {((anchor: Node) => void)} children\n\t * @param {((error: unknown) => unknown) | undefined} [transform_error]\n\t */\n\tconstructor(node, props, children, transform_error) {\n\t\tthis.#anchor = node;\n\t\tthis.#props = props;\n\n\t\tthis.#children = (anchor) => {\n\t\t\tvar effect = /** @type {Effect} */ (active_effect);\n\n\t\t\teffect.b = this;\n\t\t\teffect.f |= BOUNDARY_EFFECT;\n\n\t\t\tchildren(anchor);\n\t\t};\n\n\t\tthis.parent = /** @type {Effect} */ (active_effect).b;\n\n\t\t// Inherit transform_error from parent boundary, or use the provided one, or default to identity\n\t\tthis.transform_error = transform_error ?? this.parent?.transform_error ?? ((e) => e);\n\n\t\tthis.#effect = block(() => {\n\t\t\tif (hydrating) {\n\t\t\t\tconst comment_data = read_hydration_instruction(\n\t\t\t\t\t/** @type {TemplateNode} */ (this.#hydrate_open)\n\t\t\t\t);\n\t\t\t\thydrate_next();\n\n\t\t\t\tconst server_rendered_pending = comment_data === HYDRATION_START_ELSE;\n\t\t\t\tconst server_rendered_failed = comment_data.startsWith(HYDRATION_START_FAILED);\n\n\t\t\t\tif (server_rendered_failed) {\n\t\t\t\t\t// Server rendered the failed snippet - hydrate it.\n\t\t\t\t\t// The serialized error is embedded in the comment: \n\t\t\t\t\tconst serialized_error = JSON.parse(comment_data.slice(HYDRATION_START_FAILED.length));\n\t\t\t\t\tthis.#hydrate_failed_content(serialized_error);\n\t\t\t\t} else if (server_rendered_pending) {\n\t\t\t\t\tthis.#hydrate_pending_content();\n\t\t\t\t} else {\n\t\t\t\t\tthis.#hydrate_resolved_content();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.#render();\n\t\t\t}\n\t\t}, flags);\n\n\t\tif (hydrating) {\n\t\t\tthis.#anchor = hydrate_node;\n\t\t}\n\t}\n\n\t#hydrate_resolved_content() {\n\t\ttry {\n\t\t\tthis.#main_effect = branch(() => this.#children(this.#anchor));\n\t\t} catch (error) {\n\t\t\tthis.error(error);\n\t\t}\n\t}\n\n\t/**\n\t * @param {unknown} error The deserialized error from the server's hydration comment\n\t */\n\t#hydrate_failed_content(error) {\n\t\tconst failed = this.#props.failed;\n\t\tconst { reset, invoke_onerror } = this.#create_reset(error);\n\n\t\t// `onerror` may mutate state, which is disallowed while hydrating\n\t\tqueue_micro_task(invoke_onerror);\n\n\t\tif (!failed) return;\n\n\t\tthis.#failed_effect = branch(() => {\n\t\t\tfailed(\n\t\t\t\tthis.#anchor,\n\t\t\t\t() => error,\n\t\t\t\t() => reset\n\t\t\t);\n\t\t});\n\t}\n\n\t/**\n\t * Creates the `reset` function for a failed boundary, along with a function\n\t * that invokes `onerror` with it (if provided)\n\t * @param {unknown} error\n\t * @returns {{ reset: () => void, invoke_onerror: () => void }}\n\t */\n\t#create_reset(error) {\n\t\tvar did_reset = false;\n\t\tvar calling_on_error = false;\n\n\t\tconst reset = () => {\n\t\t\tif (this.#is_destroyed()) return;\n\n\t\t\tif (did_reset) {\n\t\t\t\tw.svelte_boundary_reset_noop();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdid_reset = true;\n\n\t\t\tif (calling_on_error) {\n\t\t\t\te.svelte_boundary_reset_onerror();\n\t\t\t}\n\n\t\t\tif (this.#failed_effect !== null) {\n\t\t\t\tpause_effect(this.#failed_effect, () => {\n\t\t\t\t\tthis.#failed_effect = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis.#run(() => {\n\t\t\t\tthis.#render();\n\t\t\t});\n\t\t};\n\n\t\tconst invoke_onerror = () => {\n\t\t\tif (this.#is_destroyed()) return;\n\n\t\t\ttry {\n\t\t\t\tcalling_on_error = true;\n\t\t\t\tthis.#props.onerror?.(error, reset);\n\t\t\t\tcalling_on_error = false;\n\t\t\t} catch (err) {\n\t\t\t\tinvoke_error_boundary(err, this.#effect && this.#effect.parent);\n\t\t\t}\n\t\t};\n\n\t\treturn { reset, invoke_onerror };\n\t}\n\n\t#is_destroyed() {\n\t\treturn (this.#effect.f & (DESTROYED | DESTROYING)) !== 0;\n\t}\n\n\t#hydrate_pending_content() {\n\t\tconst pending = this.#props.pending;\n\t\tif (!pending) return;\n\n\t\tthis.is_pending = true;\n\t\tthis.#pending_effect = branch(() => pending(this.#anchor));\n\n\t\tqueue_micro_task(() => {\n\t\t\tif (this.#is_destroyed()) return;\n\n\t\t\tvar fragment = (this.#offscreen_fragment = document.createDocumentFragment());\n\t\t\tvar anchor = create_text();\n\t\t\tvar handled = false;\n\n\t\t\tfragment.append(anchor);\n\n\t\t\tthis.#main_effect = this.#run(() => {\n\t\t\t\ttry {\n\t\t\t\t\treturn branch(() => this.#children(anchor));\n\t\t\t\t} catch (error) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.error(error);\n\t\t\t\t\t\thandled = true;\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tinvoke_error_boundary(error, this.#effect.parent);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (this.#main_effect === null) {\n\t\t\t\tthis.#offscreen_fragment = null;\n\t\t\t\tif (handled) this.#resolve(/** @type {Batch} */ (current_batch));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.#pending_count === 0) {\n\t\t\t\tthis.#anchor.before(fragment);\n\t\t\t\tthis.#offscreen_fragment = null;\n\n\t\t\t\tpause_effect(/** @type {Effect} */ (this.#pending_effect), () => {\n\t\t\t\t\tthis.#pending_effect = null;\n\t\t\t\t});\n\n\t\t\t\tthis.#resolve(/** @type {Batch} */ (current_batch));\n\t\t\t}\n\t\t});\n\t}\n\n\t#render() {\n\t\ttry {\n\t\t\tthis.is_pending = this.has_pending_snippet();\n\t\t\tthis.#pending_count = 0;\n\t\t\tthis.#local_pending_count = 0;\n\n\t\t\tthis.#main_effect = branch(() => {\n\t\t\t\tthis.#children(this.#anchor);\n\t\t\t});\n\n\t\t\tif (this.#pending_count > 0) {\n\t\t\t\tvar fragment = (this.#offscreen_fragment = document.createDocumentFragment());\n\t\t\t\tmove_effect(this.#main_effect, fragment);\n\n\t\t\t\tconst pending = /** @type {(anchor: Node) => void} */ (this.#props.pending);\n\t\t\t\tthis.#pending_effect = branch(() => pending(this.#anchor));\n\t\t\t} else {\n\t\t\t\tthis.#resolve(/** @type {Batch} */ (current_batch));\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.error(error);\n\t\t}\n\t}\n\n\t/**\n\t * @param {Batch} batch\n\t */\n\t#resolve(batch) {\n\t\tthis.is_pending = false;\n\n\t\t// any effects that were previously deferred should be transferred\n\t\t// to the batch, which will flush in the next microtask\n\t\tbatch.transfer_effects(this.#dirty_effects, this.#maybe_dirty_effects);\n\t}\n\n\t/**\n\t * Defer an effect inside a pending boundary until the boundary resolves\n\t * @param {Effect} effect\n\t */\n\tdefer_effect(effect) {\n\t\tdefer_effect(effect, this.#dirty_effects, this.#maybe_dirty_effects);\n\t}\n\n\t/**\n\t * Returns `false` if the effect exists inside a boundary whose pending snippet is shown\n\t * @returns {boolean}\n\t */\n\tis_rendered() {\n\t\treturn !this.is_pending && (!this.parent || this.parent.is_rendered());\n\t}\n\n\thas_pending_snippet() {\n\t\treturn !!this.#props.pending;\n\t}\n\n\t/**\n\t * @template T\n\t * @param {() => T} fn\n\t */\n\t#run(fn) {\n\t\tvar previous_effect = active_effect;\n\t\tvar previous_reaction = active_reaction;\n\t\tvar previous_ctx = component_context;\n\n\t\tset_active_effect(this.#effect);\n\t\tset_active_reaction(this.#effect);\n\t\tset_component_context(this.#effect.ctx);\n\n\t\ttry {\n\t\t\tBatch.ensure();\n\t\t\treturn fn();\n\t\t} finally {\n\t\t\tset_active_effect(previous_effect);\n\t\t\tset_active_reaction(previous_reaction);\n\t\t\tset_component_context(previous_ctx);\n\t\t}\n\t}\n\n\t/**\n\t * Updates the pending count associated with the currently visible pending snippet,\n\t * if any, such that we can replace the snippet with content once work is done\n\t * @param {1 | -1} d\n\t * @param {Batch} batch\n\t */\n\t#update_pending_count(d, batch) {\n\t\tif (!this.has_pending_snippet()) {\n\t\t\tif (this.parent) {\n\t\t\t\tthis.parent.#update_pending_count(d, batch);\n\t\t\t}\n\n\t\t\t// if there's no parent, we're in a scope with no pending snippet\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#pending_count += d;\n\n\t\tif (this.#pending_count === 0) {\n\t\t\tthis.#resolve(batch);\n\n\t\t\tif (this.#pending_effect) {\n\t\t\t\tpause_effect(this.#pending_effect, () => {\n\t\t\t\t\tthis.#pending_effect = null;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (this.#offscreen_fragment) {\n\t\t\t\tthis.#anchor.before(this.#offscreen_fragment);\n\t\t\t\tthis.#offscreen_fragment = null;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Update the source that powers `$effect.pending()` inside this boundary,\n\t * and controls when the current `pending` snippet (if any) is removed.\n\t * Do not call from inside the class\n\t * @param {1 | -1} d\n\t * @param {Batch} batch\n\t */\n\tupdate_pending_count(d, batch) {\n\t\tthis.#update_pending_count(d, batch);\n\n\t\tthis.#local_pending_count += d;\n\n\t\tif (!this.#effect_pending || this.#pending_count_update_queued) return;\n\t\tthis.#pending_count_update_queued = true;\n\n\t\tqueue_micro_task(() => {\n\t\t\tthis.#pending_count_update_queued = false;\n\t\t\tif (this.#effect_pending) {\n\t\t\t\tinternal_set(this.#effect_pending, this.#local_pending_count);\n\t\t\t}\n\t\t});\n\t}\n\n\tget_effect_pending() {\n\t\tthis.#effect_pending_subscriber();\n\t\treturn get(/** @type {Source} */ (this.#effect_pending));\n\t}\n\n\t/** @param {unknown} error */\n\terror(error) {\n\t\tif (error === HYDRATION_ERROR) {\n\t\t\tthrow error;\n\t\t}\n\n\t\t// If we have nothing to capture the error, or if we hit an error while\n\t\t// rendering the fallback, re-throw for another boundary to handle\n\t\tif (!this.#props.onerror && !this.#props.failed) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (current_batch?.is_fork) {\n\t\t\tif (this.#main_effect) current_batch.skip_effect(this.#main_effect);\n\t\t\tif (this.#pending_effect) current_batch.skip_effect(this.#pending_effect);\n\t\t\tif (this.#failed_effect) current_batch.skip_effect(this.#failed_effect);\n\n\t\t\tcurrent_batch.oncommit(() => {\n\t\t\t\tif (!this.#is_destroyed()) this.#handle_error(error);\n\t\t\t});\n\t\t} else {\n\t\t\tthis.#handle_error(error);\n\t\t}\n\t}\n\n\t/**\n\t * @param {unknown} error\n\t */\n\t#handle_error(error) {\n\t\tif (this.#main_effect) {\n\t\t\tdestroy_effect(this.#main_effect);\n\t\t\tthis.#main_effect = null;\n\t\t}\n\n\t\tif (this.#pending_effect) {\n\t\t\tdestroy_effect(this.#pending_effect);\n\t\t\tthis.#pending_effect = null;\n\t\t}\n\n\t\tif (this.#failed_effect) {\n\t\t\tdestroy_effect(this.#failed_effect);\n\t\t\tthis.#failed_effect = null;\n\t\t}\n\n\t\tif (hydrating) {\n\t\t\tset_hydrate_node(/** @type {TemplateNode} */ (this.#hydrate_open));\n\t\t\tnext();\n\t\t\tset_hydrate_node(skip_nodes());\n\t\t}\n\n\t\tlet failed = this.#props.failed;\n\n\t\t/** @param {unknown} transformed_error */\n\t\tconst handle_error_result = (transformed_error) => {\n\t\t\tif (this.#is_destroyed()) return;\n\n\t\t\tconst { reset, invoke_onerror } = this.#create_reset(transformed_error);\n\n\t\t\tinvoke_onerror();\n\n\t\t\tif (failed && !this.#is_destroyed()) {\n\t\t\t\tthis.#failed_effect = this.#run(() => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn branch(() => {\n\t\t\t\t\t\t\t// errors in `failed` snippets cause the boundary to error again\n\t\t\t\t\t\t\t// TODO Svelte 6: revisit this decision, most likely better to go to parent boundary instead\n\t\t\t\t\t\t\tvar effect = /** @type {Effect} */ (active_effect);\n\n\t\t\t\t\t\t\teffect.b = this;\n\t\t\t\t\t\t\teffect.f |= BOUNDARY_EFFECT;\n\n\t\t\t\t\t\t\tfailed(\n\t\t\t\t\t\t\t\tthis.#anchor,\n\t\t\t\t\t\t\t\t() => transformed_error,\n\t\t\t\t\t\t\t\t() => reset\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tinvoke_error_boundary(error, /** @type {Effect} */ (this.#effect.parent));\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tqueue_micro_task(() => {\n\t\t\tif (this.#is_destroyed()) return;\n\n\t\t\t// Run the error through the API-level transformError transform (e.g. SvelteKit's handleError)\n\t\t\t/** @type {unknown} */\n\t\t\tvar result;\n\t\t\ttry {\n\t\t\t\tresult = this.transform_error(error);\n\t\t\t} catch (e) {\n\t\t\t\tinvoke_error_boundary(e, this.#effect && this.#effect.parent);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tresult !== null &&\n\t\t\t\ttypeof result === 'object' &&\n\t\t\t\ttypeof (/** @type {any} */ (result).then) === 'function'\n\t\t\t) {\n\t\t\t\t// transformError returned a Promise โ€” wait for it\n\t\t\t\t/** @type {any} */ (result).then(\n\t\t\t\t\thandle_error_result,\n\t\t\t\t\t/** @param {unknown} e */\n\t\t\t\t\t(e) => invoke_error_boundary(e, this.#effect && this.#effect.parent)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t// Synchronous result โ€” handle immediately\n\t\t\t\thandle_error_result(result);\n\t\t\t}\n\t\t});\n\t}\n}\n\nexport function pending() {\n\tif (active_effect === null) {\n\t\te.effect_pending_outside_reaction();\n\t}\n\n\tvar boundary = active_effect.b;\n\n\tif (boundary === null) {\n\t\treturn 0; // TODO eventually we will need this to be global\n\t}\n\n\treturn boundary.get_effect_pending();\n}\n","/** @import { ComponentContext, Effect, EffectNodes, TemplateNode } from '#client' */\n/** @import { Component, ComponentType, SvelteComponent, MountOptions } from '../../index.js' */\nimport { DEV } from 'esm-env';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tinit_operations\n} from './dom/operations.js';\nimport { HYDRATION_END, HYDRATION_ERROR, HYDRATION_START } from '../../constants.js';\nimport { active_effect } from './runtime.js';\nimport { push, pop, component_context, mark_as_component } from './context.js';\nimport { component_root } from './reactivity/effects.js';\nimport { hydrate_node, hydrating, set_hydrate_node, set_hydrating } from './dom/hydration.js';\nimport { array_from } from '../shared/utils.js';\nimport {\n\tall_registered_events,\n\thandle_event_propagation,\n\troot_event_handles\n} from './dom/elements/events.js';\nimport * as w from './warnings.js';\nimport * as e from './errors.js';\nimport { assign_nodes } from './dom/template.js';\nimport { is_passive_event } from '../../utils.js';\nimport { COMMENT_NODE, TEXT_CACHE } from './constants.js';\nimport { boundary } from './dom/blocks/boundary.js';\n\n/**\n * This is normally true โ€” block effects should run their intro transitions โ€”\n * but is false during hydration (unless `options.intro` is `true`) and\n * when creating the children of a `` that just changed tag\n */\nexport let should_intro = true;\n\n/** @param {boolean} value */\nexport function set_should_intro(value) {\n\tshould_intro = value;\n}\n\n/**\n * @param {Element} text\n * @param {string} value\n * @returns {void}\n */\nexport function set_text(text, value) {\n\t// For objects, we apply string coercion (which might make things like $state array references in the template reactive) before diffing\n\tvar str = value == null ? '' : typeof value === 'object' ? `${value}` : value;\n\t// prettier-ignore\n\tif (str !== (/** @type {any} */ (text)[TEXT_CACHE] ??= text.nodeValue)) {\n\t\t/** @type {any} */ (text)[TEXT_CACHE] = str;\n\t\ttext.nodeValue = `${str}`;\n\t}\n}\n\n/**\n * Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.\n * Transitions will play during the initial render unless the `intro` option is set to `false`.\n *\n * @template {Record} Props\n * @template {Record} Exports\n * @param {ComponentType> | Component} component\n * @param {MountOptions} options\n * @returns {Exports}\n */\nexport function mount(component, options) {\n\treturn _mount(component, options);\n}\n\n/**\n * Hydrates a component on the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component\n *\n * @template {Record} Props\n * @template {Record} Exports\n * @param {ComponentType> | Component} component\n * @param {{} extends Props ? {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops?: Props;\n * \t\tevents?: Record any>;\n * \tcontext?: Map;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n *\t\ttransformError?: (error: unknown) => unknown;\n * \t} : {\n * \t\ttarget: Document | Element | ShadowRoot;\n * \t\tprops: Props;\n * \t\tevents?: Record any>;\n * \tcontext?: Map;\n * \t\tintro?: boolean;\n * \t\trecover?: boolean;\n *\t\ttransformError?: (error: unknown) => unknown;\n * \t}} options\n * @returns {Exports}\n */\nexport function hydrate(component, options) {\n\tinit_operations();\n\toptions.intro = options.intro ?? false;\n\tconst target = options.target;\n\tconst was_hydrating = hydrating;\n\tconst previous_hydrate_node = hydrate_node;\n\n\ttry {\n\t\tvar anchor = get_first_child(target);\n\n\t\twhile (\n\t\t\tanchor &&\n\t\t\t(anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */ (anchor).data !== HYDRATION_START)\n\t\t) {\n\t\t\tanchor = get_next_sibling(anchor);\n\t\t}\n\n\t\tif (!anchor) {\n\t\t\tthrow HYDRATION_ERROR;\n\t\t}\n\n\t\tset_hydrating(true);\n\t\tset_hydrate_node(/** @type {Comment} */ (anchor));\n\n\t\tconst instance = _mount(component, { ...options, anchor });\n\n\t\tset_hydrating(false);\n\n\t\treturn /** @type {Exports} */ (instance);\n\t} catch (error) {\n\t\t// re-throw Svelte errors - they are certainly not related to hydration\n\t\tif (\n\t\t\terror instanceof Error &&\n\t\t\terror.message.split('\\n').some((line) => line.startsWith('https://svelte.dev/e/'))\n\t\t) {\n\t\t\tthrow error;\n\t\t}\n\t\tif (error !== HYDRATION_ERROR) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('Failed to hydrate: ', error);\n\t\t}\n\n\t\tif (options.recover === false) {\n\t\t\te.hydration_failed();\n\t\t}\n\n\t\t// If an error occurred above, the operations might not yet have been initialised.\n\t\tinit_operations();\n\t\tclear_text_content(target);\n\n\t\tset_hydrating(false);\n\t\treturn mount(component, options);\n\t} finally {\n\t\tset_hydrating(was_hydrating);\n\t\tset_hydrate_node(previous_hydrate_node);\n\t}\n}\n\n/** @type {Map>} */\nconst listeners = new Map();\n\n/**\n * @template {Record} Exports\n * @param {ComponentType> | Component} Component\n * @param {MountOptions} options\n * @returns {Exports}\n */\nfunction _mount(\n\tComponent,\n\t{ target, anchor, props = {}, events, context, intro = true, transformError }\n) {\n\tinit_operations();\n\n\t/** @type {Exports} */\n\t// @ts-expect-error will be defined because the render effect runs synchronously\n\tvar component = undefined;\n\n\tvar unmount = component_root(() => {\n\t\tvar anchor_node = anchor ?? target.appendChild(create_text());\n\n\t\tboundary(\n\t\t\t/** @type {TemplateNode} */ (anchor_node),\n\t\t\t{\n\t\t\t\tpending: () => {}\n\t\t\t},\n\t\t\t(anchor_node) => {\n\t\t\t\tpush({});\n\t\t\t\tvar ctx = /** @type {ComponentContext} */ (component_context);\n\t\t\t\tif (context) ctx.c = context;\n\n\t\t\t\tif (events) {\n\t\t\t\t\t// We can't spread the object or else we'd lose the state proxy stuff, if it is one\n\t\t\t\t\t/** @type {any} */ (props).$$events = events;\n\t\t\t\t}\n\n\t\t\t\tif (hydrating) {\n\t\t\t\t\tassign_nodes(/** @type {TemplateNode} */ (anchor_node), null);\n\t\t\t\t}\n\n\t\t\t\tshould_intro = intro;\n\t\t\t\t// @ts-expect-error the public typings are not what the actual function looks like\n\t\t\t\tcomponent = Component(anchor_node, props) || mark_as_component();\n\t\t\t\tshould_intro = true;\n\n\t\t\t\tif (hydrating) {\n\t\t\t\t\t/** @type {Effect & { nodes: EffectNodes }} */ (active_effect).nodes.end = hydrate_node;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\thydrate_node === null ||\n\t\t\t\t\t\thydrate_node.nodeType !== COMMENT_NODE ||\n\t\t\t\t\t\t/** @type {Comment} */ (hydrate_node).data !== HYDRATION_END\n\t\t\t\t\t) {\n\t\t\t\t\t\tw.hydration_mismatch();\n\t\t\t\t\t\tthrow HYDRATION_ERROR;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpop();\n\t\t\t},\n\t\t\ttransformError\n\t\t);\n\n\t\t// Setup event delegation _after_ component is mounted - if an error would happen during mount, it would otherwise not be cleaned up\n\t\t/** @type {Set} */\n\t\tvar registered_events = new Set();\n\n\t\t/** @param {Array} events */\n\t\tvar event_handle = (events) => {\n\t\t\tfor (var i = 0; i < events.length; i++) {\n\t\t\t\tvar event_name = events[i];\n\n\t\t\t\tif (registered_events.has(event_name)) continue;\n\t\t\t\tregistered_events.add(event_name);\n\n\t\t\t\tvar passive = is_passive_event(event_name);\n\n\t\t\t\t// Add the event listener to both the container and the document.\n\t\t\t\t// The container listener ensures we catch events from within in case\n\t\t\t\t// the outer content stops propagation of the event.\n\t\t\t\t//\n\t\t\t\t// The document listener ensures we catch events that originate from elements that were\n\t\t\t\t// manually moved outside of the container (e.g. via manual portals).\n\t\t\t\tfor (const node of [target, document]) {\n\t\t\t\t\tvar counts = listeners.get(node);\n\n\t\t\t\t\tif (counts === undefined) {\n\t\t\t\t\t\tcounts = new Map();\n\t\t\t\t\t\tlisteners.set(node, counts);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar count = counts.get(event_name);\n\n\t\t\t\t\tif (count === undefined) {\n\t\t\t\t\t\tnode.addEventListener(event_name, handle_event_propagation, { passive });\n\t\t\t\t\t\tcounts.set(event_name, 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcounts.set(event_name, count + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tevent_handle(array_from(all_registered_events));\n\t\troot_event_handles.add(event_handle);\n\n\t\treturn () => {\n\t\t\tfor (var event_name of registered_events) {\n\t\t\t\tfor (const node of [target, document]) {\n\t\t\t\t\tvar counts = /** @type {Map} */ (listeners.get(node));\n\t\t\t\t\tvar count = /** @type {number} */ (counts.get(event_name));\n\n\t\t\t\t\tif (--count == 0) {\n\t\t\t\t\t\tnode.removeEventListener(event_name, handle_event_propagation);\n\t\t\t\t\t\tcounts.delete(event_name);\n\n\t\t\t\t\t\tif (counts.size === 0) {\n\t\t\t\t\t\t\tlisteners.delete(node);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcounts.set(event_name, count);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\troot_event_handles.delete(event_handle);\n\n\t\t\tif (anchor_node !== anchor) {\n\t\t\t\tanchor_node.parentNode?.removeChild(anchor_node);\n\t\t\t}\n\t\t};\n\t});\n\n\tmounted_components.set(component, unmount);\n\treturn component;\n}\n\n/**\n * References of the components that were mounted or hydrated.\n * Uses a `WeakMap` to avoid memory leaks.\n */\nlet mounted_components = new WeakMap();\n\n/**\n * Unmounts a component that was previously mounted using `mount` or `hydrate`.\n *\n * Since 5.13.0, if `options.outro` is `true`, [transitions](https://svelte.dev/docs/svelte/transition) will play before the component is removed from the DOM.\n *\n * Returns a `Promise` that resolves after transitions have completed if `options.outro` is true, or immediately otherwise (prior to 5.13.0, returns `void`).\n *\n * ```js\n * import { mount, unmount } from 'svelte';\n * import App from './App.svelte';\n *\n * const app = mount(App, { target: document.body });\n *\n * // later...\n * unmount(app, { outro: true });\n * ```\n * @param {Record} component\n * @param {{ outro?: boolean }} [options]\n * @returns {Promise}\n */\nexport function unmount(component, options) {\n\tconst fn = mounted_components.get(component);\n\n\tif (fn) {\n\t\tmounted_components.delete(component);\n\t\treturn fn(options);\n\t}\n\n\tif (DEV) {\n\t\tw.lifecycle_double_unmount();\n\t}\n\n\treturn Promise.resolve();\n}\n","/** @import { Effect, TemplateNode } from '#client' */\nimport { Batch, current_batch } from '../../reactivity/batch.js';\nimport {\n\tbranch,\n\tdestroy_effect,\n\tmove_effect,\n\tpause_effect,\n\tresume_effect\n} from '../../reactivity/effects.js';\nimport { HMR_ANCHOR } from '../../constants.js';\nimport { hydrate_node, hydrating } from '../hydration.js';\nimport { create_text, should_defer_append } from '../operations.js';\nimport { DEV } from 'esm-env';\n\n/**\n * @typedef {{ effect: Effect, fragment: DocumentFragment }} Branch\n */\n\n/**\n * @template Key\n */\nexport class BranchManager {\n\t/** @type {TemplateNode} */\n\tanchor;\n\n\t/** @type {Map} */\n\t#batches = new Map();\n\n\t/**\n\t * Map of keys to effects that are currently rendered in the DOM.\n\t * These effects are visible and actively part of the document tree.\n\t * Example:\n\t * ```\n\t * {#if condition}\n\t * \tfoo\n\t * {:else}\n\t * \tbar\n\t * {/if}\n\t * ```\n\t * Can result in the entries `true->Effect` and `false->Effect`\n\t * @type {Map}\n\t */\n\t#onscreen = new Map();\n\n\t/**\n\t * Similar to #onscreen with respect to the keys, but contains branches that are not yet\n\t * in the DOM, because their insertion is deferred.\n\t * @type {Map}\n\t */\n\t#offscreen = new Map();\n\n\t/**\n\t * Keys of effects that are currently outroing\n\t * @type {Set}\n\t */\n\t#outroing = new Set();\n\n\t/**\n\t * Whether to pause (i.e. outro) on change, or destroy immediately.\n\t * This is necessary for ``\n\t */\n\t#transition = true;\n\n\t/**\n\t * @param {TemplateNode} anchor\n\t * @param {boolean} transition\n\t */\n\tconstructor(anchor, transition = true) {\n\t\tthis.anchor = anchor;\n\t\tthis.#transition = transition;\n\t}\n\n\t/**\n\t * @param {Batch} batch\n\t */\n\t#commit = (batch) => {\n\t\t// if this batch was made obsolete, bail\n\t\tif (!this.#batches.has(batch)) return;\n\n\t\tvar key = /** @type {Key} */ (this.#batches.get(batch));\n\n\t\tvar onscreen = this.#onscreen.get(key);\n\n\t\tif (onscreen) {\n\t\t\t// effect is already in the DOM โ€” abort any current outro\n\t\t\tresume_effect(onscreen);\n\t\t\tthis.#outroing.delete(key);\n\t\t} else {\n\t\t\t// effect is currently offscreen. put it in the DOM\n\t\t\tvar offscreen = this.#offscreen.get(key);\n\n\t\t\tif (offscreen) {\n\t\t\t\t// effect could have been outro'ed before through a prior batch โ€” resume if necessary\n\t\t\t\tresume_effect(offscreen.effect);\n\t\t\t\tthis.#onscreen.set(key, offscreen.effect);\n\t\t\t\tthis.#offscreen.delete(key);\n\n\t\t\t\tif (DEV) {\n\t\t\t\t\t// Tell hmr.js about the anchor it should use for updates,\n\t\t\t\t\t// since the initial one will be removed\n\t\t\t\t\t/** @type {any} */ (offscreen.fragment.lastChild)[HMR_ANCHOR] = this.anchor;\n\t\t\t\t}\n\n\t\t\t\t// remove the anchor...\n\t\t\t\t/** @type {TemplateNode} */ (offscreen.fragment.lastChild).remove();\n\n\t\t\t\t// ...and append the fragment\n\t\t\t\tthis.anchor.before(offscreen.fragment);\n\t\t\t\tonscreen = offscreen.effect;\n\t\t\t}\n\t\t}\n\n\t\tfor (const [b, k] of this.#batches) {\n\t\t\tthis.#batches.delete(b);\n\n\t\t\tif (b === batch) {\n\t\t\t\t// keep values for newer batches\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst offscreen = this.#offscreen.get(k);\n\n\t\t\tif (offscreen) {\n\t\t\t\t// for older batches, destroy offscreen effects\n\t\t\t\t// as they will never be committed\n\t\t\t\tdestroy_effect(offscreen.effect);\n\t\t\t\tthis.#offscreen.delete(k);\n\t\t\t}\n\t\t}\n\n\t\t// outro/destroy all onscreen effects...\n\t\tfor (const [k, effect] of this.#onscreen) {\n\t\t\t// ...except the one that was just committed\n\t\t\t// or those that are already outroing (else the transition is aborted and the effect destroyed right away)\n\t\t\tif (k === key || this.#outroing.has(k)) continue;\n\n\t\t\tconst on_destroy = () => {\n\t\t\t\tconst keys = Array.from(this.#batches.values());\n\n\t\t\t\tif (keys.includes(k)) {\n\t\t\t\t\t// keep the effect offscreen, as another batch will need it\n\t\t\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\t\t\tmove_effect(effect, fragment);\n\n\t\t\t\t\tfragment.append(create_text()); // TODO can we avoid this?\n\n\t\t\t\t\tthis.#offscreen.set(k, { effect, fragment });\n\t\t\t\t} else {\n\t\t\t\t\tdestroy_effect(effect);\n\t\t\t\t}\n\n\t\t\t\tthis.#outroing.delete(k);\n\t\t\t\tthis.#onscreen.delete(k);\n\t\t\t};\n\n\t\t\tif (this.#transition || !onscreen) {\n\t\t\t\tthis.#outroing.add(k);\n\t\t\t\tpause_effect(effect, on_destroy, false);\n\t\t\t} else {\n\t\t\t\ton_destroy();\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * @param {Batch} batch\n\t */\n\t#discard = (batch) => {\n\t\tthis.#batches.delete(batch);\n\n\t\tconst keys = Array.from(this.#batches.values());\n\n\t\tfor (const [k, branch] of this.#offscreen) {\n\t\t\tif (!keys.includes(k)) {\n\t\t\t\tdestroy_effect(branch.effect);\n\t\t\t\tthis.#offscreen.delete(k);\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t *\n\t * @param {any} key\n\t * @param {null | ((target: TemplateNode) => void)} fn\n\t */\n\tensure(key, fn) {\n\t\tvar batch = /** @type {Batch} */ (current_batch);\n\t\tvar defer = should_defer_append();\n\n\t\tif (fn && !this.#onscreen.has(key) && !this.#offscreen.has(key)) {\n\t\t\tif (defer) {\n\t\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\t\tvar target = create_text();\n\n\t\t\t\tfragment.append(target);\n\n\t\t\t\tthis.#offscreen.set(key, {\n\t\t\t\t\teffect: branch(() => fn(target)),\n\t\t\t\t\tfragment\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis.#onscreen.set(\n\t\t\t\t\tkey,\n\t\t\t\t\tbranch(() => fn(this.anchor))\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tthis.#batches.set(batch, key);\n\n\t\tif (defer) {\n\t\t\tfor (const [k, effect] of this.#onscreen) {\n\t\t\t\tif (k === key) {\n\t\t\t\t\tbatch.unskip_effect(effect);\n\t\t\t\t} else {\n\t\t\t\t\tbatch.skip_effect(effect);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const [k, branch] of this.#offscreen) {\n\t\t\t\tif (k === key) {\n\t\t\t\t\tbatch.unskip_effect(branch.effect);\n\t\t\t\t} else {\n\t\t\t\t\tbatch.skip_effect(branch.effect);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbatch.oncommit(this.#commit);\n\t\t\tbatch.ondiscard(this.#discard);\n\t\t} else {\n\t\t\tif (hydrating) {\n\t\t\t\tthis.anchor = hydrate_node;\n\t\t\t}\n\n\t\t\tthis.#commit(batch);\n\t\t}\n\t}\n}\n","/** @import { TemplateNode } from '#client' */\nimport { EFFECT_TRANSPARENT } from '#client/constants';\nimport {\n\thydrate_next,\n\thydrating,\n\tread_hydration_instruction,\n\tskip_nodes,\n\tset_hydrate_node,\n\tset_hydrating,\n\thydrate_node\n} from '../hydration.js';\nimport { block } from '../../reactivity/effects.js';\nimport { BranchManager } from './branches.js';\n\n/**\n * @param {TemplateNode} node\n * @param {(branch: (fn: (anchor: Node) => void, key?: number | false) => void) => void} fn\n * @param {boolean} [elseif] True if this is an `{:else if ...}` block rather than an `{#if ...}`, as that affects which transitions are considered 'local'\n * @returns {void}\n */\nexport function if_block(node, fn, elseif = false) {\n\t/** @type {TemplateNode | undefined} */\n\tvar marker;\n\tif (hydrating) {\n\t\tmarker = hydrate_node;\n\t\thydrate_next();\n\t}\n\n\tvar branches = new BranchManager(node);\n\tvar flags = elseif ? EFFECT_TRANSPARENT : 0;\n\n\t/**\n\t * @param {number | false} key\n\t * @param {null | ((anchor: Node) => void)} fn\n\t */\n\tfunction update_branch(key, fn) {\n\t\tif (hydrating) {\n\t\t\tvar data = read_hydration_instruction(/** @type {TemplateNode} */ (marker));\n\n\t\t\t// \"[n\" = branch n, \"[-1\" = else\n\t\t\tif (key !== parseInt(data.substring(1))) {\n\t\t\t\t// Hydration mismatch: remove everything inside the anchor and start fresh.\n\t\t\t\t// This could happen with `{#if browser}...{/if}`, for example\n\t\t\t\tvar anchor = skip_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tbranches.anchor = anchor;\n\n\t\t\t\tset_hydrating(false);\n\t\t\t\tbranches.ensure(key, fn);\n\t\t\t\tset_hydrating(true);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tbranches.ensure(key, fn);\n\t}\n\n\tblock(() => {\n\t\tvar has_branch = false;\n\n\t\tfn((fn, key = 0) => {\n\t\t\thas_branch = true;\n\t\t\tupdate_branch(key, fn);\n\t\t});\n\n\t\tif (!has_branch) {\n\t\t\tupdate_branch(-1, null);\n\t\t}\n\t}, flags);\n}\n","/** @import { TemplateNode } from '#client' */\nimport { is_runes } from '../../context.js';\nimport { block } from '../../reactivity/effects.js';\nimport { hydrate_next, hydrating } from '../hydration.js';\nimport { BranchManager } from './branches.js';\n\nconst NAN = Symbol('NaN');\n\n/**\n * @template V\n * @param {TemplateNode} node\n * @param {() => V} get_key\n * @param {(anchor: Node) => TemplateNode | void} render_fn\n * @returns {void}\n */\nexport function key(node, get_key, render_fn) {\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\tvar branches = new BranchManager(node);\n\n\tvar legacy = !is_runes();\n\n\tblock(() => {\n\t\tvar key = get_key();\n\n\t\t// NaN !== NaN, hence we do this workaround to not trigger remounts unnecessarily\n\t\tif (key !== key) {\n\t\t\tkey = /** @type {any} */ (NAN);\n\t\t}\n\n\t\t// key blocks in Svelte <5 had stupid semantics\n\t\tif (legacy && key !== null && typeof key === 'object') {\n\t\t\tkey = /** @type {V} */ ({});\n\t\t}\n\n\t\tbranches.ensure(key, render_fn);\n\t});\n}\n","/** @import { EachItem, EachOutroGroup, EachState, Effect, EffectNodes, MaybeSource, TemplateNode, TransitionManager } from '#client' */\n/** @import { Batch } from '../../reactivity/batch.js'; */\nimport {\n\tEACH_INDEX_REACTIVE,\n\tEACH_IS_ANIMATED,\n\tEACH_IS_CONTROLLED,\n\tEACH_ITEM_IMMUTABLE,\n\tEACH_ITEM_REACTIVE,\n\tHYDRATION_END,\n\tHYDRATION_START_ELSE\n} from '../../../../constants.js';\nimport {\n\thydrate_next,\n\thydrate_node,\n\thydrating,\n\tread_hydration_instruction,\n\tskip_nodes,\n\tset_hydrate_node,\n\tset_hydrating\n} from '../hydration.js';\nimport {\n\tclear_text_content,\n\tcreate_text,\n\tget_first_child,\n\tget_next_sibling,\n\tshould_defer_append\n} from '../operations.js';\nimport {\n\tblock,\n\tbranch,\n\tdestroy_effect,\n\tmove_effect,\n\tpause_effect,\n\tresume_effect\n} from '../../reactivity/effects.js';\nimport { source, mutable_source, internal_set } from '../../reactivity/sources.js';\nimport { array_from, is_array } from '../../../shared/utils.js';\nimport { BRANCH_EFFECT, COMMENT_NODE, DESTROYED, EFFECT_OFFSCREEN, INERT } from '#client/constants';\nimport { queue_micro_task } from '../task.js';\nimport { get } from '../../runtime.js';\nimport { DEV } from 'esm-env';\nimport { derived_safe_equal } from '../../reactivity/deriveds.js';\nimport { current_batch } from '../../reactivity/batch.js';\nimport * as e from '../../errors.js';\nimport { tag } from '../../dev/tracing.js';\n\n// When making substantive changes to this file, validate them with the each block stress test:\n// https://svelte.dev/playground/1972b2cf46564476ad8c8c6405b23b7b\n// This test also exists in this repo, as `packages/svelte/tests/manual/each-stress-test`\n\n/**\n * @param {any} _\n * @param {number} i\n */\nexport function index(_, i) {\n\treturn i;\n}\n\n/**\n * Pause multiple effects simultaneously, and coordinate their\n * subsequent destruction. Used in each blocks\n * @param {EachState} state\n * @param {Effect[]} to_destroy\n * @param {null | Node} controlled_anchor\n */\nfunction pause_effects(state, to_destroy, controlled_anchor) {\n\t/** @type {TransitionManager[]} */\n\tvar transitions = [];\n\tvar length = to_destroy.length;\n\n\t/** @type {EachOutroGroup} */\n\tvar group;\n\tvar remaining = to_destroy.length;\n\n\tfor (var i = 0; i < length; i++) {\n\t\tlet effect = to_destroy[i];\n\n\t\tpause_effect(\n\t\t\teffect,\n\t\t\t() => {\n\t\t\t\tif (group) {\n\t\t\t\t\tgroup.pending.delete(effect);\n\t\t\t\t\tgroup.done.add(effect);\n\n\t\t\t\t\tif (group.pending.size === 0) {\n\t\t\t\t\t\tvar groups = /** @type {Set} */ (state.outrogroups);\n\n\t\t\t\t\t\tdestroy_effects(state, array_from(group.done));\n\t\t\t\t\t\tgroups.delete(group);\n\n\t\t\t\t\t\tif (groups.size === 0) {\n\t\t\t\t\t\t\tstate.outrogroups = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tremaining -= 1;\n\t\t\t\t}\n\t\t\t},\n\t\t\tfalse\n\t\t);\n\t}\n\n\tif (remaining === 0) {\n\t\t// If we're in a controlled each block (i.e. the block is the only child of an\n\t\t// element), and we are removing all items, _and_ there are no out transitions,\n\t\t// we can use the fast path โ€” emptying the element and replacing the anchor.\n\t\t// Skip the fast path when another batch is still pending on this each block:\n\t\t// that batch's keys still reference EachItems in `state.items`, which\n\t\t// `destroy_effects` needs to preserve offscreen (see #18610).\n\t\tvar fast_path =\n\t\t\ttransitions.length === 0 && controlled_anchor !== null && state.pending.size === 0;\n\n\t\tif (fast_path) {\n\t\t\tvar anchor = /** @type {Element} */ (controlled_anchor);\n\t\t\tvar parent_node = /** @type {Element} */ (anchor.parentNode);\n\n\t\t\tclear_text_content(parent_node);\n\t\t\tparent_node.append(anchor);\n\n\t\t\tstate.items.clear();\n\t\t}\n\n\t\tdestroy_effects(state, to_destroy, !fast_path);\n\t} else {\n\t\tgroup = {\n\t\t\tpending: new Set(to_destroy),\n\t\t\tdone: new Set()\n\t\t};\n\n\t\t(state.outrogroups ??= new Set()).add(group);\n\t}\n}\n\n/**\n * @param {EachState} state\n * @param {Effect[]} to_destroy\n * @param {boolean} remove_dom\n */\nfunction destroy_effects(state, to_destroy, remove_dom = true) {\n\t/** @type {Set | undefined} */\n\tvar preserved_effects;\n\n\t// The loop-in-a-loop isn't ideal, but we should only hit this in relatively rare cases\n\tif (state.pending.size > 0) {\n\t\tpreserved_effects = new Set();\n\n\t\tfor (const keys of state.pending.values()) {\n\t\t\tfor (const key of keys) {\n\t\t\t\tpreserved_effects.add(/** @type {EachItem} */ (state.items.get(key)).e);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (var i = 0; i < to_destroy.length; i++) {\n\t\tvar e = to_destroy[i];\n\n\t\tif (preserved_effects?.has(e)) {\n\t\t\te.f |= EFFECT_OFFSCREEN;\n\n\t\t\tconst fragment = document.createDocumentFragment();\n\t\t\tmove_effect(e, fragment);\n\t\t} else {\n\t\t\tdestroy_effect(to_destroy[i], remove_dom);\n\t\t}\n\t}\n}\n\n/** @type {TemplateNode} */\nvar offscreen_anchor;\n\n/**\n * @template V\n * @param {Element | Comment} node The next sibling node, or the parent node if this is a 'controlled' block\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @param {(value: V, index: number) => any} get_key\n * @param {(anchor: Node, item: MaybeSource, index: MaybeSource) => void} render_fn\n * @param {null | ((anchor: Node) => void)} fallback_fn\n * @returns {void}\n */\nexport function each(node, flags, get_collection, get_key, render_fn, fallback_fn = null) {\n\tvar anchor = node;\n\n\t/** @type {Map} */\n\tvar items = new Map();\n\n\tvar is_controlled = (flags & EACH_IS_CONTROLLED) !== 0;\n\n\tif (is_controlled) {\n\t\tvar parent_node = /** @type {Element} */ (node);\n\n\t\tanchor = hydrating\n\t\t\t? set_hydrate_node(get_first_child(parent_node))\n\t\t\t: parent_node.appendChild(create_text());\n\t}\n\n\tif (hydrating) {\n\t\thydrate_next();\n\t}\n\n\t/** @type {Effect | null} */\n\tvar fallback = null;\n\n\t// TODO: ideally we could use derived for runes mode but because of the ability\n\t// to use a store which can be mutated, we can't do that here as mutating a store\n\t// will still result in the collection array being the same from the store\n\tvar each_array = derived_safe_equal(() => {\n\t\tvar collection = get_collection();\n\n\t\treturn /** @type {V[]} */ (\n\t\t\tis_array(collection) ? collection : collection == null ? [] : array_from(collection)\n\t\t);\n\t});\n\n\tif (DEV) {\n\t\ttag(each_array, '{#each ...}');\n\t}\n\n\t/** @type {Map>} */\n\tvar pending = new Map();\n\n\tvar first_run = true;\n\n\t/**\n\t * @param {Batch} batch\n\t */\n\tfunction commit(batch) {\n\t\tif ((state.effect.f & DESTROYED) !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tstate.pending.delete(batch);\n\n\t\t// The effect doesn't necessarily re-run in a batch right before that batch commits\n\t\t// (its view of the collection may not have changed), so we read the collection\n\t\t// as the committing batch sees it rather than using the most recent block run's result\n\t\tvar array = get(each_array);\n\n\t\tstate.fallback = fallback;\n\t\treconcile(state, array, anchor, flags, get_key);\n\n\t\tif (fallback !== null) {\n\t\t\tif (array.length === 0) {\n\t\t\t\tif ((fallback.f & EFFECT_OFFSCREEN) === 0) {\n\t\t\t\t\tresume_effect(fallback);\n\t\t\t\t} else {\n\t\t\t\t\tfallback.f ^= EFFECT_OFFSCREEN;\n\t\t\t\t\tmove(fallback, null, anchor);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpause_effect(fallback, () => {\n\t\t\t\t\t// TODO only null out if no pending batch needs it,\n\t\t\t\t\t// otherwise re-add `fallback.fragment` and move the\n\t\t\t\t\t// effect into it\n\t\t\t\t\tfallback = null;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @param {Batch} batch\n\t */\n\tfunction discard(batch) {\n\t\tstate.pending.delete(batch);\n\t}\n\n\tvar effect = block(() => {\n\t\tvar array = /** @type {V[]} */ (get(each_array));\n\t\tvar length = array.length;\n\n\t\t/** `true` if there was a hydration mismatch. Needs to be a `let` or else it isn't treeshaken out */\n\t\tlet mismatch = false;\n\n\t\tif (hydrating) {\n\t\t\tvar is_else = read_hydration_instruction(anchor) === HYDRATION_START_ELSE;\n\n\t\t\tif (is_else !== (length === 0)) {\n\t\t\t\t// hydration mismatch โ€” remove the server-rendered DOM and start over\n\t\t\t\tanchor = skip_nodes();\n\n\t\t\t\tset_hydrate_node(anchor);\n\t\t\t\tset_hydrating(false);\n\t\t\t\tmismatch = true;\n\t\t\t}\n\t\t}\n\n\t\tvar keys = new Set();\n\t\tvar batch = /** @type {Batch} */ (current_batch);\n\t\tvar defer = should_defer_append();\n\n\t\tfor (var index = 0; index < length; index += 1) {\n\t\t\tif (\n\t\t\t\thydrating &&\n\t\t\t\thydrate_node.nodeType === COMMENT_NODE &&\n\t\t\t\t/** @type {Comment} */ (hydrate_node).data === HYDRATION_END\n\t\t\t) {\n\t\t\t\t// The server rendered fewer items than expected,\n\t\t\t\t// so break out and continue appending non-hydrated items\n\t\t\t\tanchor = /** @type {Comment} */ (hydrate_node);\n\t\t\t\tmismatch = true;\n\t\t\t\tset_hydrating(false);\n\t\t\t}\n\n\t\t\tvar value = array[index];\n\t\t\tvar key = get_key(value, index);\n\n\t\t\tif (DEV) {\n\t\t\t\t// Check that the key function is idempotent (returns the same value when called twice)\n\t\t\t\tvar key_again = get_key(value, index);\n\t\t\t\tif (key !== key_again) {\n\t\t\t\t\te.each_key_volatile(String(index), String(key), String(key_again));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar item = first_run ? null : items.get(key);\n\n\t\t\tif (item) {\n\t\t\t\t// update before reconciliation, to trigger any async updates\n\t\t\t\tif (item.v) internal_set(item.v, value);\n\t\t\t\tif (item.i) internal_set(item.i, index);\n\n\t\t\t\tif (defer) {\n\t\t\t\t\tbatch.unskip_effect(item.e);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\titem = create_item(\n\t\t\t\t\titems,\n\t\t\t\t\tfirst_run ? anchor : (offscreen_anchor ??= create_text()),\n\t\t\t\t\tvalue,\n\t\t\t\t\tkey,\n\t\t\t\t\tindex,\n\t\t\t\t\trender_fn,\n\t\t\t\t\tflags,\n\t\t\t\t\tget_collection\n\t\t\t\t);\n\n\t\t\t\tif (!first_run) {\n\t\t\t\t\titem.e.f |= EFFECT_OFFSCREEN;\n\t\t\t\t}\n\n\t\t\t\titems.set(key, item);\n\t\t\t}\n\n\t\t\tkeys.add(key);\n\t\t}\n\n\t\tif (length === 0 && fallback_fn && !fallback) {\n\t\t\tif (first_run) {\n\t\t\t\tfallback = branch(() => fallback_fn(anchor));\n\t\t\t} else {\n\t\t\t\tfallback = branch(() => fallback_fn((offscreen_anchor ??= create_text())));\n\t\t\t\tfallback.f |= EFFECT_OFFSCREEN;\n\t\t\t}\n\t\t}\n\n\t\tif (length > keys.size) {\n\t\t\tif (DEV) {\n\t\t\t\tvalidate_each_keys(array, get_key);\n\t\t\t} else {\n\t\t\t\t// in prod, the additional information isn't printed, so don't bother computing it\n\t\t\t\te.each_key_duplicate('', '', '');\n\t\t\t}\n\t\t}\n\n\t\t// remove excess nodes\n\t\tif (hydrating && length > 0) {\n\t\t\tset_hydrate_node(skip_nodes());\n\t\t}\n\n\t\tif (!first_run) {\n\t\t\tpending.set(batch, keys);\n\n\t\t\tif (defer) {\n\t\t\t\tfor (const [key, item] of items) {\n\t\t\t\t\tif (!keys.has(key)) {\n\t\t\t\t\t\tbatch.skip_effect(item.e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbatch.oncommit(commit);\n\t\t\t\tbatch.ondiscard(discard);\n\t\t\t} else {\n\t\t\t\tcommit(batch);\n\t\t\t}\n\t\t}\n\n\t\tif (mismatch) {\n\t\t\t// continue in hydration mode\n\t\t\tset_hydrating(true);\n\t\t}\n\n\t\t// When we mount the each block for the first time, the collection won't be\n\t\t// connected to this effect as the effect hasn't finished running yet and its deps\n\t\t// won't be assigned. However, it's possible that when reconciling the each block\n\t\t// that a mutation occurred and it's made the collection MAYBE_DIRTY, so reading the\n\t\t// collection again can provide consistency to the reactive graph again as the deriveds\n\t\t// will now be `CLEAN`.\n\t\tget(each_array);\n\t});\n\n\t/** @type {EachState} */\n\tvar state = { effect, flags, items, pending, outrogroups: null, fallback };\n\n\tfirst_run = false;\n\n\tif (hydrating) {\n\t\tanchor = hydrate_node;\n\t}\n}\n\n/**\n * Skip past any non-branch effects (which could be created with `createSubscriber`, for example) to find the next branch effect\n * @param {Effect | null} effect\n * @returns {Effect | null}\n */\nfunction skip_to_branch(effect) {\n\twhile (effect !== null && (effect.f & BRANCH_EFFECT) === 0) {\n\t\teffect = effect.next;\n\t}\n\treturn effect;\n}\n\n/**\n * Add, remove, or reorder items output by an each block as its input changes\n * @template V\n * @param {EachState} state\n * @param {Array} array\n * @param {Element | Comment | Text} anchor\n * @param {number} flags\n * @param {(value: V, index: number) => any} get_key\n * @returns {void}\n */\nfunction reconcile(state, array, anchor, flags, get_key) {\n\tvar is_animated = (flags & EACH_IS_ANIMATED) !== 0;\n\n\tvar length = array.length;\n\tvar items = state.items;\n\tvar current = skip_to_branch(state.effect.first);\n\n\t/** @type {undefined | Set} */\n\tvar seen;\n\n\t/** @type {Effect | null} */\n\tvar prev = null;\n\n\t/** @type {undefined | Set} */\n\tvar to_animate;\n\n\t/** @type {Effect[]} */\n\tvar matched = [];\n\n\t/** @type {Effect[]} */\n\tvar stashed = [];\n\n\t/** @type {V} */\n\tvar value;\n\n\t/** @type {any} */\n\tvar key;\n\n\t/** @type {Effect | undefined} */\n\tvar effect;\n\n\t/** @type {number} */\n\tvar i;\n\n\tif (is_animated) {\n\t\tfor (i = 0; i < length; i += 1) {\n\t\t\tvalue = array[i];\n\t\t\tkey = get_key(value, i);\n\t\t\teffect = /** @type {EachItem} */ (items.get(key)).e;\n\n\t\t\t// offscreen == coming in now, no animation in that case,\n\t\t\t// else this would happen https://github.com/sveltejs/svelte/issues/17181\n\t\t\tif ((effect.f & EFFECT_OFFSCREEN) === 0) {\n\t\t\t\teffect.nodes?.a?.measure();\n\t\t\t\t(to_animate ??= new Set()).add(effect);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (i = 0; i < length; i += 1) {\n\t\tvalue = array[i];\n\t\tkey = get_key(value, i);\n\n\t\teffect = /** @type {EachItem} */ (items.get(key)).e;\n\n\t\tif (state.outrogroups !== null) {\n\t\t\tfor (const group of state.outrogroups) {\n\t\t\t\tgroup.pending.delete(effect);\n\t\t\t\tgroup.done.delete(effect);\n\t\t\t}\n\t\t}\n\n\t\tif ((effect.f & INERT) !== 0) {\n\t\t\tresume_effect(effect);\n\t\t\tif (is_animated) {\n\t\t\t\teffect.nodes?.a?.unfix();\n\t\t\t\t(to_animate ??= new Set()).delete(effect);\n\t\t\t}\n\t\t}\n\n\t\tif ((effect.f & EFFECT_OFFSCREEN) !== 0) {\n\t\t\teffect.f ^= EFFECT_OFFSCREEN;\n\n\t\t\tif (effect === current) {\n\t\t\t\tmove(effect, null, anchor);\n\t\t\t} else {\n\t\t\t\tvar next = prev ? prev.next : current;\n\n\t\t\t\tif (effect === state.effect.last) {\n\t\t\t\t\tstate.effect.last = effect.prev;\n\t\t\t\t}\n\n\t\t\t\tif (effect.prev) effect.prev.next = effect.next;\n\t\t\t\tif (effect.next) effect.next.prev = effect.prev;\n\t\t\t\tlink(state, prev, effect);\n\t\t\t\tlink(state, effect, next);\n\n\t\t\t\tmove(effect, next, anchor);\n\t\t\t\tprev = effect;\n\n\t\t\t\tmatched = [];\n\t\t\t\tstashed = [];\n\n\t\t\t\tcurrent = skip_to_branch(prev.next);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (effect !== current) {\n\t\t\tif (seen !== undefined && seen.has(effect)) {\n\t\t\t\tif (matched.length < stashed.length) {\n\t\t\t\t\t// more efficient to move later items to the front\n\t\t\t\t\tvar start = stashed[0];\n\t\t\t\t\tvar j;\n\n\t\t\t\t\tprev = start.prev;\n\n\t\t\t\t\tvar a = matched[0];\n\t\t\t\t\tvar b = matched[matched.length - 1];\n\n\t\t\t\t\tfor (j = 0; j < matched.length; j += 1) {\n\t\t\t\t\t\tmove(matched[j], start, anchor);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (j = 0; j < stashed.length; j += 1) {\n\t\t\t\t\t\tseen.delete(stashed[j]);\n\t\t\t\t\t}\n\n\t\t\t\t\tlink(state, a.prev, b.next);\n\t\t\t\t\tlink(state, prev, a);\n\t\t\t\t\tlink(state, b, start);\n\n\t\t\t\t\tcurrent = start;\n\t\t\t\t\tprev = b;\n\t\t\t\t\ti -= 1;\n\n\t\t\t\t\tmatched = [];\n\t\t\t\t\tstashed = [];\n\t\t\t\t} else {\n\t\t\t\t\t// more efficient to move earlier items to the back\n\t\t\t\t\tseen.delete(effect);\n\t\t\t\t\tmove(effect, current, anchor);\n\n\t\t\t\t\tlink(state, effect.prev, effect.next);\n\t\t\t\t\tlink(state, effect, prev === null ? state.effect.first : prev.next);\n\t\t\t\t\tlink(state, prev, effect);\n\n\t\t\t\t\tprev = effect;\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tmatched = [];\n\t\t\tstashed = [];\n\n\t\t\twhile (current !== null && current !== effect) {\n\t\t\t\t(seen ??= new Set()).add(current);\n\t\t\t\tstashed.push(current);\n\t\t\t\tcurrent = skip_to_branch(current.next);\n\t\t\t}\n\n\t\t\tif (current === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif ((effect.f & EFFECT_OFFSCREEN) === 0) {\n\t\t\tmatched.push(effect);\n\t\t}\n\n\t\tprev = effect;\n\t\tcurrent = skip_to_branch(effect.next);\n\t}\n\n\tif (state.outrogroups !== null) {\n\t\tfor (const group of state.outrogroups) {\n\t\t\tif (group.pending.size === 0) {\n\t\t\t\tdestroy_effects(state, array_from(group.done));\n\t\t\t\tstate.outrogroups?.delete(group);\n\t\t\t}\n\t\t}\n\n\t\tif (state.outrogroups.size === 0) {\n\t\t\tstate.outrogroups = null;\n\t\t}\n\t}\n\n\tif (current !== null || seen !== undefined) {\n\t\t/** @type {Effect[]} */\n\t\tvar to_destroy = [];\n\n\t\tif (seen !== undefined) {\n\t\t\tfor (effect of seen) {\n\t\t\t\tif ((effect.f & INERT) === 0) {\n\t\t\t\t\tto_destroy.push(effect);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twhile (current !== null) {\n\t\t\t// If the each block isn't inert, then inert effects are currently outroing and will be removed once the transition is finished\n\t\t\tif ((current.f & INERT) === 0 && current !== state.fallback) {\n\t\t\t\tto_destroy.push(current);\n\t\t\t}\n\n\t\t\tcurrent = skip_to_branch(current.next);\n\t\t}\n\n\t\tvar destroy_length = to_destroy.length;\n\n\t\tif (destroy_length > 0) {\n\t\t\tvar controlled_anchor = (flags & EACH_IS_CONTROLLED) !== 0 && length === 0 ? anchor : null;\n\n\t\t\tif (is_animated) {\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].nodes?.a?.measure();\n\t\t\t\t}\n\n\t\t\t\tfor (i = 0; i < destroy_length; i += 1) {\n\t\t\t\t\tto_destroy[i].nodes?.a?.fix();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpause_effects(state, to_destroy, controlled_anchor);\n\t\t}\n\t}\n\n\tif (is_animated) {\n\t\tqueue_micro_task(() => {\n\t\t\tif (to_animate === undefined) return;\n\t\t\tfor (effect of to_animate) {\n\t\t\t\teffect.nodes?.a?.apply();\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * @template V\n * @param {Map} items\n * @param {Node} anchor\n * @param {V} value\n * @param {unknown} key\n * @param {number} index\n * @param {(anchor: Node, item: MaybeSource, index: MaybeSource, collection: () => V[]) => void} render_fn\n * @param {number} flags\n * @param {() => V[]} get_collection\n * @returns {EachItem}\n */\nfunction create_item(items, anchor, value, key, index, render_fn, flags, get_collection) {\n\tvar v =\n\t\t(flags & EACH_ITEM_REACTIVE) !== 0\n\t\t\t? (flags & EACH_ITEM_IMMUTABLE) === 0\n\t\t\t\t? mutable_source(value, false, false)\n\t\t\t\t: source(value)\n\t\t\t: null;\n\n\tvar i = (flags & EACH_INDEX_REACTIVE) !== 0 ? source(index) : null;\n\n\tif (DEV && v) {\n\t\t// For tracing purposes, we need to link the source signal we create with the\n\t\t// collection + index so that tracing works as intended\n\t\tv.trace = () => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-expressions\n\t\t\tget_collection()[i?.v ?? index];\n\t\t};\n\t}\n\n\treturn {\n\t\tv,\n\t\ti,\n\t\te: branch(() => {\n\t\t\trender_fn(anchor, v ?? value, i ?? index, get_collection);\n\n\t\t\treturn () => {\n\t\t\t\titems.delete(key);\n\t\t\t};\n\t\t})\n\t};\n}\n\n/**\n * @param {Effect} effect\n * @param {Effect | null} next\n * @param {Text | Element | Comment} anchor\n */\nfunction move(effect, next, anchor) {\n\tif (!effect.nodes) return;\n\n\tvar node = effect.nodes.start;\n\tvar end = effect.nodes.end;\n\n\tvar dest =\n\t\tnext && (next.f & EFFECT_OFFSCREEN) === 0\n\t\t\t? /** @type {EffectNodes} */ (next.nodes).start\n\t\t\t: anchor;\n\n\twhile (node !== null) {\n\t\tvar next_node = /** @type {TemplateNode} */ (get_next_sibling(node));\n\t\tdest.before(node);\n\n\t\tif (node === end) {\n\t\t\treturn;\n\t\t}\n\n\t\tnode = next_node;\n\t}\n}\n\n/**\n * @param {EachState} state\n * @param {Effect | null} prev\n * @param {Effect | null} next\n */\nfunction link(state, prev, next) {\n\tif (prev === null) {\n\t\tstate.effect.first = next;\n\t} else {\n\t\tprev.next = next;\n\t}\n\n\tif (next === null) {\n\t\tstate.effect.last = prev;\n\t} else {\n\t\tnext.prev = prev;\n\t}\n}\n\n/**\n * @param {Array} array\n * @param {(item: any, index: number) => string} key_fn\n * @returns {void}\n */\nfunction validate_each_keys(array, key_fn) {\n\tconst keys = new Map();\n\tconst length = array.length;\n\n\tfor (let i = 0; i < length; i++) {\n\t\tconst key = key_fn(array[i], i);\n\n\t\tif (keys.has(key)) {\n\t\t\tconst a = String(keys.get(key));\n\t\t\tconst b = String(i);\n\n\t\t\t/** @type {string | null} */\n\t\t\tlet k = String(key);\n\t\t\tif (k.startsWith('[object ')) k = null;\n\n\t\t\te.each_key_duplicate(a, b, k);\n\t\t}\n\n\t\tkeys.set(key, i);\n\t}\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t` should be rendered as `
      ` and _not_\n * `
      `, which is equivalent to `
      `. There\n * may be other odd cases that need to be added to this list in future\n * @type {Record>}\n */\nconst replacements = {\n\ttranslate: new Map([\n\t\t[true, 'yes'],\n\t\t[false, 'no']\n\t])\n};\n\n/**\n * @template V\n * @param {string} name\n * @param {V} value\n * @param {boolean} [is_boolean]\n * @returns {string}\n */\nexport function attr(name, value, is_boolean = false) {\n\t// attribute hidden for values other than \"until-found\" behaves like a boolean attribute\n\tif (name === 'hidden' && value !== 'until-found') {\n\t\tis_boolean = true;\n\t}\n\t// `''` is a present boolean attribute, as it is in markup and on the client\n\tif (value == null || (is_boolean && !value && value !== '')) return '';\n\tconst normalized =\n\t\t(has_own_property.call(replacements, name) && replacements[name].get(value)) || value;\n\tconst assignment = is_boolean ? `=\"\"` : `=\"${escape_html(normalized, true)}\"`;\n\treturn ` ${name}${assignment}`;\n}\n\n/**\n * Small wrapper around clsx to preserve Svelte's (weird) handling of falsy values.\n * TODO Svelte 6 revisit this, and likely turn all falsy values into the empty string (what clsx also does)\n * @param {any} value\n */\nexport function clsx(value) {\n\tif (typeof value === 'object') {\n\t\treturn _clsx(value);\n\t} else {\n\t\treturn value ?? '';\n\t}\n}\n\nconst whitespace = [...' \\t\\n\\r\\f\\u00a0\\u000b\\ufeff'];\n\n/**\n * @param {any} value\n * @param {string | null} [hash]\n * @param {Record} [directives]\n * @returns {string | null}\n */\nexport function to_class(value, hash, directives) {\n\tvar classname = value == null ? '' : '' + value;\n\n\tif (hash) {\n\t\tclassname = classname ? classname + ' ' + hash : hash;\n\t}\n\n\tif (directives) {\n\t\tfor (var key of Object.keys(directives)) {\n\t\t\tif (directives[key]) {\n\t\t\t\tclassname = classname ? classname + ' ' + key : key;\n\t\t\t} else if (classname.length) {\n\t\t\t\tvar len = key.length;\n\t\t\t\tvar a = 0;\n\n\t\t\t\twhile ((a = classname.indexOf(key, a)) >= 0) {\n\t\t\t\t\tvar b = a + len;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t(a === 0 || whitespace.includes(classname[a - 1])) &&\n\t\t\t\t\t\t(b === classname.length || whitespace.includes(classname[b]))\n\t\t\t\t\t) {\n\t\t\t\t\t\tclassname = (a === 0 ? '' : classname.substring(0, a)) + classname.substring(b + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ta = b;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn classname === '' ? null : classname;\n}\n\n/**\n *\n * @param {Record} styles\n * @param {boolean} important\n */\nfunction append_styles(styles, important = false) {\n\tvar separator = important ? ' !important;' : ';';\n\tvar css = '';\n\n\tfor (var key of Object.keys(styles)) {\n\t\tvar value = styles[key];\n\t\tif (value != null && value !== '') {\n\t\t\tcss += ' ' + key + ': ' + value + separator;\n\t\t}\n\t}\n\n\treturn css;\n}\n\n/**\n * @param {string} name\n * @returns {string}\n */\nfunction to_css_name(name) {\n\tif (name[0] !== '-' || name[1] !== '-') {\n\t\treturn name.toLowerCase();\n\t}\n\treturn name;\n}\n\n/**\n * @param {any} value\n * @param {Record | [Record, Record]} [styles]\n * @returns {string | null}\n */\nexport function to_style(value, styles) {\n\tif (styles) {\n\t\tvar new_style = '';\n\n\t\t/** @type {Record | undefined} */\n\t\tvar normal_styles;\n\n\t\t/** @type {Record | undefined} */\n\t\tvar important_styles;\n\n\t\tif (Array.isArray(styles)) {\n\t\t\tnormal_styles = styles[0];\n\t\t\timportant_styles = styles[1];\n\t\t} else {\n\t\t\tnormal_styles = styles;\n\t\t}\n\n\t\tif (value) {\n\t\t\t// strip comments; surrounding whitespace is handled by the trims below (which is much faster than doing it through regex)\n\t\t\tvalue = String(value)\n\t\t\t\t.replaceAll(/\\/\\*.*?\\*\\//g, '')\n\t\t\t\t.trim();\n\n\t\t\t/** @type {boolean | '\"' | \"'\"} */\n\t\t\tvar in_str = false;\n\t\t\tvar in_apo = 0;\n\t\t\tvar in_comment = false;\n\n\t\t\tvar reserved_names = [];\n\n\t\t\tif (normal_styles) {\n\t\t\t\treserved_names.push(...Object.keys(normal_styles).map(to_css_name));\n\t\t\t}\n\t\t\tif (important_styles) {\n\t\t\t\treserved_names.push(...Object.keys(important_styles).map(to_css_name));\n\t\t\t}\n\n\t\t\tvar start_index = 0;\n\t\t\tvar name_index = -1;\n\n\t\t\tconst len = value.length;\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\tvar c = value[i];\n\n\t\t\t\tif (in_comment) {\n\t\t\t\t\tif (c === '/' && value[i - 1] === '*') {\n\t\t\t\t\t\tin_comment = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (in_str) {\n\t\t\t\t\tif (in_str === c) {\n\t\t\t\t\t\tin_str = false;\n\t\t\t\t\t}\n\t\t\t\t} else if (c === '/' && value[i + 1] === '*') {\n\t\t\t\t\tin_comment = true;\n\t\t\t\t} else if (c === '\"' || c === \"'\") {\n\t\t\t\t\tin_str = c;\n\t\t\t\t} else if (c === '(') {\n\t\t\t\t\tin_apo++;\n\t\t\t\t} else if (c === ')') {\n\t\t\t\t\tin_apo--;\n\t\t\t\t}\n\n\t\t\t\tif (!in_comment && in_str === false && in_apo === 0) {\n\t\t\t\t\tif (c === ':' && name_index === -1) {\n\t\t\t\t\t\tname_index = i;\n\t\t\t\t\t} else if (c === ';' || i === len - 1) {\n\t\t\t\t\t\tif (name_index !== -1) {\n\t\t\t\t\t\t\tvar name = to_css_name(value.substring(start_index, name_index).trim());\n\n\t\t\t\t\t\t\tif (!reserved_names.includes(name)) {\n\t\t\t\t\t\t\t\tif (c !== ';') {\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tvar property = value.substring(start_index, i).trim();\n\t\t\t\t\t\t\t\tnew_style += ' ' + property + ';';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart_index = i + 1;\n\t\t\t\t\t\tname_index = -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (normal_styles) {\n\t\t\tnew_style += append_styles(normal_styles);\n\t\t}\n\n\t\tif (important_styles) {\n\t\t\tnew_style += append_styles(important_styles, true);\n\t\t}\n\n\t\tnew_style = new_style.trim();\n\t\treturn new_style === '' ? null : new_style;\n\t}\n\n\treturn value == null ? null : String(value);\n}\n","import { to_class } from '../../../shared/attributes.js';\nimport { CLASS_CACHE } from '../../constants.js';\nimport { hydrating } from '../hydration.js';\n\n/**\n * @param {Element} dom\n * @param {boolean | number} is_html\n * @param {string | null} value\n * @param {string} [hash]\n * @param {Record} [prev_classes]\n * @param {Record} [next_classes]\n * @returns {Record | undefined}\n */\nexport function set_class(dom, is_html, value, hash, prev_classes, next_classes) {\n\tvar prev = /** @type {any} */ (dom)[CLASS_CACHE];\n\n\tif (\n\t\thydrating ||\n\t\tprev !== value ||\n\t\tprev === undefined // for edge case of `class={undefined}`\n\t) {\n\t\tvar next_class_name = to_class(value, hash, next_classes);\n\n\t\tif (!hydrating || next_class_name !== dom.getAttribute('class')) {\n\t\t\t// Removing the attribute when the value is only an empty string causes\n\t\t\t// performance issues vs simply making the className an empty string. So\n\t\t\t// we should only remove the class if the value is nullish\n\t\t\t// and there no hash/directives :\n\t\t\tif (next_class_name == null) {\n\t\t\t\tdom.removeAttribute('class');\n\t\t\t} else if (is_html) {\n\t\t\t\tdom.className = next_class_name;\n\t\t\t} else {\n\t\t\t\tdom.setAttribute('class', next_class_name);\n\t\t\t}\n\t\t}\n\n\t\t/** @type {any} */ (dom)[CLASS_CACHE] = value;\n\t} else if (next_classes && prev_classes !== next_classes) {\n\t\tfor (var key in next_classes) {\n\t\t\tvar is_present = !!next_classes[key];\n\n\t\t\tif (prev_classes == null || is_present !== !!prev_classes[key]) {\n\t\t\t\tdom.classList.toggle(key, is_present);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn next_classes;\n}\n","import { to_style } from '../../../shared/attributes.js';\nimport { STYLE_CACHE } from '../../constants.js';\nimport { hydrating } from '../hydration.js';\n\n/**\n * @param {Element & ElementCSSInlineStyle} dom\n * @param {Record} prev\n * @param {Record} next\n * @param {string} [priority]\n */\nfunction update_styles(dom, prev = {}, next, priority) {\n\tfor (var key in next) {\n\t\tvar value = next[key];\n\n\t\tif (prev[key] !== value) {\n\t\t\tif (next[key] == null) {\n\t\t\t\tdom.style.removeProperty(key);\n\t\t\t} else {\n\t\t\t\tdom.style.setProperty(key, value, priority);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {Element & ElementCSSInlineStyle} dom\n * @param {string | null} value\n * @param {Record | [Record, Record]} [prev_styles]\n * @param {Record | [Record, Record]} [next_styles]\n */\nexport function set_style(dom, value, prev_styles, next_styles) {\n\tvar prev = /** @type {any} */ (dom)[STYLE_CACHE];\n\n\tif (hydrating || prev !== value) {\n\t\tvar next_style_attr = to_style(value, next_styles);\n\n\t\tif (!hydrating || next_style_attr !== dom.getAttribute('style')) {\n\t\t\tif (next_style_attr == null) {\n\t\t\t\tdom.removeAttribute('style');\n\t\t\t} else {\n\t\t\t\tdom.style.cssText = next_style_attr;\n\t\t\t}\n\t\t}\n\n\t\t/** @type {any} */ (dom)[STYLE_CACHE] = value;\n\t} else if (next_styles) {\n\t\tif (Array.isArray(next_styles)) {\n\t\t\tupdate_styles(dom, prev_styles?.[0], next_styles[0]);\n\t\t\tupdate_styles(dom, prev_styles?.[1], next_styles[1], 'important');\n\t\t} else {\n\t\t\tupdate_styles(dom, prev_styles, next_styles);\n\t\t}\n\t}\n\n\treturn next_styles;\n}\n","/** @import { Blocker, Effect } from '#client' */\nimport { DEV } from 'esm-env';\nimport { hydrating, set_hydrating } from '../hydration.js';\nimport { get_descriptors, get_prototype_of } from '../../../shared/utils.js';\nimport { create_event, delegate, delegated, event, event_symbol } from './events.js';\nimport { add_form_reset_listener, autofocus } from './misc.js';\nimport * as w from '../../warnings.js';\nimport {\n\tATTRIBUTES_CACHE,\n\tFORM_RESET_HANDLER,\n\tIS_XHTML,\n\tLOADING_ATTR_SYMBOL\n} from '#client/constants';\nimport { queue_micro_task } from '../task.js';\nimport { is_capture_event, can_delegate_event, normalize_attribute } from '../../../../utils.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tget,\n\tset_active_effect,\n\tset_active_reaction\n} from '../../runtime.js';\nimport { attach } from './attachments.js';\nimport { clsx } from '../../../shared/attributes.js';\nimport { set_class } from './class.js';\nimport { set_style } from './style.js';\nimport { ATTACHMENT_KEY, NAMESPACE_HTML, UNINITIALIZED } from '../../../../constants.js';\nimport { branch, destroy_effect, effect, managed } from '../../reactivity/effects.js';\nimport {\n\tinit_select,\n\tselect_option,\n\tset_default_select_value,\n\tset_selected\n} from './bindings/select.js';\nimport { flatten } from '../../reactivity/async.js';\n\nexport const CLASS = Symbol('class');\nexport const STYLE = Symbol('style');\n\nconst IS_CUSTOM_ELEMENT = Symbol('is custom element');\nconst IS_HTML = Symbol('is html');\n\nconst LINK_TAG = IS_XHTML ? 'link' : 'LINK';\nconst INPUT_TAG = IS_XHTML ? 'input' : 'INPUT';\nconst OPTION_TAG = IS_XHTML ? 'option' : 'OPTION';\nconst SELECT_TAG = IS_XHTML ? 'select' : 'SELECT';\nconst PROGRESS_TAG = IS_XHTML ? 'progress' : 'PROGRESS';\n\n/**\n * The value/checked attribute in the template actually corresponds to the defaultValue property, so we need\n * to remove it upon hydration to avoid a bug when someone resets the form value.\n * @param {HTMLInputElement} input\n * @returns {void}\n */\nexport function remove_input_defaults(input) {\n\tif (!hydrating) return;\n\n\tvar already_removed = false;\n\n\t// We try and remove the default attributes later, rather than sync during hydration.\n\t// Doing it sync during hydration has a negative impact on performance, but deferring the\n\t// work in an idle task alleviates this greatly. If a form reset event comes in before\n\t// the idle callback, then we ensure the input defaults are cleared just before.\n\tvar remove_defaults = () => {\n\t\tif (already_removed) return;\n\t\talready_removed = true;\n\n\t\t// Remove the attributes but preserve the values\n\t\tif (input.hasAttribute('value')) {\n\t\t\tvar value = input.value;\n\t\t\tset_attribute(input, 'value', null);\n\t\t\tinput.value = value;\n\t\t}\n\n\t\tif (input.hasAttribute('checked')) {\n\t\t\tvar checked = input.checked;\n\t\t\tset_attribute(input, 'checked', null);\n\t\t\tinput.checked = checked;\n\t\t}\n\t};\n\n\t/** @type {any} */ (input)[FORM_RESET_HANDLER] = remove_defaults;\n\tqueue_micro_task(remove_defaults);\n\tadd_form_reset_listener();\n}\n\n/**\n * @param {Element} element\n * @param {any} value\n */\nexport function set_value(element, value) {\n\tvar attributes = get_attributes(element);\n\n\tif (\n\t\tattributes.value ===\n\t\t\t(attributes.value =\n\t\t\t\t// treat null and undefined the same for the initial value\n\t\t\t\tvalue ?? undefined) ||\n\t\t// @ts-expect-error\n\t\t// `progress` elements always need their value set when it's `0`\n\t\t(element.value === value && (value !== 0 || element.nodeName !== PROGRESS_TAG))\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.value = value ?? '';\n}\n\n/**\n * @param {Element} element\n * @param {boolean} checked\n */\nexport function set_checked(element, checked) {\n\tvar attributes = get_attributes(element);\n\n\tif (\n\t\tattributes.checked ===\n\t\t(attributes.checked =\n\t\t\t// treat null and undefined the same for the initial value\n\t\t\tchecked ?? undefined)\n\t) {\n\t\treturn;\n\t}\n\n\t// @ts-expect-error\n\telement.checked = checked;\n}\n\n/**\n * Applies the default checked property without influencing the current checked property.\n * @param {HTMLInputElement} element\n * @param {boolean} checked\n */\nexport function set_default_checked(element, checked) {\n\tconst existing_value = element.checked;\n\telement.defaultChecked = checked;\n\telement.checked = existing_value;\n}\n\n/**\n * Applies the default value property without influencing the current value property.\n * @param {HTMLInputElement | HTMLTextAreaElement} element\n * @param {string} value\n */\nexport function set_default_value(element, value) {\n\tconst existing_value = element.value;\n\telement.defaultValue = value;\n\telement.value = existing_value;\n}\n\n/**\n * @param {Element} element\n * @param {string} attribute\n * @param {string | null} value\n * @param {boolean} [skip_warning]\n */\nexport function set_attribute(element, attribute, value, skip_warning) {\n\tvar attributes = get_attributes(element);\n\n\tif (hydrating) {\n\t\tattributes[attribute] = element.getAttribute(attribute);\n\n\t\tif (\n\t\t\tattribute === 'src' ||\n\t\t\tattribute === 'srcset' ||\n\t\t\t(attribute === 'href' && element.nodeName === LINK_TAG)\n\t\t) {\n\t\t\tif (!skip_warning) {\n\t\t\t\tcheck_src_in_dev_hydration(element, attribute, value ?? '');\n\t\t\t}\n\n\t\t\t// If we reset these attributes, they would result in another network request, which we want to avoid.\n\t\t\t// We assume they are the same between client and server as checking if they are equal is expensive\n\t\t\t// (we can't just compare the strings as they can be different between client and server but result in the\n\t\t\t// same url, so we would need to create hidden anchor elements to compare them)\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (attributes[attribute] === (attributes[attribute] = value)) return;\n\n\tif (attribute === 'loading') {\n\t\t// @ts-expect-error\n\t\telement[LOADING_ATTR_SYMBOL] = value;\n\t}\n\n\tif (value == null) {\n\t\telement.removeAttribute(attribute);\n\t} else if (typeof value !== 'string' && get_setters(element).has(attribute)) {\n\t\t// @ts-ignore\n\t\telement[attribute] = value;\n\t} else {\n\t\telement.setAttribute(attribute, value);\n\t}\n}\n\n/**\n * @param {Element} dom\n * @param {string} attribute\n * @param {string} value\n */\nexport function set_xlink_attribute(dom, attribute, value) {\n\tdom.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\n/**\n * @param {HTMLElement} node\n * @param {string} prop\n * @param {any} value\n */\nexport function set_custom_element_data(node, prop, value) {\n\t// We need to ensure that setting custom element props, which can\n\t// invoke lifecycle methods on other custom elements, does not also\n\t// associate those lifecycle methods with the current active reaction\n\t// or effect\n\tvar previous_reaction = active_reaction;\n\tvar previous_effect = active_effect;\n\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet was_hydrating = hydrating;\n\tif (hydrating) {\n\t\tset_hydrating(false);\n\t}\n\n\tset_active_reaction(null);\n\tset_active_effect(null);\n\n\ttry {\n\t\tif (\n\t\t\t// `style` should use `set_attribute` rather than the setter\n\t\t\tprop !== 'style' &&\n\t\t\t// Don't compute setters for custom elements while they aren't registered yet,\n\t\t\t// because during their upgrade/instantiation they might add more setters.\n\t\t\t// Instead, fall back to a simple \"an object, then set as property\" heuristic.\n\t\t\t(setters_cache.has(node.getAttribute('is') || node.nodeName) ||\n\t\t\t// customElements may not be available in browser extension contexts\n\t\t\t!customElements ||\n\t\t\tcustomElements.get(node.getAttribute('is') || node.nodeName.toLowerCase())\n\t\t\t\t? get_setters(node).has(prop)\n\t\t\t\t: value && typeof value === 'object')\n\t\t) {\n\t\t\t// @ts-expect-error\n\t\t\tnode[prop] = value;\n\t\t} else {\n\t\t\t// We did getters etc checks already, stringify before passing to set_attribute\n\t\t\t// to ensure it doesn't invoke the same logic again, and potentially populating\n\t\t\t// the setters cache too early.\n\t\t\tset_attribute(node, prop, value == null ? value : String(value));\n\t\t}\n\t} finally {\n\t\tset_active_reaction(previous_reaction);\n\t\tset_active_effect(previous_effect);\n\t\tif (was_hydrating) {\n\t\t\tset_hydrating(true);\n\t\t}\n\t}\n}\n\n/**\n * Spreads attributes onto a DOM element, taking into account the currently set attributes\n * @param {Element & ElementCSSInlineStyle} element\n * @param {Record | undefined} prev\n * @param {Record} next New attributes - this function mutates this object\n * @param {string} [css_hash]\n * @param {boolean} [should_remove_defaults]\n * @param {boolean} [skip_warning]\n * @returns {Record}\n */\nfunction set_attributes(\n\telement,\n\tprev,\n\tnext,\n\tcss_hash,\n\tshould_remove_defaults = false,\n\tskip_warning = false\n) {\n\tif (hydrating && should_remove_defaults && element.nodeName === INPUT_TAG) {\n\t\tif (!('defaultValue' in next || 'defaultChecked' in next)) {\n\t\t\tremove_input_defaults(/** @type {HTMLInputElement} */ (element));\n\t\t}\n\t}\n\n\tvar attributes = get_attributes(element);\n\n\tvar is_custom_element = attributes[IS_CUSTOM_ELEMENT];\n\tvar preserve_attribute_case = !attributes[IS_HTML];\n\n\t// If we're hydrating but the custom element is from Svelte, and it already scaffolded,\n\t// then it might run block logic in hydration mode, which we have to prevent.\n\tlet is_hydrating_custom_element = hydrating && is_custom_element;\n\tif (is_hydrating_custom_element) {\n\t\tset_hydrating(false);\n\t}\n\n\tvar current = prev || {};\n\tvar is_option_element = element.nodeName === OPTION_TAG;\n\tvar is_select_element = element.nodeName === SELECT_TAG;\n\n\ttry {\n\t\tfor (var key in prev) {\n\t\t\t// don't null our internal $$onX listeners\n\t\t\tif (!(key in next) && key[0] + key[1] !== '$$') {\n\t\t\t\tnext[key] = null;\n\t\t\t}\n\t\t}\n\n\t\tif (next.class) {\n\t\t\tnext.class = clsx(next.class);\n\t\t} else if (css_hash || next[CLASS]) {\n\t\t\tnext.class = null; /* force call to set_class() */\n\t\t}\n\n\t\tif (next[STYLE]) {\n\t\t\tnext.style ??= null; /* force call to set_style() */\n\t\t}\n\n\t\tvar setters = get_setters(element);\n\n\t\tif (\n\t\t\telement.nodeName === INPUT_TAG &&\n\t\t\t'type' in next &&\n\t\t\t('value' in next || '__value' in next)\n\t\t) {\n\t\t\tvar type = next.type;\n\n\t\t\tif (type !== current.type || (type === undefined && element.hasAttribute('type'))) {\n\t\t\t\tcurrent.type = type;\n\t\t\t\tset_attribute(element, 'type', type, skip_warning);\n\t\t\t}\n\t\t}\n\n\t\t// since key is captured we use const\n\t\tfor (const key in next) {\n\t\t\t// let instead of var because referenced in a closure\n\t\t\tlet value = next[key];\n\n\t\t\t// Up here because we want to do this for the initial value, too, even if it's undefined,\n\t\t\t// and this wouldn't be reached in case of undefined because of the equality check below\n\t\t\tif (is_option_element && key === 'value' && value == null) {\n\t\t\t\t// The