@wcstack/state 4.0.3 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +6 -4
- package/README.md +6 -4
- package/dist/auto.min.js +1 -1
- package/dist/auto.min.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/split/auto.js +1 -1
- package/dist/split/chunks/chunk-4HLDITUB.js +2 -0
- package/dist/split/chunks/chunk-4HLDITUB.js.map +1 -0
- package/dist/split/chunks/chunk-56ZGITUJ.js +2 -0
- package/dist/split/chunks/{chunk-TD4XQCEX.js.map → chunk-56ZGITUJ.js.map} +1 -1
- package/dist/split/chunks/{chunk-TUQ3OPZQ.js → chunk-7QVEF5E3.js} +2 -2
- package/dist/split/chunks/{chunk-4NJBYXIT.js → chunk-7ZU3CLEG.js} +1 -1
- package/dist/split/chunks/chunk-7ZU3CLEG.js.map +1 -0
- package/dist/split/chunks/{chunk-PHAN6L23.js → chunk-BWGPKDHS.js} +2 -2
- package/dist/split/chunks/{chunk-M656SMUU.js → chunk-GGSHXG7N.js} +2 -2
- package/dist/split/chunks/chunk-JAEYZSVS.js +2 -0
- package/dist/split/chunks/{chunk-V6VVL4F3.js.map → chunk-JAEYZSVS.js.map} +1 -1
- package/dist/split/chunks/{chunk-6MACFEK7.js → chunk-R5OJ52SF.js} +2 -2
- package/dist/split/chunks/chunk-UFIDBJBP.js +2 -0
- package/dist/split/chunks/{chunk-DFXQ7MFW.js → chunk-V3HFN3MW.js} +2 -2
- package/dist/split/chunks/{chunk-ZN52NEIB.js → chunk-XEGL4FW5.js} +2 -2
- package/dist/split/core.js +1 -1
- package/dist/split/features/devtools.js +1 -1
- package/dist/split/features/diagnostics.js +1 -1
- package/dist/split/features/diagnostics.js.map +1 -1
- package/dist/split/features/formats.js +1 -1
- package/dist/split/features/list-keys.js +1 -1
- package/dist/split/features/native-commands.js +1 -1
- package/dist/split/features/recursion.js +1 -1
- package/dist/split/features/scopes.js +1 -1
- package/dist/split/features/ssr.js +1 -1
- package/dist/split/features/temporal.js +1 -1
- package/dist/split/features/temporal.js.map +1 -1
- package/package.json +1 -1
- package/dist/split/chunks/chunk-4NJBYXIT.js.map +0 -1
- package/dist/split/chunks/chunk-BMGEWHCR.js +0 -2
- package/dist/split/chunks/chunk-EM3Y3SJS.js +0 -2
- package/dist/split/chunks/chunk-EM3Y3SJS.js.map +0 -1
- package/dist/split/chunks/chunk-TD4XQCEX.js +0 -2
- package/dist/split/chunks/chunk-V6VVL4F3.js +0 -2
- /package/dist/split/chunks/{chunk-TUQ3OPZQ.js.map → chunk-7QVEF5E3.js.map} +0 -0
- /package/dist/split/chunks/{chunk-PHAN6L23.js.map → chunk-BWGPKDHS.js.map} +0 -0
- /package/dist/split/chunks/{chunk-M656SMUU.js.map → chunk-GGSHXG7N.js.map} +0 -0
- /package/dist/split/chunks/{chunk-6MACFEK7.js.map → chunk-R5OJ52SF.js.map} +0 -0
- /package/dist/split/chunks/{chunk-BMGEWHCR.js.map → chunk-UFIDBJBP.js.map} +0 -0
- /package/dist/split/chunks/{chunk-DFXQ7MFW.js.map → chunk-V3HFN3MW.js.map} +0 -0
- /package/dist/split/chunks/{chunk-ZN52NEIB.js.map → chunk-XEGL4FW5.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["hooks","chain","prev","fn","a","first","answered","r","handled","known","taken","installed","Set","installFeatures","features","f","has","name","add","install","loadFeatures","state","names","$features","load","Array","isArray","missing","filter","n","length","requireFeature","feature","what","Error","raiseError","message","subject","candidates","explain","i","d","s","u","g","c","m","w","v"],"sources":["../../../src/hooks.ts","../../../src/parser/raiseError.ts"],"sourcesContent":["/**\n * The places the core calls into add-ons (docs/state-engine-rewrite/addons-plan.ja.md §1.2).\n *\n * Add-ons ship as separate entries of the same build as the core (`features/*`): they reach\n * the core's internals directly, and the core only calls out through these slots. A slot is\n * empty until an installed feature fills it (the object starts with none: a list of null slots\n * would be the core's bytes), so a page without the feature pays one `?.` check. A feature\n * restoring a slot may set it to null.\n * Slots are added with the first feature that needs them; several features share one through\n * chain / first. The slots `element` and `detail` keep their names (a DevTools-facing field and a DOM\n * name share them); the others are shortened by the build. An empty slot is read through\n * Object.prototype: a page that polluted it (a value under `element`, say) breaks the core loudly\n * there, as it does wherever the core reads a plain object's keys (`$behavior`); not defended.\n */\nimport type { Engine } from \"./engine\";\nimport type { Pattern } from \"./pattern\";\nimport type { StateList, StateRow } from \"./list\";\nimport type { Binding, RowPlan, Spec } from \"./dom/view\";\n\nexport interface Hooks {\n /** Diagnostics: extra text for an error message (did-you-mean, lint pointer, how to fix). */\n explain?: ((message: string, subject?: string, candidates?: Iterable<string>) => string) | null;\n /** Diagnostics: the full sentence of a numbered core message (`src/messages.ts`). */\n render?: ((id: number, args: readonly unknown[]) => string) | null;\n /**\n * A write before it is applied (`element`: an element wrote it back, not code); true = the\n * add-on handled it ($listKeys, a read-only mount dropping an element's write).\n */\n beforeWrite?: ((engine: Engine, p: Pattern, row: StateRow | null, value: unknown, element: boolean) => boolean) | null;\n /** A write landed: `direct` for a data write (then `old` is the value before, `value` the new one). */\n written?: ((engine: Engine, p: Pattern, row: StateRow | null, old: unknown, value: unknown, direct: boolean) => void) | null;\n /** A change reached a getter occurrence whose cached value was current (it may now differ). */\n getterReached?: ((engine: Engine, g: Pattern, row: StateRow | null) => void) | null;\n /** A list was reconciled with a new value; `old` are its rows before. */\n listSynced?: ((engine: Engine, list: StateList, old: StateRow[]) => void) | null;\n /** A drain ended (after its report and `$renderedCallback`). */\n drained?: ((engine: Engine) => void) | null;\n /** A state object was received (construction, or a re-set before it replaces the old one). */\n declare?: ((engine: Engine, target: Record<string, any>) => void) | null;\n /**\n * A root engine's lifecycle: \"mounting\" (created, its page not bound yet), \"back\" (its `<wcs-state>`\n * connected again, before `$connectedCallback` runs again: it holds its root again, unless another\n * one bound it meanwhile), \"connected\" (after `$connectedCallback`, and on reconnect), \"disconnected\",\n * \"reset\" (after a re-set).\n */\n element?: ((engine: Engine, phase: \"mounting\" | \"back\" | \"connected\" | \"disconnected\" | \"reset\") => void) | null;\n /**\n * A `<wcs-state>` an add-on takes over instead of it becoming a root (a volume, a DCC\n * definition): asked when it connects; the core then only loads its state.\n */\n claim?: ((el: HTMLElement, root: Node) => Claimed | null) | null;\n /** A `$` name the core does not know. */\n dollar?: ((engine: Engine, key: string) => unknown) | null;\n /** A binding failed to apply (reported after the drain, before `$errorCallback` / the console). */\n failed?: ((engine: Engine, error: unknown, binding: Binding) => void) | null;\n /**\n * A plain property binding on a custom element, made and not yet registered or applied (a\n * component mount's wiring, `state.x: path`); true = an add-on took it over.\n */\n hostBinding?: ((binding: Binding, ro: boolean) => boolean) | null;\n /** An element whose content an add-on binds (a Light DOM component): the walker leaves it. */\n componentScope?: ((el: Element) => boolean) | null;\n /**\n * The page walker replaced a structural template with its anchor (`source` is the template),\n * bound a mustache text node (`source` is its expression), or is about to bind an element\n * (`source` is its specs, which the hook may take some out of): SSR records the first two, and\n * on the server leaves `outerHTML:` to the client.\n */\n ssrMark?: ((engine: Engine, node: Node, source: Element | string | Spec[]) => void) | null;\n /**\n * A block is about to be cloned from `plan` for the view anchored at `anchor`: an add-on may\n * hand over existing nodes instead (SSR hydration) — the block's top-level nodes, already where\n * the block renders (the view inserts nothing), with the plan's nodes in them in `plan.scratch`.\n */\n adopt?: ((plan: RowPlan, anchor: Node, isFor: boolean) => ChildNode[] | null) | null;\n /**\n * A Light DOM component's engine is about to bind `root` (its host): SSR hands over the server's\n * nodes there too; the function returned is called when the walk is done.\n */\n adoptScope?: ((root: Node) => (() => void) | null) | null;\n /** A path a binding (or, with `watch`, a `$watch` key) names: diagnostics checks it exists. */\n declared?: ((engine: Engine, p: Pattern, watch?: boolean) => void) | null;\n /** `<wcs-state>` was defined in `registry`: an add-on defines its own tags there (`<wcs-ssr>`). */\n tags?: ((registry: CustomElementRegistry) => void) | null;\n /** A wc-bindable property's event read with the default getter (`e.detail`): diagnostics checks its shape. */\n detail?: ((el: Element, name: string, detail: unknown) => void) | null;\n /**\n * `command.<method>:` on an element with no wc-bindable declaration: how a native element's\n * method is called (native-commands), or null for a custom element. The add-on throws for a\n * method a native element may not be commanded to run.\n */\n nativeCommand?: ((el: Element, method: string) => NativeCall | null) | null;\n /** The split auto entry: loads and installs add-ons of its build by name (a state's `$features`). */\n load?: ((names: string[]) => Promise<void>) | null;\n /**\n * An event an add-on (or the core) reports for the DevTools protocol (a `$watch` handler fired or\n * threw, a `$watch` chain or an update loop cut, a path that does not resolve): `event` is the\n * protocol's payload, its keys quoted (`{ \"type\": \"state:watch-fired\", \"path\": … }`). Called as\n * `hooks.noticed?.(engine, {…})`, the payload is built only while the slot is filled.\n */\n noticed?: ((engine: Engine, event: Record<string, unknown>) => void) | null;\n}\n\n/** Calls a native element's command method with what the token was emitted with. */\nexport type NativeCall = (target: Element, args: unknown[]) => unknown;\n\n/** What an add-on does with a `<wcs-state>` it claimed. */\nexport interface Claimed {\n /** Where the state comes from, when not from the element's own sources. */\n load?(): Promise<Record<string, any>>;\n /**\n * The loaded state; `connectedCallbackPromise` resolves when this is done, and `built` is called\n * once its bindings are built (before `$connectedCallback`: getBindingsReady resolves then, as for a\n * root). When it (or the load) throws, the core reports the failure and rejects the promise with\n * it — a DCC definition, a component mount: 3.x's README promises it for their configuration\n * errors, and 4.0 also rejects where 3.x did not (a component whose root failed: 3.x left it\n * unsettled; a second mount in one scope: 3.x resolved it) — or resolves it, for a lenient claim.\n */\n start(state: Record<string, any>, built: () => void): Promise<void> | void;\n /** A failure resolves `connectedCallbackPromise` instead (a volume settles without grafting, as 3.x). */\n lenient?: boolean;\n connected(): void;\n disconnected(): void;\n /** `setInitialState` after the start. */\n reset(state: Record<string, any>): void;\n}\n\nexport const hooks: Hooks = {};\n\ntype HookFn = (...args: any[]) => any;\n\n/*\n * A feature fills a slot by assigning it (`hooks.written = chain(hooks.written, fn)`), never by\n * its name as a string: the slot names are shortened by the build (mangle.mjs) like any internal\n * property.\n */\n\n/** A slot several features share: `fn` runs after whatever is there. */\nexport function chain<F extends HookFn>(prev: F | null | undefined, fn: F): F {\n return prev == null ? fn : ((...a: unknown[]) => { prev(...a); fn(...a); }) as F;\n}\n\n/** A slot whose first answer wins (`answered` tells one): `fn` is asked when what is there does not answer. */\nexport function first<F extends HookFn>(answered: (r: unknown) => boolean, prev: F | null | undefined, fn: F): F {\n return prev == null ? fn : ((...a: unknown[]) => { const r = prev(...a); return answered(r) ? r : fn(...a); }) as F;\n}\n\n/** `beforeWrite`: the first feature that handles the write. */\nexport const handled = (r: unknown): boolean => r === true;\n/** `dollar`: the first feature that knows the `$` name (a value, possibly null or false). */\nexport const known = (r: unknown): boolean => r !== undefined;\n/** `claim`: the first feature that takes the `<wcs-state>`. */\nexport const taken = (r: unknown): boolean => r != null;\n\n/** An add-on entry: `installFeatures([temporal, diagnostics])` before the state is defined. */\nexport interface Feature {\n readonly name: string;\n install(): void;\n}\n\nconst installed = new Set<string>();\n\nexport function installFeatures(features: readonly Feature[]): void {\n for (const f of features) {\n if (installed.has(f.name)) continue;\n installed.add(f.name);\n f.install();\n }\n}\n\n/**\n * A state's `$features` before its engine is made: the missing add-ons, loaded where an entry can\n * load them (`hooks.load`); undefined when there is nothing to wait for. The engine then checks\n * every name (a bundle or the full build only checks).\n */\nexport function loadFeatures(state: Record<string, any>): Promise<void> | undefined {\n const names = state.$features;\n if (hooks.load != null && Array.isArray(names)) {\n const missing = names.filter((n) => !installed.has(n));\n if (missing.length > 0) return hooks.load(missing);\n }\n}\n\n/** The barrier: a declaration that needs a feature the page did not install. */\nexport function requireFeature(feature: string, what: string): void {\n if (!installed.has(feature)) {\n throw new Error(`[@wcstack/state] [wcs/feature-not-installed] ${what} needs the add-on @wcstack/state/features/${feature}`);\n }\n}\n","import { hooks } from \"../hooks\";\n\n/**\n * Throws `[@wcstack/state] <message>`. The core's messages state the fact (a number and values); the\n * diagnostics add-on, when installed, appends the guidance (the nearest of `candidates` to\n * `subject`, how to fix it, the lint pointer).\n */\nexport function raiseError(message: string, subject?: string, candidates?: Iterable<string>): never {\n throw new Error(`[@wcstack/state] ${message}${hooks.explain?.(message, subject, candidates) ?? \"\"}`);\n}\n"],"mappings":"AA+HO,IAAMA,EAAe,CAAC,EAWtB,SAASC,EAAwBC,EAA4BC,GAClE,OAAe,MAARD,EAAeC,MAAUC,KAAmBF,KAAQE,GAAID,KAAMC,EAAI,CAC3E,CAGO,SAASC,EAAwBC,EAAmCJ,EAA4BC,GACrG,OAAe,MAARD,EAAeC,MAAUC,KAAmB,IAAMG,EAAIL,KAAQE,GAAI,OAAOE,EAASC,GAAKA,EAAIJ,KAAMC,EAAI,CAC9G,CAGO,IAAMI,EAAWD,IAA8B,IAANA,EAEnCE,EAASF,QAA8B,IAANA,EAEjCG,EAASH,GAA6B,MAALA,EAQxCI,EAAY,IAAIC,IAEf,SAASC,EAAgBC,GAC9B,QAAWC,KAAKD,EACVH,EAAUK,IAAID,EAAEE,QACpBN,EAAUO,IAAIH,EAAEE,MAChBF,EAAEI,UAEN,CAOO,SAASC,EAAaC,GAC3B,IAAMC,EAAQD,EAAME,UACpB,GAAkB,MAAdvB,EAAMwB,IAAgBC,MAAMC,QAAQJ,GAAQ,CAC9C,IAAMK,EAAUL,EAAMM,OAAQC,IAAOlB,EAAUK,IAAIa,IACnD,GAAIF,EAAQG,OAAS,EAAG,OAAO9B,EAAMwB,GAAKG,EAC5C,CACF,CAGO,SAASI,EAAeC,EAAiBC,GAC9C,IAAKtB,EAAUK,IAAIgB,GACjB,MAAM,IAAIE,MAAM,gDAAgDD,8CAAiDD,IAErH,CCrLO,SAASG,EAAWC,EAAiBC,EAAkBC,GAC5D,MAAM,IAAIJ,MAAM,oBAAoBE,IAAUpC,EAAMuC,KAAUH,EAASC,EAASC,IAAe,KACjG,QAAAE,OAAApC,OAAAqC,OAAAC,OAAAC,OAAAC,OAAAC,OAAAC,OAAAC,OAAAC","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./chunk-PHAN6L23.js";import{a as t,d as n,e as l,j as i,k as r}from"./chunk-EM3Y3SJS.js";import{a as o,g as s}from"./chunk-6MACFEK7.js";import{a as u}from"./chunk-ZN52NEIB.js";import{a,b as h,c,d as f,e as d,f as m,g as p,h as g,i as v,j as w,k as y,l as N,n as b}from"./chunk-TUQ3OPZQ.js";import{a as S,b as x}from"./chunk-M656SMUU.js";import{a as k}from"./chunk-4NJBYXIT.js";var T=new Map,j=new Set(["if","elseif","else","for"]),E=new Set([a,"if","elseif","for","..."]),A=new Set([d,m,p,f,h,c]);function F(e){let t=function(e){return y(e,";")}(e).map(v).filter(e=>e.length>0).map(e=>{let t=w(e,":");-1===t&&x(101,[e]);let n=e.slice(0,t).trim(),l=e.slice(t+1).trim(),i=n.split("#")[0].split("|")[0].trim();if(E.has(i)){let t;return i!==n&&x(102,[e,i]),i===a?(l.length>0&&x(103,[e]),t={Je:"#else",Ze:[]}):"..."===i?(0===l.length&&x(104,[e]),t=b(l),t.Ze.length>0&&x(105,[e])):(t=b(l),"for"===i&&t.Ze.length>0&&x(121,[e])),{Se:i,$e:[i],on:[],j:[],...t,w:"..."===i?"spread":i}}(i===d||i===m)&&x(122,[e,i]);let r=b(l),o=function(e){let[t,n]=N(e,"input",T),l=t.split("#").map(v);l.length>2&&x(115,[t]);let[i,r]=l,o=i.split(".").map(v);return!(o.length>1&&""===o[0])&&(0===i.length||o.some(e=>0===e.length))&&x(116,[e]),{Se:i,$e:o,on:r?r.split(",").map(v):[],j:n}}(n),[s]=o.$e;if(""===s&&o.$e.length>1){let e=o.$e.slice(1);return(e.includes("")||A.has(e[0]))&&x(106,[n]),{...o,Se:e.join("."),$e:e,...r,w:"prop"}}return{...o,...r,w:"radio"===i||"checkbox"===i?i:s===h||s.startsWith("on")?"event":"prop"}});return t.length>1&&t.some(e=>j.has(e.w))&&x(201,[e]),t}function $(e,t){if(null!==e)for(let n=0;n<e.length;n++)t=e[n](t);return t}function C(t){return 0===t.length?null:(e(),t.map(e=>s(e.Hn,e.args,e.literals)))}var L=Symbol.for("wcstack.state.view-transition-naming"),P=new WeakSet;function D(){let e=t("state");return null!==e&&"auto"===e.naming?e.namingLimit:-1}var O=new Set(["click","dblclick","input","change","submit","keydown","keyup","mousedown","mouseup","pointerdown","pointerup"]),K=0,U=2,M=3,I=4,R=5,W=["text","prop","prop","prop","prop","event","for","if","prop","radio","checkbox","prop","prop","event","spread"],G=(e,t,n,l)=>e.Gt(t,n.o?.t??n.Rt,l,W[n.i]),B=Symbol();function q(e,t,n){let l=t.K;return null===l||"state"===l||"auto"===l&&void 0!==e.v(t.o,n)?t.U:B}var V=class{constructor(e,t,n,l,i,r,o,s,u,a=null){this.te=!1,this.j=null,this.Tn=!1,this.engine=e,this.i=t,this.a=n,this.name=l,this.o=i,this.r=r,this.Pn=o,this.N=s,this.value=u,this._=a}nn(){return W[this.i]}apply(){if(null!==this._)return void this._.Et();let e=$(this.N,this.engine.read(this.o,this.r));if(e===this.value&&9!==this.i&&("object"!=typeof e||null===e||11===this.i||8===this.i||i(this.name)))return;if(this.value===B)return void(this.value=e);let t=this.a;if(11!==this.i)9===this.i?t.checked=void 0!==e&&this.rn()===e:10===this.i?t.checked=Array.isArray(e)&&e.includes(this.rn()):H(this.i,t,this.name,e),this.value=e;else{if(void 0===e)return void(this.value=e);this.value=e,this.Tn=!0;try{t[this.name]!==e&&(t[this.name]=e)}finally{this.Tn=!1}}}rn(){return $(this.j,this.a.value)}ir(){let e,t=this.a,n=this.engine;if(9===this.i){if(!t.checked)return;e=this.rn()}else if(10===this.i){let l=this.rn(),i=n.v(this.o,this.r),r=Array.isArray(i)?i:[],o=r.includes(l);if(t.checked?o:!o)return;e=o?r.filter(e=>e!==l):[...r,l]}else e=$(this.j,t[this.name]),this.value=NaN;n.T(this.o,this.r,e,!1,!0)}},Z=e=>"textContent"===e||"innerText"===e||"innerHTML"===e;function H(e,t,n,l){switch(e){case 0:return void(t.data=null==l?"":String(l));case 1:return void(Z(n)?t[n]="innerHTML"===n?r(l):null==l?"":String(l):i(n)?null==l&&"srcdoc"===n?t.removeAttribute(n):void 0!==l&&(t[n]=r(l)):void 0!==l&&(t[n]!==l&&!("value"===n&&t.value===String(l))&&(t[n]=l),("value"===n||"selectedIndex"===n)&&"select"===t.localName&&(t[J]=[n,l])));case 8:return void(t.innerHTML=r(l));case 2:return null!=l&&"boolean"!=typeof l&&x(401,[n,typeof l]),void t.classList.toggle(n,!0===l);case 3:return void(null==l?t.removeAttribute(n):t.setAttribute(n,String(l)));case 4:return void(n.includes("-")?null==l?t.style.removeProperty(n):t.style.setProperty(n,String(l)):t.style[n]=null==l?"":String(l))}}var J=Symbol();function X(e){let t="optgroup"===e.localName?e.parentNode:e,n=t?.[J];void 0!==n&&(t[n[0]]=n[1])}var z=class{constructor(e,t,n,l){this.y=!0,this.he=null,this.c=null,this.xt=null,this.Fn=null,this.r=e,this.Ue=t,this.D=n,this.F=l}Jo(e,t){let n=t.target,l=this.F,i=[],r=null;for(let t of l.Re){if(t.name!==e)continue;let o=l.On[t.a],s=ue(null===this.D?this.Ue:this.D[o[0]],o,1);s.contains(n)&&(s!==r&&i.unshift([]),i[0].push(t),r=s)}for(let e of i){for(let n of e)n.An(t,this.r);if(t.cancelBubble)return!0}return!1}get s(){return null===this.D?this.Ue:this.D[this.D.length-1]}qe(){let e=this.Fn;return(null===e?null:e.Cn(this.Ue))??this.Ue}insertBefore(e,t){let n=this.s;for(let l=this.qe();;){let i=l.nextSibling;if(e.insertBefore(l,t),l===n)return;l=i}}wo(){null===this.D?this.Ue.remove():ae(this.qe(),this.s)}Ne(e){if(this.y=!1,null!==this.xt)for(let e of this.xt)e();let t=this.he;if(null!==t)for(let n=0;n<t.length;n++)e.xn(t[n]);if(null!==this.c)for(let e of this.c)e.Ne()}},_=class extends z{constructor(e,t,n,l){super(e,t,n,l),this.bo=0,this.V=null,this.fe=0===l.ze.length?null:new Array(2*l.ze.length)}vo(e,t){let n=this.V??=new Array(this.F.ze.length),l=n[t];if(void 0===l){let i=this.F.ze[t],r=this.fe;l=n[t]=new V(e,i.i,r[2*t],i.name,i.o,this.r,this,i.N,r[2*t+1])}return l}uo(e,t){let n=this.F.ze;for(let l=0;l<n.length;l++)n[l].o.ee(t)&&e.en(this.vo(e,l))}Ne(e){let t=this.r;t.E===this&&(t.E=null),super.Ne(e)}};function Q(e,t,n,i){let r=l(n,t.n);try{return e.We(r,t)}catch(n){return e.Gt(n,t.t,i,"for"),null===r?e.oe.get(t):r.c.get(t)}}function Y(e,t,n){n&&e.nr(t);let l=t.Pn;null!==l&&(l.he??=[]).push(t)}var ee=null;function te(){let e=ee;return ee=null,e}var ne=-1;function le(e,t,n,l,i=null){let r,o=t.On,s=t.build,u=t.ko,a=null,h=k.Oe?.(t,null===l?i:l.S,null!==l),c=!h&&t.In,f=h?document.createDocumentFragment():(c?t.root:t.sn).cloneNode(!0);if(!h)for(let e=0;e<s.length;e++){let t=s[e];u[t]=ue(f,o[t],c?1:0)}c?r=f:(a=h||[...f.childNodes],r=a[0]);let d,m=null;if(null!==l?(d=m=new _(n,r,a,t),null===l.map?n.E=m:l.map.set(n,m)):d=new z(n,r,a,t),ne>=0&&function(e,t,n,l){let i=null;if(null===t)i=1===e.nodeType?e:null;else for(let e=0;e<t.length&&null===i;e++)1===t[e].nodeType&&(i=t[e]);let r=i?.style;if(null===i||void 0===r||P.has(i))return;let o=globalThis[L]??={counter:0,assigned:0,warned:!1};o.assigned>=l?o.warned||(o.warned=!0,console.warn(`[@wcstack/state] ${S(25,[l])}`)):(P.add(i),o.assigned++,r.setProperty("view-transition-name",`wcs-${n}-${++o.counter}`),r.setProperty("view-transition-class",`wcs-${n}`))}(r,a,null!==l?"row":"branch",ne),t.Re.length>0){let t=e.Kn;if(null===a)r[t]=d;else for(let e of a)1===e.nodeType&&(e[t]=d)}let p=t.sr,g=e.De,v=t.lr?u.slice(0,o.length):u,w=null===m?null:m.fe;if(null!==w){let e=t.ze;for(let t=0;t<e.length;t++)w[2*t]=v[e[t].a],w[2*t+1]=e[t].U}for(let t=0;t<p.length;t++){let l=p[t],i=v[l.a],o=l.A;if(o>=0&&null!==w){let t=m.V?.[o];if(void 0!==t){t.te=!1,e.Ve(t);continue}try{let t=$(l.N,e.read(l.o,n));t!==l.U&&(H(l.i,i,l.name,t),w[2*o+1]=t),null!==g&&e.po(l.o,n)}catch(t){e.Nt(t,m.vo(e,o))}continue}switch(l.i){case 6:{let t=new se(e,l.F,Q(e,l.o,n,i),i);(d.c??=[]).push(t),i===r&&(d.Fn=t),t.Et();break}case 7:{let t=re(e,l.G.map(e=>({F:e.F,o:e.o,N:e.N,S:v[e.a]})),n,d);(d.c??=[]).push(t),i===r&&(d.Fn=t);break}default:try{ie(e,l,i,n,d)}catch(t){G(e,t,l,i)}}}return ee=d,f}function ie(e,t,n,i,r){let o=n;switch(t.i){case 5:return void function(e,t,n,l,i){let r=n.An,o=e=>r(e,l);if(n.et){let l=e.ao(n.name),i=t[l];t[l]=void 0===i?o:e=>{i(e),o(e)},n.Ee&&t.addEventListener(n.name,e=>e.bubbles||o(e))}else t.addEventListener(n.name,o),n.yo&&null!==i&&(i.xt??=[]).push(()=>t.removeEventListener(n.name,o))}(e,n,t,i,r);case 12:return void fe(e,t,o,r,n=>function(e,t,n,l,i){let r=t.name,o=e.command(t.Rt.slice(9)),s=null===i?k.or?.(n,r):null;s||(null===i&&me(1202,n,`command.${r}`),i.commands.has(r)||x(1203,[n.localName,r]));let u=new WeakRef(n),a=o.subscribe((...e)=>{let t=u.deref();if(void 0!==t)return t.isConnected?s?s(t,e):t[r](...e):void 0;a()});null!==l&&(l.xt??=[]).push(a)}(e,t,o,r,n));case 13:return void fe(e,t,o,r,n=>function(e,t,n,l,i){let r=t.name;null===i&&me(1202,n,`eventToken.${r}`);let o=i.properties.get(r);void 0===o&&x(1204,[n.localName,r]);let s=t.Rt;n.addEventListener(o.event,n=>{t.Pt&&n.preventDefault(),t.Tt&&n.stopPropagation();try{e.Zo(s,n,l)}catch(e){console.error(e)}})}(e,t,o,i,n))}let s=t.o,u=l(i,s.n);if(14===t.i)return void fe(e,t,o,r,n=>function(e,t,n,l,i,r){null===r&&me(1501,n,`"...: ${t.o.t}"`);let o=new Set([...r.properties.keys(),...r.inputs]);for(let s of o){if(t.go?.includes(s))continue;let o=e.o(`${t.o.t}.${s}`),u=0===o.n?null:l;de(e,{...t,K:null,X:null},n,s,o,u,i,r)}}(e,t,o,u,r,n));if(t.Ee&&1===t.i)return void fe(e,t,o,r,n=>function(e,t,n,l,i,r){if(null!==r)return void de(e,t,n,t.name,t.o,l,i,r);let o=new V(e,1,n,t.name,t.o,l,i,t.N,q(e,t,l));o.j=t.j,!k.ar?.(o,t.ro)&&(Y(e,o,!0),e.Ve(o))}(e,t,o,u,r,n));let a=new V(e,t.i,n,t.name,s,u,r,t.N,q(e,t,u));a.j=t.j,Y(e,a,!0),e.Ve(a),null!==t.At&&n.addEventListener(t.At,()=>a.ir())}function re(e,t,n,i){let r=new oe(e,t,n),o=null;for(let s of t){if(null===s.o)continue;let t=s.o,u=new V(e,7,s.S,"if",t,l(n,t.n),i,null,void 0,r);Y(e,u,!0),null===i&&r.ce.push(u),o??=u}return e.Ve(o),r}var oe=class{constructor(e,t,n){this.y=!0,this.O=null,this.b=-1,this.ce=[],this.engine=e,this.G=t,this.r=n}Cn(e){return null!==this.O&&this.G[this.b].S===e?this.O.qe():null}Et(){let e=this.engine,t=-1;for(let n=0;n<this.G.length;n++){let i=this.G[n];if(null===i.o||$(i.N,e.read(i.o,l(this.r,i.o.n)))){t=n;break}}if(t!==this.b&&(ne=D(),null!==this.O&&(this.O.wo(),this.O.Ne(e),this.O=null),this.b=t,t>=0)){let n=this.G[t],l=le(e,n.F,this.r,null,n.S);this.O=te();let i=n.S.parentNode;i.insertBefore(l,n.S),X(i)}}Ne(){this.y=!1;for(let e of this.ce)this.engine.xn(e);null!==this.O&&this.O.Ne(this.engine)}},se=class{constructor(e,t,n,l){this.y=!0,this.xe=[],this.engine=e,this.F=t,this.l=n,this.S=l,null===n.E?(n.E=this,this.map=null):((n.L??=[]).push(this),this.map=new Map)}Cn(e){return 0===this.xe.length?null:this.xe[0].qe()}Ft(e){return null===this.map?e.E:this.map.get(e)??null}Dt(e){let t=this.map;null!==t&&t.get(e.r)===e&&t.delete(e.r),e.Ne(this.engine)}Et(){let e=this.engine,t=this.l.f,n=this.xe;ne=D();let l=t.length,i=n.length,r=this.S,o=r.parentNode;if(0===l){if(i>0){let e=n[0].qe(),t=n[i-1].s,l=[];for(let n=o.firstChild;null!==n;n=n===e?t.nextSibling:n.nextSibling)if(n!==e){if(n!==r&&3!==n.nodeType){l=null;break}l.push(n)}null!==l?o.replaceChildren(...l):ae(e,t);for(let e=0;e<i;e++)this.Dt(n[e])}return void(this.xe=[])}let s=new Array(l),u=0;for(;u<l&&u<i&&this.Ft(t[u])===n[u];)s[u]=n[u],u++;let a=i-1,h=l-1;for(;a>=u&&h>=u&&this.Ft(t[h])===n[a];)s[h]=n[a],a--,h--;for(let e=u;e<=a;e++){let t=n[e],l=t.r;l.y&&this.Ft(l)===t?t.bo=e:(t.wo(),this.Dt(t))}if(u<=h){let n=h-u+1,a=new Int32Array(n),c=!1;if(i>0)for(let e=0;e<n;e++){let n=this.Ft(t[u+e]);null!==n&&n.y?(a[e]=n.bo,c=!0):a[e]=-1}let f=h+1<l?s[h+1].qe():r;if(c){let l=function(e){let t=e.length,n=new Uint8Array(t),l=new Int32Array(t).fill(-1),i=[];for(let n=0;n<t;n++){let t=e[n];if(t<0)continue;let r=0,o=i.length;for(;r<o;){let n=r+o>>1;e[i[n]]<t?r=n+1:o=n}r>0&&(l[n]=i[r-1]),i[r]=n}let r=i.length>0?i[i.length-1]:-1;for(;r>=0;)n[r]=1,r=l[r];return n}(a),i=f;for(let r=n-1;r>=0;r--){let n=t[u+r],a=this.Ft(n);null!==a&&a.y?0===l[r]&&a.insertBefore(o,i):(o.insertBefore(le(e,this.F,n,this),i),a=te()),s[u+r]=a,i=a.qe()}}else{let n=document.createDocumentFragment();for(let l=u;l<=h;l++)n.appendChild(le(e,this.F,t[l],this)),s[l]=te();o.insertBefore(n,f)}}this.xe=s,X(o)}Ne(){this.y=!1;let e=this.l;if(e.E===this)e.E=null;else if(null!==e.L){let t=e.L.indexOf(this);t>=0&&e.L.splice(t,1),0===e.L.length&&(e.L=null)}for(let e of this.xe)e.Ne(this.engine);this.map?.clear()}};function ue(e,t,n){for(;n<t.length;n++){e=e.firstChild;for(let l=t[n];l>0;l--)e=e.nextSibling}return e}function ae(e,t){for(let n,l=e;l!==t;l=n)n=l.nextSibling,l.remove();t.remove()}var he=new WeakMap,ce=e=>e.customElementRegistry??customElements;function fe(e,t,n,l,i,r=!1){let o=n.localName;if(!o.includes("-"))return i(null);let s=ce(n);if(!r&&!n.isConnected&&void 0===s.get(o)&&"customElementRegistry"in n)return void queueMicrotask(()=>fe(e,t,n,l,i,!0));let u=()=>{let e=s.get(o);s.upgrade(n),i(e?function(e){if(he.has(e))return he.get(e);let t=e.wcBindable,n=null;if(null!==t&&"object"==typeof t&&"wc-bindable"===t.protocol&&Number.isInteger(t.version)&&t.version>=1){n={properties:new Map,inputs:new Set,commands:new Set};for(let e of t.properties??[])n.properties.set(e.name,{event:e.event,getter:"function"==typeof e.getter?e.getter:null,ho:"event"===e.semantics});for(let e of t.inputs??[])n.inputs.add(e.name);for(let e of t.commands??[])null!==e&&"object"==typeof e&&"string"==typeof e.name&&n.commands.add(e.name)}return he.set(e,n),n}(e):null)};if(!r&&void 0!==s.get(o))return u();null!==l&&!l.y||function(e,t,n){let l=n;null!==t&&(t.xt??=[]).push(()=>{l=null}),e.then(()=>l?.())}(s.whenDefined(o),l,()=>{try{u()}catch(l){G(e,l,t,n)}e.Te()})}function de(e,t,n,l,i=t.o,r,o,s){let u=s.properties.get(l)??null,a=s.inputs.has(l),h=e._t;h&&null===u&&!a&&x(38,[l]);let c=t.K;(null===u?"element"===c||"auto"===c:!a&&("state"===c||"auto"===c))&&x(39,[c,l]),"connect"===t.X&&null===u&&x(40,[l]);let f=h&&null!==u&&!a,d=new V(e,11,n,l,i,r,o,t.N,void 0);d.j=t.j,Y(e,d,!f),null!==u&&!t.ro&&n.addEventListener(u.event,t=>{let i;null!==u.getter?i=u.getter(t):(i=t.detail,u.ho||k.detail?.(n,l,i)),(!d.Tn||!Object.is(i,d.value))&&(i=$(d.j,i),null===d.N&&(d.value=i),e.T(d.o,d.r,i,u.ho,!0))});let m=c??(f?"element":"state");if("state"===m)f||e.Ve(d);else if("element"===m||"auto"===m){let i=()=>{if(null!==o&&!o.y)return;if("auto"===m&&void 0!==e.v(d.o,d.r))return void(f||e.Ve(d));let t=n[l];null===d.N&&(d.value=t),e.T(d.o,d.r,t,!1,!0)};"connect"!==t.X||n.isConnected?i():Promise.resolve().then(i)}return d}function me(e,t,n){x(e,[t.localName,n])}var pe=()=>o.bindAttributeName;function ge(){return{a:0,i:1,name:"",o:null,N:null,U:u,An:null,F:null,G:null,j:null,At:null,Ee:!1,K:null,X:null,ro:!1,Pt:!1,Tt:!1,Rt:null,go:null,A:-1,et:!1,yo:!1}}var ve=["state","element","auto","none"],we=["call","connect"],ye="$command.";function Ne(e,t,n){g.test(t)&&(null===n&&x(1401,[t,Number(t.slice(1))]),t=`${n.t}.*.${t}`);let l=e.o(function(e,t){return 46!==e.charCodeAt(0)?e:(null===t&&x(1402,[e]),"."===e?`${t.t}.*`:`${t.t}.*${e}`)}(t,n)),i=null===n?0:n.n+1;l.n>i&&x(1401,[l.t,l.n,i]);for(let e=1;e<=l.n;e++){let t=e===i?n:n.h[e];l.h[e]!==t&&x(1403,[l.t,l.h[e].t,t.t])}return k.So?.(e,l),l}var be=e=>1===e.i&&("outerHTML"===e.name||"outerText"===e.name),Se=e=>8===e.i||be(e)||1===e.i&&Z(e.name);function xe(e){x(202,[e])}function ke(e,t,l,r,o){let s=F(t).map(t=>function(e,t,l,r,o){let s=function(e,t){let n=t.find(e=>e.startsWith("on")),l=null,i=null;for(let n of t){let t=n.indexOf("=");if(t<0)continue;e._t||x(31);let r=n.slice(0,t).trim(),o=n.slice(t+1).trim(),s="init"===r;!s&&"sync"!==r&&x(33,[r,n]),null!==(s?l:i)&&x(34,[r]),(s?ve:we).includes(o)||x(35,[r,o]),s?l=o:i=o}return{ro:t.includes("ro"),Pt:t.includes("prevent"),Tt:t.includes("stop"),event:n?n.slice(2):null,K:l,X:i}}(e,t.on),u=r.localName.includes("-"),a=t.$e,h=t.Je;if("event"===t.w){if(null!==s.K&&"none"!==s.K&&x(36),"eventToken"===a[0])return{...ge(),a:o,i:13,name:a.slice(1).join("."),Rt:h,Ee:u,Pt:s.Pt,Tt:s.Tt};let l=h.startsWith(ye)?h.slice(9):null,{Pt:i,Tt:r}=s,c=t.Se.slice(2),f=t.on.includes("direct"),d=!f&&O.has(c);return d&&e.ao(c),{...ge(),a:o,i:5,name:c,et:d,Ee:u,yo:f,An(t,o){i&&t.preventDefault(),r&&t.stopPropagation();try{if(null!==l)e.er(l,t,o);else{let l=e.tr(h,t,o);n(l)&&l.then(void 0,e=>console.error(e))}}catch(e){console.error(e)}}}}if("spread"===t.w)return{...ge(),a:o,i:14,o:Ne(e,h,l),Ee:u};if("command"===a[0]&&a.length>1)return h.startsWith(ye)||x(1201,[t.Se,h]),{...ge(),a:o,i:12,name:a.slice(1).join("."),Rt:h,Ee:u};let c=Ne(e,h,l),f={...ge(),a:o,i:1,name:t.Se,o:c,N:C(t.Ze),j:C(t.j),ro:s.ro,K:s.K,X:s.X};if("radio"===t.w||"checkbox"===t.w)return("element"===s.K||"auto"===s.K)&&x(37,[t.w,s.K]),f.i="radio"===t.w?9:10,s.ro||(f.At=s.event??"input"),f;if(a.length>1){let e=a.slice(1).join("."),t=a[0];if("class"===t||"attr"===t||"style"===t)return f.K=null,f.name=e,"class"===t?(f.i=2,f.U=r.classList.contains(e)):f.i="attr"===t?"srcdoc"===e&&"iframe"===r.localName?1:3:4,f}return"html"===t.Se?(f.i=8,f):(f.name="text"===t.Se?"textContent":t.Se,f.Ee=u&&!i(f.name),!u&&!s.ro&&function(e,t){let n=e.localName;if("input"===n){let n=(e.getAttribute("type")||"text").toLowerCase();return"button"!==n&&(("radio"===n||"checkbox"===n)&&"checked"===t||"value"===t||"valueAsNumber"===t||"valueAsDate"===t)}return("select"===n||"textarea"===n)&&"value"===t}(r,f.name)&&(f.At=s.event??("select"===r.localName?"change":"input")),f)}(e,t,l,r,o));for(let e=0;e<s.length;e++)14===s[e].i&&(s[e].go=s.slice(e+1).filter(e=>1===e.i).map(e=>e.name));return s}var Te=/\{\{([\s\S]+?)\}\}/g;function je(e){let t=e.data,n=[],l=0;Te.lastIndex=0;for(let i=Te.exec(t);null!==i;i=Te.exec(t)){let r=Te.lastIndex-i[0].length;r>l&&e.before(t.slice(l,r));let o=e.ownerDocument.createTextNode("");e.before(o),n.push({a:o,cr:i[1].trim()}),l=Te.lastIndex}return 0===n.length||(l<t.length&&e.before(t.slice(l)),e.remove()),n}function Ee(e,t,n,l){let i=function(e){return{Se:"textContent",$e:["textContent"],on:[],j:[],...b(e),w:"text"}}(t);return{...ge(),a:l,i:0,o:Ne(e,i.Je,n),N:C(i.Ze),U:""}}function Ae(e){let t=e.getAttribute(pe());if(null===t)return null;let n=F(t)[0];return void 0===n||"for"!==n.w&&"if"!==n.w&&"elseif"!==n.w&&"else"!==n.w?null:n}var Fe=(e,t)=>0===e?o.commentIfPrefix:null===t.o?o.commentElsePrefix:o.commentElseIfPrefix;function $e(e,t,n){let l=(t,l)=>({el:t,o:"else"===l.w?null:Ne(e,l.Je,n),N:"else"===l.w?null:C(l.Ze)}),i=[l(t,Ae(t))];for(let e=t.nextSibling;null!==e;e=e.nextSibling){if(3===e.nodeType&&""===e.data.trim()||8===e.nodeType)continue;if(1!==e.nodeType||"template"!==e.localName)break;let t=Ae(e);if(null===t||"elseif"!==t.w&&"else"!==t.w||(i.push(l(e,t)),"else"===t.w))break}return i}var Ce=new WeakSet;function Le(e,t,n,l,i,r,s,u){let a=(t,n)=>{let i=document.createComment(n);return t.replaceWith(i),l&&k.jn?.(e,i,t),i},h=t=>{for(let c=0;c<t.length;c++){let f=t[c];if(null!==f.parentNode)if(1===f.nodeType){let t=f,u=t.localName;if(l){if("script"===u||"style"===u||Ce.has(t))continue;if(Ce.add(t),u===o.tagNames.state){h([...t.childNodes]);continue}}let c="template"===u?Ae(t):null;if(null!==c){if("for"===c.w){let l=Ne(e,c.Je,n),r=Oe(e,t,l,!0);i(a(t,o.commentForPrefix),l,r)}else"if"===c.w?r($e(e,t,n).map((t,l)=>({F:Oe(e,t.el,n,!1),o:t.o,N:t.N,S:a(t.el,Fe(l,t))}))):xe(c.w);continue}let d=t.getAttribute(pe()),m=null===d?null:ke(e,d,n,t,0),p="noscript"!==u&&"iframe"!==u&&!m?.some(Se)&&!k.$o?.(t);try{l&&p&&h([...t.childNodes])}finally{null!==m&&s(t,m)}!l&&p&&h([...t.childNodes])}else if(3===f.nodeType&&e.Mt&&f.data.includes("{{")&&!Ce.has(f))for(let{a:e,cr:t}of je(f))u(e,t);else if(8===f.nodeType){let e=Pe.exec(f.data),t=e&&f.parentNode.localName;if(null!==t&&"textarea"!==t&&"title"!==t){let t=document.createTextNode("");f.replaceWith(t),u(t,e[1])}}}};h(t)}var Pe=/^\s*@@\s*(?:wcs-text)?\s*:\s*([\s\S]+?)\s*$/,De=e=>{let t=document.createRange();return t.selectNodeContents(e),e.content??t.cloneContents()};function Oe(e,t,n,l){let i=document.importNode(De(t),!0),r=[],o=[],s=e=>r.push(e)-1;Le(e,[...i.childNodes],n,!1,(e,t,n)=>{o.push({...ge(),a:s(e),i:6,o:t,F:n})},e=>{let t=e.map(e=>({a:s(e.S),F:e.F,o:e.o,N:e.N}));o.push({...ge(),a:t[0].a,i:7,G:t})},(e,t)=>{let n=s(e);for(let e of t)be(e)&&x(203,[e.name]),e.a=n;o.push(...t),e.removeAttribute(pe())},(t,l)=>{o.push(Ee(e,l,n,s(t)))}),Ie(i,new Set(r),!0);let u=r.map(e=>function(e,t){let n=[];for(let l=t;l!==e;l=l.parentNode){let e=0;for(let t=l.previousSibling;null!==t;t=t.previousSibling)e++;n.unshift(e)}return n}(i,e)),a=1===i.childNodes.length&&8!==i.firstChild.nodeType,h=o.some(e=>6===e.i||7===e.i),c=[],f=new Set,d=[],m=[],p=l?n.n+1:-1;for(let e of o){if(5===e.i&&e.et&&!e.Ee&&!Ke(r[e.a],i)){d.push(e);continue}m.push(e);let t=e.o;if(null!==t&&t.n===p&&t.h[p]===n&&Ue(e)&&(e.A=c.push(e)-1),7===e.i)for(let t of e.G)f.add(t.a);else f.add(e.a)}let g=[...f].sort((e,t)=>e-t);return{sn:i,root:a?i.firstChild:null,On:u,build:g,Re:d,sr:m,In:a,lr:h,ko:[],ze:c}}function Ke(e,t){for(;e.parentNode!==t;e=e.parentNode){if(e.parentNode.localName.includes("-"))return!0;for(let t=e.previousSibling;t;t=t.previousSibling)if(8===t.nodeType)return!0}return!1}function Ue(e){if(null!==e.K)return!1;switch(e.i){case 0:case 2:case 3:case 4:case 8:return!0;case 1:return!e.Ee&&null===e.At;default:return!1}}var Me=new Set(["table","thead","tbody","tfoot","tr","colgroup","select","optgroup","datalist"]);function Ie(e,t,n){for(let l=e.firstChild;null!==l;){let e=l.nextSibling;3===l.nodeType?n&&!t.has(l)&&""===l.data.trim()&&l.remove():1===l.nodeType&&Ie(l,t,Me.has(l.localName)),l=e}}var Re=new WeakMap;function We(e,t){let n=9===t.nodeType?t.body:t;e.root=t,Re.set(t,e),Be(e,[...n.childNodes]),e.He()}function Ge(e,t,n){try{let l="template"===t.localName?Ae(t):null;null!==l&&!n&&x(204,[l.w]),Be(e,[t])}catch(e){console.error(e)}e.He()}function Be(e,t){Le(e,t,null,!0,(t,n,l)=>{new se(e,l,Q(e,n,null,t),t).Et()},t=>{re(e,t,null,null)},(t,n)=>{k.jn?.(e,t,n);for(let l of n)ie(e,l,t,null,null)},(t,n)=>{k.jn?.(e,t,n),ie(e,Ee(e,n,null,0),t,null,null)})}export{F as a,ce as b,K as c,U as d,M as e,I as f,R as g,_ as h,se as i,be as j,Se as k,Ce as l,De as m,Re as n,We as o,Ge as p};
|
|
2
|
-
//# sourceMappingURL=chunk-BMGEWHCR.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as t,d as e,e as i}from"./chunk-ZN52NEIB.js";import{h as s,m as l}from"./chunk-TUQ3OPZQ.js";import{a as n,b as r}from"./chunk-M656SMUU.js";import{a as h,i as o}from"./chunk-4NJBYXIT.js";var u=Symbol.for("wcstack.trustedTypes.policy");function f(){let t=globalThis[u];return null!==t&&"object"==typeof t?t:null}function a(t){globalThis[u]=t}function c(t){return"innerHTML"===t||"outerHTML"===t||"srcdoc"===t}function d(t){if(globalThis.trustedTypes?.isHTML(t))return t;let e=null==t?"":String(t),i=f(),s=i?.createHTML;return"function"==typeof s?s.call(i,e):e}var g=class{constructor(t,e,i){this.ht=null,this.E=null,this.he=null,this.W=null,this.c=null,this.y=!0,this.l=t,this.b=e,this.R=i}},p=class{constructor(t,e){this.C=null,this.f=[],this.E=null,this.L=null,this.te=!1,this.Lt=!1,this.yt=!1,this.o=t,this.ae=e,this.n=t.n+1}},y=[],v=class{constructor(t){this.bt=new Set,this.name=t}get size(){return this.bt.size}subscribe(t){return this.bt.add(t),()=>{this.bt.delete(t)}}unsubscribe(t){return this.bt.delete(t)}emit(...t){let e=[];for(let i of this.bt)try{e.push(i(...t))}catch(t){e.push(void 0),console.error(`[@wcstack/state] ${n(17,[this.name])}`,t)}return e}};function b(t,e,i){if(void 0===t)return[];Array.isArray(t)||r(18,[e]);let s=new Set;for(let l of t)("string"!=typeof l||""===l)&&r(19,[e]),l===i&&r(20,[e,l,i]),s.has(l)&&r(21,[e,l]),s.add(l);return t}var m=Symbol.for("wcstack.transition-runner");function w(t){let e=globalThis[m];return null==e||"wcs-transition-runner"!==e.protocol||"number"!=typeof e.version||e.version<1||"function"!=typeof e.run||"function"!=typeof e.accepts||!e.accepts(t)?null:e}function $(t,e,i){let s=w(t);if(null!==s)return s.run(e,{source:t,types:i});e()}var k=[["$watch","temporal"],["$stream","temporal"],["$listKeys","list-keys"],["$recursion","recursion"]],M=["enableMustache","sameValueGuard","enableDirectionalInitialSync"];function A(t){return t.includes("**")&&l(t),t}var C=0,P=32,S=100;function j(t,e,i){let s=t.get(e);return void 0===s&&t.set(e,s=i()),s}var T=()=>new Set,R=()=>[];function O(t){return null!==t&&"object"==typeof t&&"function"==typeof t.then}function I(t,e){return t===e||t!=t&&e!=e}function L(t,e,i){let s=t.W?.get(e);void 0!==s&&s.delete(i)&&0===s.size&&t.W.delete(e)}function W(t,e){for(let i=0;i<e.length;i++){if(null==t)return;t=t[e[i]]}return t}function Y(t,e){for(;null!==t&&t.l.n>e;)t=t.l.ae;return null!==t&&t.l.n===e?t:null}function q(t,e,i){let s=Y(t,i);return null!==s&&s.l.o===e.h[i]?s:null}var x=class{constructor(t,i){this.Ie=0,this.u=null,this.je=0,this.vt=new Set,this.et=new Map,this.Kn=Symbol("wcs.block"),this.element=null,this.kt=[],this.De=null,this.Un=[],this.Vt=0,this.Y=null,this.oe=new Map,this.ce=new Map,this.Le=[],this.Be=[],this.Me=[],this.St=!1,this.hn=!1,this.Ht=new WeakMap,this._=0,this.Kt=0,this.gn=!1,this.Ut=!1,this.qt=!1,this.Pe=0,this.qn=()=>{this._=0,this.gn=!1},this.zn=()=>{this.Pe--},this.rp=null,this.rr=null,this.Mo=()=>this.zt(),this.Wo=(t,e)=>t(this.proxy,...e),this.Yn=[],this.tt=[],this._o={$untracked:t=>{let e=this.Y;if(null===e)return t();e.ye++;try{return t()}finally{e.ye--}},$eqIndex:(t,e=1)=>{let i=Y(this.u,e);null===i&&r(7,[t]);let s=this.o(t);if(null!==s.getter||s.se)return this.watchIndex(e),i.b===this.read(s,null);let l=this.Y;if(null!==l){let t=l.getter,i=s.Ce??(s.Ce=[]);if(!i.some(i=>i.getter===t&&i.Xn===e)){i.push({getter:t,Xn:e});let l=t.h[e];(l.Ct??(l.Ct=[])).push({source:s,getter:t})}}return i.b===this.v(s,null)},$eq:(t,e)=>this.eq(t,e),$eqPath:(t,e)=>{let i=this.o(e);return this.eq(t,this.v(i,Y(this.u,i.n)))},$dependOn:t=>{this.resolve(A(t),this.u),null!==this.Y&&0===this.Y.ye&&this.Gn(this.rp,this.rr,this.Y)},$getAll:(t,e)=>this.getAll(t,e),$setAll:(t,e,i,s)=>this.yn(t,e,i,s),$resolve:(...t)=>{let e=A(t[0]),i=t[1]??[],s=this.o(e,!0);this.wn("$resolve",e,s,i,!0);let l=this.Qn(s,i,null);if(t.length<3)return this.read(s,l);this.T(s,l,t[2])},$postUpdate:t=>{this.resolve(A(t),this.u);let e=this.rp,i=this.rr;"*"===e.s&&null!==i&&(i.R=i.l.C[i.b],this.P.Yt(i)),this.bn(e,i),null!==i&&this.Jn(i,e,void 0,i.R,!1),0===e.n&&this.Zn(e,void 0,void 0,!0),this.Xt(e,i,void 0,void 0,!1)}},this.P=i,this.I=new e(t=>{this.tt.push(t),this.nt(t)}),this.eo(t);let s=this,l={getOwnPropertyDescriptor(t,e){let i=Reflect.getOwnPropertyDescriptor(s.target,e);return i&&(i.configurable=!0),i},get(t,e,i){let l=s.target;if("symbol"==typeof e)return Reflect.get(l,e);if(36===e.charCodeAt(0))return s.ot(e);if(e.indexOf(".")<0){let t=s.I.jt(e);if(void 0===t||null===t.getter){let t=l[e];if("function"==typeof t)return i===s.proxy&&s.V?.(t)||t}if(void 0!==t&&0===t.n)return s.read(t,null)}return s.resolve(e,s.u),s.read(s.rp,s.rr)},set:(t,e,i)=>"symbol"==typeof e?Reflect.set(s.target,e,i):(s.resolve(A(e),s.u),s.T(s.rp,s.rr,i),!0)};for(let t of["has","ownKeys","deleteProperty","defineProperty","getPrototypeOf"])l[t]=(e,...i)=>Reflect[t](s.target,...i);this.proxy=new Proxy({},l)}o(t,e){let i=this.I.get(t);return e||(i.pn=!0),i}to(t){let e=new Set;for(let i=t;null!==i&&i!==Object.prototype;i=Object.getPrototypeOf(i))for(let t of Object.getOwnPropertyNames(i)){if(e.has(t))continue;e.add(t);let s=Object.getOwnPropertyDescriptor(i,t);if(void 0===s.get&&void 0===s.set)continue;let l=this.o(t);l.getter=s.get??null,l.ie=s.set??null,null!==l.getter&&l.n>0&&(l.A=this.Ie++)}for(let t of this.I.all())this.nt(t)}nt(t){t.t.includes("**")&&l(t.t),("__proto__"===t.s||"prototype"===t.s)&&r(120,[t.t]);let e=t.d;t.se=null!==e&&"*"!==t.s&&e.n===t.n&&(null!==e.getter||e.se),null===t.getter&&this.Vo(t)}Vo(t){let e=t.t,i=t.s;if(s.test(i))t.getter=function(){return this[i]};else{let s=e.split("."),l=s.findIndex((t,e)=>e>0&&t.charCodeAt(0)>=48&&t.charCodeAt(0)<=57);if(l<0||s.indexOf("*",l)>=0)return;t.getter=()=>(this.resolve(e,this.u),this.rp!==t?this.read(this.rp,this.rr):this.read(t.d,this.u)?.[i]),t.ie=s=>{if(this.resolve(e,this.u),this.rp!==t)return this.T(this.rp,this.rr,s);let l=this.read(t.d,this.u);null==l&&r(4,[e,l]),l[i]=s}}t.Wn=!0,t.n>0&&(t.A=this.Ie++)}We(t,e){let i=null===t?this.oe:t.c??=new Map,s=i.get(e);return void 0===s&&i.set(e,s=new p(e,t)),e.pn=!0,this.X(s),s}no(t){try{this.X(t)}catch(e){this.Gt(e,t.o.t,t.E?.S??null,"for")}}X(t){let e=this.v(t.o,t.ae);if(e===t.C)return;this.oo(t);let i=function(t,e,i){let s=Array.isArray(e)?e:y;if(s===t.C)return null;let l=t.f,n=s.length,r=l.length,h=new Array(n),o=0;for(;o<n&&o<r&&l[o].R===s[o];)h[o]=l[o],o++;let u=r-1,f=n-1;for(;u>=o&&f>=o&&l[u].R===s[f];)h[f]=l[u],u--,f--;if(o>u)for(let e=o;e<=f;e++)h[e]=new g(t,e,s[e]);else if(o>f)for(let t=o;t<=u;t++)i.Bt(l[t]);else{let e=u<f?u:f;for(let t=o;t<=e;t++)l[t].R===s[t]&&(h[t]=l[t]);let n=new Map;for(let t=u;t>=o;t--){let i=l[t];if(t<=e&&h[t]===i)continue;let s=n.get(i.R);void 0===s?n.set(i.R,i):Array.isArray(s)?s.push(i):n.set(i.R,[s,i])}for(let e=o;e<=f;e++){if(void 0!==h[e])continue;let i,l=s[e],r=n.get(l);void 0!==r&&(Array.isArray(r)?(i=r.pop(),0===r.length&&n.delete(l)):(i=r,n.delete(l))),h[e]=i??new g(t,e,l)}for(let t of n.values())if(Array.isArray(t))for(let e of t)i.Bt(e);else i.Bt(t)}for(let t=o;t<n;t++){let e=h[t];e.b!==t&&(e.b=t,i.Do(e))}return t.f=h,t.C=s,l}(t,e,this);if(null===i)return;if(t.C===e){let i=j(this.Ht,e,R);if(i.push(t),i.length>1)for(let t of i)t.yt=!0}h.Qt?.(this,t,i),(null!==t.E||null!==t.L)&&!t.te&&(t.te=!0,this.Be.push(t),this.Te());let s=t.o.Ct;if(null!==s)for(let{source:e,getter:l}of s){let s=this.v(e,null),n=i[s],r=t.f[s];n!==r&&(void 0!==n&&n.y&&this.vn(l,n),void 0!==r&&this.vn(l,r))}}Do(t){this.P.Ho(this,t)}Bt(t){t.y=!1;let e=t.W;if(null!==e){for(let t of e)L(t.source,t.key,t.sub);t.W=null}if(null!==t.c)for(let e of t.c.values()){this.oo(e);for(let t of e.f)this.Bt(t)}}oo(t){let e=this.Ht.get(t.C);void 0!==e&&(e.splice(e.indexOf(t)>>>0,1),t.yt=!1,1===e.length&&(e[0].yt=!1))}resolve(t,e){let s=i(t),l=this.rp=this.o(s.o,!0),n=s.indexes;this.rr=0===l.n?null:null===n?q(e,l,l.n):this.Qn(l,n,e,t)}Qn(t,e,i,s){let l=null;for(let n,r=1,h=0;r<=t.n;r++){let o=t.h[r],u=this.We(l,o),f=e[h++];if(f<0)f=q(i,t,r)?.b??-1;else if(s&&u.C===y&&Object(n=this.v(o,l))===n){let e=t.t.split("."),i=o.t.split(".").length;e[i]=s.split(".")[i],t=this.o(e.join("."),!0),r--;continue}if(l=u.f[f]??null,null===l)break}return this.rp=t,l}rt(t,e){return 0===t.n?W(this.target,t.q):null===e?void 0:W(e.R,t.q)}read(t,e){let i=this.Y;if(null!==i&&0===i.ye&&this.Gn(t,e,i),null!==t.getter)return this.P.Ko(this,t,e);if(t.se){let i=this.read(t.d,e);return i?.[t.s]}return null===t.d&&!(t.s in this.target)&&!this.vt.has(t.s)&&"then"!==t.s&&"toJSON"!==t.s&&r(301,[t.t],t.s,Object.keys(this.target)),this.rt(t,e)}v(t,e){let i=this.Y;if(null===i)return this.read(t,e);i.ye++;try{return this.read(t,e)}finally{i.ye--}}Gn(t,e,i){let s=i.getter;t._n(s),0===s.n?t.Z!==i.ue&&(t.Z=i.ue,i.kn.push(t)):t.n>0&&Y(e,Math.min(t.n,s.n))!==Y(i.r,Math.min(t.n,s.n))&&(s.ft??(s.ft=new Set)).add(t)}Uo(t,e){for(let i=0;i<this.Vt;i++){let s=this.Un[i];s.getter===t&&s.r===e&&r(701,[t.t])}this.Vt>=128&&r(801,[t.t]);let i=this.Vt++;this.je++;let s=this.Un[i]??={getter:t,r:e,ye:0,ue:0,kn:[]};s.getter=t,s.r=e,s.ye=0,s.ue=++C,s.kn.length=0;let l=this.Y;this.Y=s;let n=this.u;this.u=e;try{let e=t.getter.call(this.proxy);return 0===t.n&&this.qo(t,s),e}finally{this.je--,this.Vt--,this.Y=l,this.u=n,s.r=null}}qo(t,e){let i=e.ue;for(let t of e.kn)t.Z=i;t.J=t.J.filter(e=>e.Z===i||e.n>0||!e.se&&Array.isArray(null!==e.getter?e.z:this.rt(e,null))||this.io(e,t))}io(t,e){return t.Io(e),this.tt.push(t),!1}zo(){for(let t=this.tt;t.length>0;t=this.tt){this.tt=[];let e=new Set;for(let i of t)if(!(i.pn||i.mn||null===i.d||i.c.length>0||i.M.length>0)&&(null===i.getter||i.Wn&&i.A<0)&&null===i.W){i.mn=!0,this.I.Dt(i),e.add(i.d);for(let t of i.J)this.io(t,i)}for(let t of e)(t.c=t.c.filter(t=>!t.mn)).length||this.tt.push(t)}}watchIndex(t){let e=this.Y;if(null!==e&&0===e.ye){let i=e.getter,s=i.h[t];if(s){let t=s.It??(s.It=[]);t.includes(i)||t.push(i)}}}ot(t){let e=t.charCodeAt(1);if(e>=48&&e<=57){let i=2===t.length?e-48:s.test(t)?+t.slice(1):0;return(i<1||i>128)&&r(1001,[t]),this.watchIndex(i),Y(this.u,i)?.b}let i=this._o[t];if(void 0!==i)return i;switch(t){case"$stateElement":return this.element;case"$command":return this.commands}return h.ot?.(this,t)}eq(t,e){this.resolve(t,this.u);let i=this.rp,s=this.rr;if(null!==i.getter||i.se||i.n>0)return I(this.read(i,s),e);let l=this.Y;return null!==l&&0===l.ye&&this.Yo(i,e,l),I(this.v(i,null),e)}Yo(t,e,i){let s=i.getter,l=i.r,n=null===l?this.Yn:l.W??(l.W=[]);for(let l=0;l<n.length;l++){let r=n[l];if(r.sub.getter===s&&r.source===t){if(I(r.key,e))return void(r.ue=i.ue);r.ue!==i.ue&&(L(t,r.key,r.sub),n.splice(l--,1))}}let r={getter:s,r:l};j(t.W??=new Map,e,T).add(r),n.push({source:t,key:e,sub:r,ue:i.ue})}Zn(t,e,i,s){this.Jt(t,l=>{let n=l.W;if(null===n&&null===l.Ce)return;let r=l===t?[]:l.t.slice(t.t.length+1).split("."),h=W(e,r),o=W(i,r);if(null!==l.Ce&&this.Xo(l,h,o,s),null!==n)for(let t of s?n.keys():[h,o]){let e=n.get(t);if(void 0!==e)for(let i of e)null===i.r||i.r.y?this.P.we(this,i.getter,i.r):L(l,t,i)}})}T(t,e,i,s=!1,l=!1){if(this.je>0&&r(8),l||this.Pe>0?this.Ut=!0:this.qt=!0,h.Ae?.(this,t,e,i,l))return;if(null!==t.ie){try{this.Sn(t.ie,e,[i])}finally{this.Xt(t,e,void 0,void 0,!1)}return}null!==t.getter&&r(2,[t.t]),t.n>0&&null===e&&r(3,[t.t]);let n=t.se?this.v(t,e):this.rt(t,e);if(s||!this.Wt||!Object.is(n,i)||Object(i)===i){if("*"===t.s){let t=e;t.l.C[t.b]=i,t.R=i,this.P.Yt(t)}else{let s=1===t.q.length?0===t.n?this.target:e.R:this.v(t.d,e);null==s&&r(4,[t.t,s]),s[t.s]=i}this.$n(t,e),null!==e&&this.Jn(e,t,n,i),0===t.n&&this.Zn(t,n,i),this.Xt(t,e,n,i,!0)}}so(t){return(this.Ht.get(t.C)??[]).filter(e=>e.C===t.C&&(null===e.ae||e.ae.y))}Jn(e,i,s,l,n=!0){let r=e.l;if(!r.yt&&null===r.o.getter&&!r.o.M.length)return;let h=e.R,o=i.t.slice(r.o.t.length+2),u=(t,i)=>{if(void 0===i||i===e)return;let r=this.o(`${t.o.t}.*${o}`,!0);""===o&&(i.R=l,this.P.Yt(i)),n?this.$n(r,i):this.bn(r,i),this.Xt(r,i,s,l,n)};for(let t of this.so(r))u(t,t.f[e.b]);if(""===o)return;let f=new Set([r.C]),a=t=>Array.isArray(t)&&t.includes(h),c=(e,i)=>{if(!f.has(e)&&f.add(e))for(let t of this.Ht.get(e)??[])for(let e of t.f)e.R===h&&u(t,e);for(let s of i){let i=s.z,l=i===t;l&&(i=this.oe.get(s)?.C),(l||a(i))&&!f.has(s.M)&&f.add(s.M)&&(!l&&i!==e&&this.P.we(this,s,null),c(i,s.M))}},d=t=>{for(let e of t.J)if(!f.has(e)&&f.add(e))if(null!==e.getter)d(e);else if(!e.se){let t=this.rt(e,null);a(t)&&c(t,e.M)}};null!==r.o.getter?d(r.o):c(r.C,r.o.M)}bn(t,e){this.Go(t,e,t=>{this.X(t);for(let e of t.yt?this.so(t):[t]){let t=this.o(`${e.o.t}.*`);for(let i of e.f)this.$t(t,i),this.bn(t,i)}})}$n(t,e){let i=null===e?this.oe:e.c;if(null!==i)for(let e of i.values())e.o.ee(t)&&this.X(e)}Go(t,e,i){let s=null===e?this.oe:e.c;if(null!==s)for(let e of s.values())e.o.ee(t)&&i(e)}Xo(t,e,i,s){for(let{getter:l,Xn:n}of t.Ce)this.lo(l.h[n],t=>{for(let n of s?t.f.keys():[e,i]){let e="number"==typeof n?t.f[n]:void 0;void 0!==e&&this.vn(l,e)}})}vn(t,e){e.l.n===t.n?this.P.we(this,t,e):this.Zt(e,t,e=>this.P.we(this,t,e))}Xt(t,e,i,s,l){h.be?.(this,t,e,i,s,l),this._e(t,e)}_e(t,e){this.P.Qo(this,t,e),this.Te()}ao(t){let e=this.et.get(t);if(void 0!==e)return e;let i=Symbol(`wcs.on${t}`);this.et.set(t,i);let s=this.root,l=this.Kn;return s.addEventListener(t,e=>{for(let n=e.target;null!==n&&n!==s;n=n.parentNode){let s=n[i];if(void 0!==s&&(s(e),e.cancelBubble))return;let r=n[l];if(void 0!==r&&r.y&&r.Jo(t,e))return}}),i}reset(t){let e=this.target,i=this.vt;for(let t of this.I.all())null===t.d&&null!==t.getter&&i.add(t.s);this.eo(t);for(let t in e)"$"!==t[0]&&i.add(t);for(let e of i)e in t&&i.delete(e);for(let t of this.ce.values())for(let e of t)this.en(e);for(let t of this.oe.values())this.co(t);this.De=null;try{this.zt()}finally{this.En()}h.element?.(this,"reset")}eo(t){for(let[e,i]of k)void 0!==t[e]&&o(i,e);let e=t.$features;if(void 0!==e){Array.isArray(e)||r(46);for(let t of e)o(t,"$features")}let i=void 0===t.$behavior?{}:t.$behavior;("object"!=typeof i||!i||Array.isArray(i))&&r(44,["state","$behavior"]);for(let t in i)(!M.includes(t)||"boolean"!=typeof i[t])&&r(44,["$behavior",t]);let[s,l,n]=M.map(t=>i[t]??!0);void 0!==this.target&&(s!==this.Mt||l!==this.Wt||n!==this._t)&&r(45);let u=function(t,e){let i={};for(let s of b(t.$commandTokens,"$commandTokens","$command"))i[s]=e?.[s]??new v(s);return Object.freeze(i)}(t,this.commands),f=function(t,e){let i=new Map;for(let e of b(t.$eventTokens,"$eventTokens"))i.set(e,new v(e));let s=t.$on;if(void 0===s)return i;(null===s||"object"!=typeof s)&&r(22);for(let[t,l]of Object.entries(s)){let s=i.get(t);void 0===s&&r(23,[t]),"function"!=typeof l&&r(24,[t]),s.subscribe((...t)=>e(l,t))}return i}(t,this.Wo);this.Mt=s,this.Wt=l,this._t=n,h.de?.(this,t),this.target=t,this.Ie=0;for(let t of this.I.all())t.jo();this.Yn.length=0,this.to(t),this.commands=u,this.Re=f}co(t){this.no(t);let e=this.o(`${t.o.t}.*`);for(let i of t.f)if(i.ht=null,i.W=null,this.$t(e,i),null!==i.c)for(let t of i.c.values())this.co(t)}H(t){let e=[];for(let i=t;null!==i;i=i.l.ae)e.unshift(i.b);return e}Zo(t,e,i){let s=this.Re.get(t);void 0===s&&r(1301,[t],t,this.Re.keys()),s.emit(e,...this.H(i))}command(t){let e=this.commands[t];return void 0===e&&r(1302,[t],t,Object.keys(this.commands)),e}er(t,e,i){this.command(t).emit(e,...this.H(i))}tr(t,e,i){let s=t.includes(".")?this.v(this.o(t),null):this.target[t];return"function"!=typeof s&&r(5,[t]),this.Sn(s,i,[e,...this.H(i)])}Sn(t,e,i){let s=this.u;this.u=e;try{return t.apply(this.proxy,i)}finally{this.u=s}}$t(t,e){if(null!==t.getter){let i=null===e?this.oe:e.c;if(null!==i)for(let e of i.values())!e.Lt&&e.o.ee(t)&&(e.Lt=!0,this.Me.push(e))}if(null===e)return void this.Jt(t,t=>{let e=this.ce.get(t);if(void 0!==e)for(let t of e)this.en(t)});let i=e.he;if(null!==i)for(let e=0;e<i.length;e++)i[e].o.ee(t)&&this.en(i[e]);let s=e.E;null!==s&&null!==s.fe&&s.uo(this,t);let l=e.l.L;if(null!==l)for(let i of l){let s=i.map.get(e);void 0!==s&&null!==s.fe&&s.uo(this,t)}}Nn(t,e,i){this.Jt(t,t=>{let s=t.M;for(let l=0;l<s.length;l++){let n=s[l];if(0===n.n)this.it(n,null,i);else if(null===e||0===t.n||n.h[1]!==t.h[1]||null!==n.ft&&n.ft.has(t))this.tn(n.h[n.n],t=>this.it(n,t,i));else if(n.n<=t.n){let t=Y(e,n.n);null!==t&&this.it(n,t,i)}else this.Zt(e,n,t=>this.it(n,t,i))}})}it(t,e,i){i(t,e)&&(h.ve?.(this,t,e),this.$t(t,e),this.Nn(t,e,i))}Jt(t,e){e(t);let i=t.c;for(let t=0;t<i.length;t++)this.Jt(i[t],e)}tn(t,e){this.lo(t,t=>{for(let i of t.f)e(i)})}lo(t,e){if(0===t.n){let i=this.oe.get(t);return void(void 0!==i&&e(i))}this.tn(t.h[t.n],i=>{let s=i.c?.get(t);void 0!==s&&e(s)})}Zt(t,e,i){if(t.l.n===e.n)return i(t);let s=t.c?.get(e.h[t.l.n+1]);if(void 0!==s)for(let t of s.f)this.Zt(t,e,i)}nr(t){let e=t.r;null===e?j(this.ce,t.o,T).add(t):(e.he??(e.he=[])).push(t)}xn(t){let e=t.r;if(null===e)return void this.ce.get(t.o)?.delete(t);let i=e.he;e.y&&null!==i&&i.splice(i.indexOf(t)>>>0,1)}en(t){t.te||(t.te=!0,this.Le.push(t),this.Te())}Te(){this.St||(this.St=!0,queueMicrotask(this.Mo))}Rn(){for(let t of this.Le)t.te=!1;for(let t of this.Be)t.te=!1;for(let t of this.Me)t.Lt=!1;this.Le=[],this.Be=[],this.Me=[],this.P.vt(this)}fo(t,e){let i=[...new Set([...this.Le,...this.Be,...this.Me].map(t=>t.o.t))];console.error(`[@wcstack/state] ${n(t)}`,i),h.st?.(this,{type:"state:render-chain-limit",maxDepth:e,paths:i}),this.Rn()}zt(){this.St=!1;let t=this.Kt;this.Kt=0;let e=0;if(!this.Ut||this.qt?this.qn():t>0?e=t:1===(e=++this._)&&setTimeout(this.qn,0),this.Ut=this.qt=!1,e>100)101===e?this.fo(41,100):this.Rn();else{this.hn=!0;try{for(let t=0;this.Le.length>0||this.Be.length>0||this.Me.length>0;t++){if(t>=32){this.gn?this.Rn():this.fo(11,32),this.gn=!0;break}let i=this.Me;if(i.length>0){this.Me=[];for(let t of i)t.Lt=!1,this.no(t)}let s=this.Be,l=this.Le;this.Be=[],this.Le=[];let n=$("state",()=>{for(let t of s){t.te=!1;for(let e of[t.E,...t.L??[]])if(null!==e&&e.y)try{e.Et()}catch(i){this.Gt(i,t.o.t,e.S,"for")}}for(let t=0;t<l.length;t++){let e=l[t];e.te&&(e.te=!1,(null===e.Pn||e.Pn.y)&&this.Ve(e))}this.hn||(this.He(),this.St&&(this.Kt=e+1))});void 0!==n&&n.then(void 0,t=>console.error(t))}}finally{this.hn=!1}this.Ut=this.qt=!1,this.He(),h.Fe?.(this),this.zo(),t>0&&this.St&&(this.Kt=e+1)}}Nt(t,e){this.kt.push([t,e])}Gt(t,e,i,s){this.Nt(t,{o:{t:e},a:i,nn:()=>s})}Ve(t){try{t.apply()}catch(e){return void this.kt.push([e,t])}null!==this.De&&this.po(t.o,t.r)}po(t,e){let i=j(this.De,t.t,R);null!==e&&i.push(this.H(e))}En(){this.De="function"==typeof this.target.$renderedCallback?new Map:null}He(){let t=this.De;if(null!==t&&t.size>0){this.De=new Map;let e,i=[...t.keys()],s={};for(let[e,i]of t)i.length>0&&(s[e]=i);this.Pe++;try{e=this.ke("$renderedCallback",[i,s])}catch(t){console.error(t)}O(e)?e.then(this.zn,t=>{this.zn(),console.error(t)}):this.Pe--}if(0===this.kt.length)return;let e=this.kt;this.kt=[];let i=this.target.$errorCallback;for(let[t,s]of e){h.Ke?.(this,t,s);let e=s.o.t,l=s.nn();if("function"==typeof i)try{let i=this.ke("$errorCallback",[t,{path:e,bindingType:l,node:s.a}]);O(i)&&i.then(void 0,t=>console.error(t))}catch(t){console.error(t)}else console.error(`[@wcstack/state] ${n(12,[l,e])}`,t)}}ke(t,e=[]){let i=this.target[t];return"function"==typeof i?this.Sn(i,null,e):void 0}mo(t,e,i){if(0===t.n)return void i(null,[]);let s=[],l=(n,r)=>{let h=t.h[n];this.read(h,r);let o=this.We(r,h),u=e=>{s.push(e.b),n===t.n?i(e,s):l(n+1,e),s.pop()};for(let t of n-1<e.length?[o.f[e[n-1]]]:o.f)void 0!==t&&u(t)};l(1,null)}getAll(t,e){let i=this.o(t,!0);void 0!==e&&this.wn("$getAll",t,i,e,!1);let s=e;if(void 0===s){s=[];let e=this.u;if(null!==e&&i.n>0){for(let t=1;t<=i.n;t++){let l=q(e,i,t);if(null===l)break;s.push(l.b)}0===s.length&&r(6,[t])}}let l=[];return this.mo(i,s,t=>l.push(this.read(i,t))),l}yn(t,e,i,s){Array.isArray(e)||r(9,[t]),this.je>0&&r(8);let l=this.o(t,!0);this.wn("$setAll",t,l,e,!1);let n=[];this.mo(l,e,(t,e)=>n.push([t,e.slice()]));let h=!0===s?.spread;h&&(!Array.isArray(i)||i.length!==n.length)&&r(10,[t,n.length]);let o=0;for(let t=0;t<n.length;t++){let[e,s]=n[t],r="function"==typeof i?i(this.v(l,e),...s):h?i[t]:i;void 0!==r&&(this.T(l,e,r),o++)}return o}wn(t,e,i,s,l){let n=s.length;(n>i.n||l&&n<i.n)&&r(l?901:902,[t,e,i.n,n])}};export{w as a,P as b,S as c,O as d,Y as e,x as f,u as g,f as h,a as i,c as j,d as k};
|
|
2
|
-
//# sourceMappingURL=chunk-EM3Y3SJS.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TRUSTED_TYPES_POLICY_SLOT","Symbol","for","getTrustedTypesPolicy","value","globalThis","setTrustedTypesPolicy","policy","isHtmlSink","prop","trustHtml","trustedTypes","isHTML","s","String","create","createHTML","call","StateRow","constructor","list","index","item","this","cache","view","bindings","eqSubs","children","alive","StateList","pattern","parentRow","arr","rows","extra","queued","stale","shared","depth","EMPTY","Token","name","subscribers","Set","size","subscribe","fn","add","delete","unsubscribe","emit","args","results","push","error","console","text","readNames","key","reserved","Array","isArray","raise","seen","has","TRANSITION_RUNNER_KEY","getTransitionRunner","source","candidate","protocol","version","run","accepts","runTransition","mutate","types","runner","DECLARATIONS","BEHAVIOR_KEYS","unbound","path","includes","recursionUnsupported","evals","MAX_DRAIN_PASSES","MAX_RENDER_CHAIN","upsert","m","k","make","v","get","set","newSet","newArray","isThenable","r","then","sameValueZero","a","b","unsubEq","sub","dig","segs","i","length","rowAt","row","ctxRow","ctx","p","lists","Engine","target","strategy","slotCount","readonlyDepth","dropped","delegated","Map","blockKey","element","errors","rendered","frames","depthNow","top","rootLists","rootBindings","queue","dirtyLists","staleLists","scheduled","draining","listsByArray","WeakMap","chain","carried","unsettled","fedBack","codeWrote","feeding","unchainFn","renderedFn","rp","rr","drainFn","drain","deliverFn","handler","proxy","rootEqSubs","loose","api","$untracked","f","untracked","$eqIndex","level","getter","underGetter","watchIndex","read","g","watchers","eqIndexWatchers","some","w","listP","eqIndexKeys","readUntracked","$eq","eq","$eqPath","keyPath","kp","$dependOn","resolve","track","$getAll","indexes","getAll","$setAll","options","setAll","$resolve","checkArity","rowOf","write","$postUpdate","last","resetRow","touched","mirror","rekeyEqUnder","landed","patterns","PatternTable","onPatternCreated","loadTarget","engine","getOwnPropertyDescriptor","_t","d","Reflect","configurable","receiver","t","charCodeAt","dollar","indexOf","peek","bound","trap","Proxy","pinned","registerAccessors","o","Object","prototype","getPrototypeOf","getOwnPropertyNames","setter","slot","all","parent","markupAccessor","INDEX_PARAM","test","split","findIndex","j","markup","childList","l","sync","trySync","failAt","anchor","unfile","old","next","hooks","n","start","oe","ne","rowRemoved","end","byItem","pop","values","indexChanged","reconcile","same","x","listSynced","schedule","keys","sel","before","after","invalidateUnder","onIndexChange","subs","e","was","splice","parsed","parsePath","idx","join","readData","tail","readGetter","addDependent","mark","epoch","reads","Math","min","crossSources","evalGetter","frame","outer","prev","prune","sources","filter","rootValue","unlink","dropDependent","sweep","c","parents","dead","dependents","drop","q","indexWatchers","slice","commands","subscribeEq","forSubtree","map","rest","rekeyEqIndex","invalidate","occurrence","beforeWrite","callAt","guard","is","syncListsUnder","sharing","direct","suffix","land","mp","down","deps","DIRTY","up","forListsUnder","enqueueBound","ls","isUnder","forAllLists","forRowsUnder","written","changed","onWrite","delegate","type","known","root","addEventListener","parentNode","cancelBubble","block","dispatch","reset","bs","enqueue","resetList","watchRendered","feature","requireFeature","$features","$behavior","mustache","directional","ns","$commandTokens","freeze","commandNamespace","events","deliver","tokens","$eventTokens","on","$on","entries","token","eventTokens","declare","forget","indexesOf","out","unshift","fireEventToken","event","command","emitCommand","invoke","apply","slots","enqueueSlots","fv","rv","walkDependents","visit","visitGetter","forAllRows","getterReached","register","unregister","queueMicrotask","dropWork","cutLoop","id","max","paths","noticed","maxDepth","setTimeout","pass","pending","update","owner","applyBinding","report","drained","fail","node","typeName","noteRendered","$renderedCallback","callHook","hook","$errorCallback","binding","failed","bindingType","forMatches","walk","lp","targets","spread","exact","et","G","I","J","Z","H","Q","lt","ut","at"],"sources":["../../../src/trustedTypes.ts","../../../src/list.ts","../../../src/token.ts","../../../src/protocol/transitionRunner.ts","../../../src/engine.ts"],"sourcesContent":["/**\n * Trusted Types for the HTML sinks (`html:`, `innerHTML:`, `outerHTML:`, `srcdoc:`).\n * The policy lives on the same global slot as @wcstack/state, so a page that installed\n * one for the current engine keeps working:\n * globalThis[Symbol.for(\"wcstack.trustedTypes.policy\")] = trustedTypes.createPolicy(…)\n * No identity policy is ever created here — that would defeat the CSP.\n */\nexport interface TrustedTypesPolicy {\n createHTML?(input: string): unknown;\n}\n\nexport const TRUSTED_TYPES_POLICY_SLOT = Symbol.for(\"wcstack.trustedTypes.policy\");\n\ntype Slot = { [key: symbol]: unknown };\n\nexport function getTrustedTypesPolicy(): TrustedTypesPolicy | null {\n const value = (globalThis as Slot)[TRUSTED_TYPES_POLICY_SLOT];\n return value !== null && typeof value === \"object\" ? (value as TrustedTypesPolicy) : null;\n}\n\nexport function setTrustedTypesPolicy(policy: TrustedTypesPolicy | null): void {\n (globalThis as Slot)[TRUSTED_TYPES_POLICY_SLOT] = policy;\n}\n\nexport function isHtmlSink(prop: string): boolean {\n return prop === \"innerHTML\" || prop === \"outerHTML\" || prop === \"srcdoc\";\n}\n\n/**\n * A value for an HTML sink: a TrustedHTML (the page made it with its own policy) as it is, anything\n * else — an array or another object too, which the sink would turn into markup — as a string\n * (null / undefined: empty) passed through the installed policy (if any).\n */\nexport function trustHtml(value: unknown): unknown {\n if ((globalThis as any).trustedTypes?.isHTML(value)) return value;\n const s = value == null ? \"\" : String(value);\n const policy = getTrustedTypesPolicy();\n const create = policy?.createHTML;\n return typeof create === \"function\" ? create.call(policy, s) : s;\n}\n","import type { Pattern } from \"./pattern\";\nimport type { Binding, ForView, RowView } from \"./dom/view\";\n\n/**\n * One element of a list, owned by its StateList. The row is the whole address of\n * everything under `list.*`: the value (`item`), the position (`index`), the getter\n * cache and the bindings that render it hang off this object — no ledger keyed by an\n * address. Dropping the row drops all of it.\n */\nexport class StateRow {\n readonly list: StateList;\n index: number;\n item: unknown;\n /** Getter cache by slot (row-level getters of this engine). */\n cache: unknown[] | null = null;\n /** The rendering of this row by its list's first for view (see StateList.extra for the others). */\n view: RowView | null = null;\n /**\n * Binding objects whose location is in this row (pattern depth = this row's depth), wherever\n * they render. Row views' slot bindings are not here: they are reached through the views.\n */\n bindings: Binding[] | null = null;\n /** `$eq` subscriptions of getters evaluated at this row (dropped with the row). */\n eqSubs: import(\"./engine\").EqEntry[] | null = null;\n /** Nested lists under this row, by list pattern. */\n children: Map<Pattern, StateList> | null = null;\n alive = true;\n\n constructor(list: StateList, index: number, item: unknown) {\n this.list = list;\n this.index = index;\n this.item = item;\n }\n}\n\nexport class StateList {\n readonly pattern: Pattern;\n readonly parentRow: StateRow | null;\n /** Depth of this list's rows (1 for a root list). */\n readonly depth: number;\n /** The array the rows were last reconciled against. */\n arr: unknown[] | null = null;\n rows: StateRow[] = [];\n /** The first for view that renders this list, if any (its row views are on row.view). */\n view: ForView | null = null;\n /** Further for views rendering the same list (each keeps its row views by row). */\n extra: ForView[] | null = null;\n /** Queued for a view update in the current drain. */\n queued = false;\n /** Its pattern reads through a getter that changed: re-synced at the next drain pass. */\n stale = false;\n /** Another list has the same array (a getter returning it, an index path): writes reach both. */\n shared = false;\n\n constructor(pattern: Pattern, parentRow: StateRow | null) {\n this.pattern = pattern;\n this.parentRow = parentRow;\n this.depth = pattern.depth + 1;\n }\n}\n\nexport interface ReconcileHooks {\n /** A kept row changed position. */\n indexChanged(row: StateRow): void;\n /** A row left the list (it marks it dead). */\n rowRemoved(row: StateRow): void;\n}\n\ntype Bucket = StateRow | StateRow[];\n\n/**\n * Brings `list.rows` in line with `next`, reusing rows by item identity.\n * Returns the previous rows (for $eqIndex re-keying) or null when nothing changed.\n * DOM is not touched here; the list's view catches up in the drain.\n */\nexport function reconcile(list: StateList, next: unknown, hooks: ReconcileHooks): StateRow[] | null {\n const arr = Array.isArray(next) ? next : EMPTY;\n if (arr === list.arr) return null;\n const old = list.rows;\n const n = arr.length;\n const o = old.length;\n const rows: StateRow[] = new Array(n);\n\n let start = 0;\n while (start < n && start < o && old[start].item === arr[start]) {\n rows[start] = old[start];\n start++;\n }\n let oe = o - 1;\n let ne = n - 1;\n while (oe >= start && ne >= start && old[oe].item === arr[ne]) {\n rows[ne] = old[oe];\n oe--;\n ne--;\n }\n\n if (start > oe) {\n for (let i = start; i <= ne; i++) rows[i] = new StateRow(list, i, arr[i]);\n } else if (start > ne) {\n for (let i = start; i <= oe; i++) hooks.rowRemoved(old[i]);\n } else {\n // a row whose item is where it was keeps its place: among equal items (a board of 0 / 1), handing\n // the rows out in order would move every one after the first change\n const end = oe < ne ? oe : ne;\n for (let i = start; i <= end; i++) if (old[i].item === arr[i]) rows[i] = old[i];\n const byItem = new Map<unknown, Bucket>();\n // filled from the end, so a bucket hands out its first row with pop(): shift() moves the whole\n // array, and over a long run of equal items the reconcile went quadratic\n for (let i = oe; i >= start; i--) {\n const row = old[i];\n if (i <= end && rows[i] === row) continue;\n const b = byItem.get(row.item);\n if (b === undefined) byItem.set(row.item, row);\n else if (Array.isArray(b)) b.push(row);\n else byItem.set(row.item, [b, row]);\n }\n for (let i = start; i <= ne; i++) {\n if (rows[i] !== undefined) continue;\n const item = arr[i];\n const b = byItem.get(item);\n let row: StateRow | undefined;\n if (b !== undefined) {\n if (Array.isArray(b)) {\n row = b.pop();\n if (b.length === 0) byItem.delete(item);\n } else {\n row = b;\n byItem.delete(item);\n }\n }\n rows[i] = row ?? new StateRow(list, i, item);\n }\n for (const b of byItem.values()) {\n if (Array.isArray(b)) for (const r of b) hooks.rowRemoved(r);\n else hooks.rowRemoved(b);\n }\n }\n\n // positions: only rows from `start` on can have moved\n for (let i = start; i < n; i++) {\n const row = rows[i];\n if (row.index !== i) {\n row.index = i;\n hooks.indexChanged(row);\n }\n }\n list.rows = rows;\n list.arr = arr;\n return old;\n}\n\n/** What a list whose value is not an array reconciles against (engine: an index there is a key). */\nexport const EMPTY: unknown[] = [];\n","/**\n * The command-token / event-token pub/sub primitive (the same shape as @wcstack/state's\n * `Token`). A subscriber that throws is reported and the others still receive the call.\n */\nimport { raise, M, text } from \"./messages\";\n\nexport type TokenSubscriber = (...args: unknown[]) => unknown;\n\nexport class Token {\n readonly name: string;\n private readonly subscribers = new Set<TokenSubscriber>();\n\n constructor(name: string) {\n this.name = name;\n }\n\n get size(): number {\n return this.subscribers.size;\n }\n\n subscribe(fn: TokenSubscriber): () => void {\n this.subscribers.add(fn);\n return () => {\n this.subscribers.delete(fn);\n };\n }\n\n unsubscribe(fn: TokenSubscriber): boolean {\n return this.subscribers.delete(fn);\n }\n\n emit(...args: unknown[]): unknown[] {\n const results: unknown[] = [];\n for (const fn of this.subscribers) {\n try {\n results.push(fn(...args));\n } catch (error) {\n results.push(undefined);\n console.error(`[@wcstack/state] ${text(M.TokenSubscriberThrew, [this.name])}`, error);\n }\n }\n return results;\n }\n}\n\nfunction readNames(value: unknown, key: string, reserved?: string): string[] {\n if (value === undefined) return [];\n if (!Array.isArray(value)) raise(M.TokenListNotArray, [key]);\n const seen = new Set<string>();\n for (const name of value) {\n if (typeof name !== \"string\" || name === \"\") raise(M.TokenEntryEmpty, [key]);\n if (name === reserved) raise(M.TokenEntryReserved, [key, name, reserved]);\n if (seen.has(name)) raise(M.TokenEntryDuplicated, [key, name]);\n seen.add(name);\n }\n return value as string[];\n}\n\n/**\n * `$commandTokens` → the frozen `$command` namespace (name → Token). On a re-set, a name\n * the previous state declared keeps its token: elements subscribed to it keep receiving.\n */\nexport function commandNamespace(target: Record<string, any>, prev?: Readonly<Record<string, Token>>): Readonly<Record<string, Token>> {\n const ns: Record<string, Token> = {};\n for (const name of readNames(target.$commandTokens, \"$commandTokens\", \"$command\")) ns[name] = prev?.[name] ?? new Token(name);\n return Object.freeze(ns);\n}\n\n/**\n * `$eventTokens` + `$on` → name → Token, with each `$on` handler subscribed as\n * `(state, event, ...listIndexes)` through `deliver`.\n */\nexport function eventTokens(\n target: Record<string, any>,\n deliver: (handler: (...args: unknown[]) => unknown, args: unknown[]) => unknown,\n): Map<string, Token> {\n const tokens = new Map<string, Token>();\n for (const name of readNames(target.$eventTokens, \"$eventTokens\")) tokens.set(name, new Token(name));\n const on = target.$on;\n if (on === undefined) return tokens;\n if (on === null || typeof on !== \"object\") raise(M.OnNotObject);\n for (const [name, handler] of Object.entries(on)) {\n const token = tokens.get(name);\n if (token === undefined) raise(M.OnEntryUndeclared, [name]);\n if (typeof handler !== \"function\") raise(M.OnEntryNotFunction, [name]);\n token.subscribe((...args) => deliver(handler as (...a: unknown[]) => unknown, args));\n }\n return tokens;\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/transition-runner.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n// transition-runner protocol — how a package that mutates the DOM hands that\n// mutation to whoever is arbitrating view transitions on the page.\n//\n// @wcstack/state and @wcstack/router must not depend on @wcstack/view-transition\n// (zero runtime dependencies, independently publishable), so the arbiter installs\n// itself on a well-known global symbol and the participants look it up lazily.\n// No arbiter installed means the mutation is invoked directly, synchronously —\n// byte-for-byte the behavior these packages had before the protocol existed.\n//\n// docs/view-transition-design.md §4 is the normative description.\n//\n// SINGLE SOURCE OF TRUTH: edit only this file (/protocol/transition-runner.ts), then run\n// `node scripts/sync-protocol-types.mjs` to regenerate the per-package copies\n// (packages/<pkg>/src/protocol/transitionRunner.ts). Those copies are generated — do not edit them.\n\n/**\n * Global key the arbiter installs itself under. `Symbol.for` so independently\n * loaded copies of this file (two CDN bundles on one page) still agree.\n */\nexport const TRANSITION_RUNNER_KEY = Symbol.for(\"wcstack.transition-runner\");\n\n/** Who is asking. Backs the arbiter's `for=` participant gate. */\nexport type TransitionSource = \"router\" | \"state\";\n\n/** `view-transition-name` assignment policy the arbiter declares for participants. */\nexport type TransitionNaming = \"manual\" | \"auto\";\n\nexport interface IWcsTransitionRunOptions {\n /** Participant id, for the `for=` gate and for diagnostics. */\n readonly source?: string;\n /** Transition types, where the environment supports `startViewTransition({ types })`. */\n readonly types?: readonly string[];\n}\n\nexport interface IWcsTransitionRunner {\n readonly protocol: \"wcs-transition-runner\";\n /** Integer protocol version. All versions >= 1 are participant-compatible. */\n readonly version: number;\n /** `\"auto\"` licenses a participant to assign `view-transition-name` itself. */\n readonly naming: TransitionNaming;\n /** Upper bound on auto-assigned names; past it a participant stops naming. */\n readonly namingLimit: number;\n /** Whether this participant animates at all. */\n accepts(source: string): boolean;\n /**\n * Invoke `mutate` inside a view transition when one is possible.\n *\n * Contract (docs/view-transition-design.md §4):\n * - `mutate` is invoked exactly once, whatever happens to the transition.\n * - The promise resolves once `mutate` has run — never waits for the animation.\n * - When no transition is started, `mutate` runs synchronously inside `run()`.\n * - It rejects only if `mutate` threw.\n */\n run(mutate: () => void, options?: IWcsTransitionRunOptions): Promise<void>;\n}\n\n/**\n * The installed arbiter, or null when there is none, it speaks a version this\n * reader does not, or it does not accept this participant.\n *\n * Looked up on every call rather than cached: the tag can be added, removed, or\n * reconfigured at any point in a page's life, and a stale cache would either\n * animate what the author just switched off or miss what they switched on.\n */\nexport function getTransitionRunner(source: string): IWcsTransitionRunner | null {\n const candidate = (globalThis as Record<symbol, unknown>)[TRANSITION_RUNNER_KEY] as\n | IWcsTransitionRunner\n | undefined;\n if (candidate === undefined || candidate === null) return null;\n if (candidate.protocol !== \"wcs-transition-runner\") return null;\n if (typeof candidate.version !== \"number\" || candidate.version < 1) return null;\n if (typeof candidate.run !== \"function\") return null;\n if (typeof candidate.accepts !== \"function\" || !candidate.accepts(source)) return null;\n return candidate;\n}\n\n/**\n * Run `mutate` under the installed arbiter, or directly when there is none.\n *\n * Returns `undefined` in the no-arbiter case instead of a resolved promise: the\n * state drain calls this on every batch, and awaiting is a caller's choice, not\n * an allocation the common path should pay for. `await` accepts both.\n */\nexport function runTransition(\n source: string,\n mutate: () => void,\n types?: readonly string[],\n): Promise<void> | undefined {\n const runner = getTransitionRunner(source);\n if (runner === null) {\n mutate();\n return undefined;\n }\n return runner.run(mutate, { source, types });\n}\n","import { DIRTY, Pattern, PatternTable, parsePath, WILDCARD, type EqSub } from \"./pattern\";\nimport { StateList, StateRow, reconcile, EMPTY, type ReconcileHooks } from \"./list\";\nimport type { Strategy } from \"./strategy/types\";\nimport type { Binding } from \"./dom/view\";\nimport { commandNamespace, eventTokens, type Token } from \"./token\";\nimport { runTransition } from \"./protocol/transitionRunner\";\nimport { raise, M, text } from \"./messages\";\nimport { recursionUnsupported } from \"./parser/parseStatePart\";\nimport { hooks, requireFeature } from \"./hooks\";\nimport { INDEX_PARAM, MAX_INDEX_PARAM } from \"./parser/define\";\n\n/** Declarations an add-on serves: without it installed they fail instead of doing nothing. */\nconst DECLARATIONS: [string, string][] = [[\"$watch\", \"temporal\"], [\"$stream\", \"temporal\"], [\"$listKeys\", \"list-keys\"], [\"$recursion\", \"recursion\"]];\n\n/**\n * The options of `$behavior` (each true by default): what an engine reads them as is `mustache` / `guard` / `directional`.\n * The tooling manifest publishes the same list (`behaviorOptions`, public/manifest.ts — public-surface.test.ts pins\n * them equal; the manifest does not import the engine).\n */\nexport const BEHAVIOR_KEYS: readonly string[] = [\"enableMustache\", \"sameValueGuard\", \"enableDirectionalInitialSync\"];\n\n/** `**` binds a depth only where a path is read: an assignment, $resolve, $postUpdate and $dependOn refuse it. */\nfunction unbound(path: string): string {\n if (path.includes(\"**\")) recursionUnsupported(path);\n return path;\n}\n\n/** `$1` … `$128`, no leading zero (parser/define.ts — the tooling manifest reads them there too). */\nexport { INDEX_PARAM, MAX_INDEX_PARAM };\n\ninterface Frame {\n getter: Pattern;\n row: StateRow | null;\n untracked: number;\n /** The evaluation this frame runs (`$eq` tells its keys from an earlier evaluation's). */\n epoch: number;\n /** What a root getter's evaluation read (Engine.prune). */\n reads: Pattern[];\n}\n\n/** Getter evaluations so far (each frame takes the next: an evaluation's identity). */\nlet evals = 0;\n\n/** A `$eq` subscription of a getter occurrence, kept on its row (or the engine, at the root). */\nexport interface EqEntry {\n source: Pattern;\n key: unknown;\n sub: EqSub;\n epoch: number;\n}\n\n/** A drain that keeps producing work this many times in a row is an update loop. */\nexport const MAX_DRAIN_PASSES = 32;\n/**\n * Drains in a row that rendering itself started (an element's write-back, a write in\n * `$renderedCallback`) beyond this many are an update loop (as @wcstack/state 3.3.x).\n */\nexport const MAX_RENDER_CHAIN = 100;\n/** Nested getter evaluations deeper than this are a runaway chain. */\nconst MAX_GETTER_DEPTH = 128;\n\nexport type Visit = (getter: Pattern, row: StateRow | null) => boolean;\n\n/** The value of `k` in `m`, made and set first when there is none (`make`: a shared factory, not a closure per call). */\nfunction upsert<K, V>(m: { get(k: K): V | undefined; set(k: K, v: V): unknown }, k: K, make: () => V): V {\n let v = m.get(k);\n if (v === undefined) m.set(k, (v = make()));\n return v;\n}\nconst newSet = <T>(): Set<T> => new Set<T>();\nconst newArray = <T>(): T[] => [];\n\n/** A promise, or anything with a then(). */\nexport function isThenable(r: any): r is PromiseLike<unknown> {\n return r !== null && typeof r === \"object\" && typeof r.then === \"function\";\n}\n\n/** Map-key equality: Object.is, except +0 and -0 are equal (keys of a Map). */\nfunction sameValueZero(a: unknown, b: unknown): boolean {\n return a === b || (a !== a && b !== b);\n}\n\n/** Drops a `$eq` subscription; a key nobody waits for any more leaves the map (it may be a row's item). */\nfunction unsubEq(source: Pattern, key: unknown, sub: EqSub): void {\n const set = source.eqSubs?.get(key);\n if (set !== undefined && set.delete(sub) && set.size === 0) source.eqSubs!.delete(key);\n}\n\nfunction dig(v: any, segs: readonly string[]): unknown {\n for (let i = 0; i < segs.length; i++) {\n if (v == null) return undefined;\n v = v[segs[i]];\n }\n return v;\n}\n\n/** The row at `depth` on the chain of `row` (itself or an ancestor), or null. */\nexport function rowAt(row: StateRow | null, depth: number): StateRow | null {\n while (row !== null && row.list.depth > depth) row = row.list.parentRow;\n return row !== null && row.list.depth === depth ? row : null;\n}\n\n/** The context row of `p`'s list at depth `k` — null when the context is a row of another list. */\nfunction ctxRow(ctx: StateRow | null, p: Pattern, k: number): StateRow | null {\n const r = rowAt(ctx, k);\n return r !== null && r.list.pattern === p.lists[k] ? r : null;\n}\n\n/**\n * One engine per <wcs-state>. It owns everything reachable from its state: the\n * patterns, the lists and their rows, the bindings, the update queue. Nothing is keyed\n * by the state element, because nothing is shared between engines.\n */\nexport class Engine implements ReconcileHooks {\n target!: Record<string, any>;\n /** `$behavior` (fixed at construction): `{{ }}` text, the same-value guard, direction-aware initial sync. */\n mustache!: boolean;\n guard!: boolean;\n directional!: boolean;\n readonly patterns: PatternTable;\n readonly strategy: Strategy;\n readonly proxy: Record<string, any>;\n /** Number of row-level getter slots. */\n slotCount = 0;\n /** Evaluation context: the row a getter / method / setter runs for. */\n ctx: StateRow | null = null;\n /** Writes throw while > 0: a readonly createState callback, or a getter being evaluated. */\n readonlyDepth = 0;\n /**\n * Top-level keys a re-set dropped (the old state had them, the new one lacks them): they read as\n * undefined, not as keys never declared (read; the diagnostics add-on reads it too). Kept here — the\n * author's state object is not written to (it may be frozen, or a Proxy that refuses).\n */\n readonly dropped = new Set<string>();\n /** The node the bindings were mounted on (delegated listeners live here); none before the mount. */\n root?: Node;\n /** Delegated event types → the property (per engine) their element handlers are stored under. */\n private readonly delegated = new Map<string, symbol>();\n /** Property (per engine) on a block's top node(s) holding the block, for delegated events. */\n readonly blockKey = Symbol(\"wcs.block\");\n /** The <wcs-state> element (`this.$stateElement`). */\n element: unknown = null;\n /**\n * A mounted component's (scopes add-on): a function read off the proxy itself, made to run on it\n * when called detached — the proxy is `element.state`, and `const { toggle } = element.state`\n * works (3.x #331). Undefined (or no answer): as it is.\n */\n declare bound?: (fn: (...args: any[]) => unknown) => unknown;\n /** `$command`: the command tokens declared in `$commandTokens`. */\n commands!: Readonly<Record<string, Token>>;\n /** The event tokens declared in `$eventTokens`, with the `$on` handlers subscribed. */\n events!: Map<string, Token>;\n /** Binding failures of the current drain, reported after it (`$errorCallback` or console). */\n private errors: [unknown, Binding][] = [];\n /** Paths applied in the current drain, for `$renderedCallback` (collected only when declared). */\n rendered: Map<string, number[][]> | null = null;\n private frames: Frame[] = [];\n private depthNow = 0;\n private top: Frame | null = null;\n readonly rootLists = new Map<Pattern, StateList>();\n readonly rootBindings = new Map<Pattern, Set<Binding>>();\n private queue: Binding[] = [];\n private dirtyLists: StateList[] = [];\n /** Lists over a changed getter, re-synced at the start of the next drain pass. */\n private staleLists: StateList[] = [];\n private scheduled = false;\n private draining = false;\n /** The lists over each array (only while more than one list has it do writes mirror). */\n private readonly listsByArray = new WeakMap<unknown[], StateList[]>();\n /** Drains in a row that rendering started (MAX_RENDER_CHAIN); a pause between tasks ends it. */\n private chain = 0;\n /**\n * For the drain the write-backs of an apply an arbiter deferred start: its place in that apply's\n * chain (0: none). The pause before the apply ends the task's chain, not this one. Only what the\n * apply writes synchronously is carried: an async `$renderedCallback` writing after an `await`\n * starts a task chain again, so such a loop runs one lap per arbiter task and is never cut.\n */\n private carried = 0;\n /** This chain was reported as not settling within a drain (#11): reported once a chain. */\n private unsettled = false;\n /** Since the last drain started: a write rendering fed back / a write from code (which ends a chain). */\n private fedBack = false;\n private codeWrote = false;\n /**\n * Inside `$renderedCallback` (until an async one settles) or a `$watch` handler: its writes are\n * reactions, fed back like an element's (MAX_RENDER_CHAIN).\n */\n feeding = 0;\n private readonly unchainFn = () => {\n this.chain = 0;\n this.unsettled = false;\n };\n private readonly renderedFn = () => {\n this.feeding--;\n };\n // out-parameters of resolve()\n private rp: Pattern | null = null;\n private rr: StateRow | null = null;\n\n private readonly drainFn = () => this.drain();\n private readonly deliverFn = (handler: (...a: unknown[]) => unknown, args: unknown[]) => handler(this.proxy, ...args);\n /** `$eq` subscriptions of root-level getters. */\n private readonly rootEqSubs: EqEntry[] = [];\n /** Patterns made, or no longer read by a root getter, since the last sweep: what it looks at. */\n private loose: Pattern[] = [];\n /** The `$` functions of the state (`this.$eq`, …), by name. */\n private readonly api: Record<string, unknown> = {\n $untracked: (fn: () => unknown) => {\n const f = this.top;\n if (f === null) return fn();\n f.untracked++;\n try {\n return fn();\n } finally {\n f.untracked--;\n }\n },\n $eqIndex: (path: string, level = 1) => {\n const row = rowAt(this.ctx, level);\n if (row === null) raise(M.EqIndexNoRow, [path]);\n const source = this.pattern(path);\n // a getter (or a path under one) changes without a write: an ordinary tracked read, and the\n // row's index is read as `$1` reads it (a moved row compares again)\n if (source.getter !== null || source.underGetter) {\n this.watchIndex(level);\n return row.index === this.read(source, null);\n }\n const f = this.top;\n if (f !== null) {\n const g = f.getter;\n const watchers = source.eqIndexWatchers ?? (source.eqIndexWatchers = []);\n if (!watchers.some((w) => w.getter === g && w.level === level)) {\n watchers.push({ getter: g, level });\n const listP = g.lists[level]!;\n (listP.eqIndexKeys ?? (listP.eqIndexKeys = [])).push({ source, getter: g });\n }\n }\n return row.index === this.readUntracked(source, null);\n },\n $eq: (path: string, key: unknown) => this.eq(path, key),\n $eqPath: (path: string, keyPath: string) => {\n const kp = this.pattern(keyPath);\n return this.eq(path, this.readUntracked(kp, rowAt(this.ctx, kp.depth)));\n },\n $dependOn: (path: string) => {\n this.resolve(unbound(path), this.ctx);\n if (this.top !== null && this.top.untracked === 0) this.track(this.rp!, this.rr, this.top);\n },\n $getAll: (path: string, indexes?: number[]) => this.getAll(path, indexes),\n $setAll: (path: string, indexes: number[], value: unknown, options?: { spread?: boolean }) =>\n this.setAll(path, indexes, value, options),\n // $resolve(path, indexes) reads; $resolve(path, indexes, value) writes (the argument count decides)\n $resolve: (...args: unknown[]) => {\n const path = unbound(args[0] as string);\n const indexes = (args[1] ?? []) as number[];\n const p = this.pattern(path, true);\n this.checkArity(\"$resolve\", path, p, indexes, true);\n const row = this.rowOf(p, indexes, null);\n if (args.length < 3) return this.read(p, row);\n this.write(p, row, args[2]);\n },\n $postUpdate: (path: string) => {\n this.resolve(unbound(path), this.ctx);\n const p = this.rp!;\n const row = this.rr;\n // changed in place: an element is what its array holds now\n if (p.last === WILDCARD && row !== null) {\n row.item = row.list.arr![row.index];\n this.strategy.resetRow(row);\n }\n this.touched(p, row);\n if (row !== null) this.mirror(row, p, undefined, row.item, false);\n // the value before is not known: the `$eq` / `$eqIndex` occurrences under every key change\n if (p.depth === 0) this.rekeyEqUnder(p, undefined, undefined, true);\n this.landed(p, row, undefined, undefined, false);\n },\n };\n\n constructor(target: Record<string, any>, strategy: Strategy) {\n this.strategy = strategy;\n this.patterns = new PatternTable((p) => {\n this.loose.push(p);\n this.onPatternCreated(p);\n });\n this.loadTarget(target);\n const engine = this;\n // the handler reads engine.target, not the proxy's target (a stand-in): a re-set swaps the state.\n // So do `in`, `delete`, `Object.keys(this)`, `instanceof` (the forwarded traps below); a descriptor\n // is reported configurable, as the stand-in has none (a frozen state's would break the invariants)\n const handler: ProxyHandler<object> = {\n getOwnPropertyDescriptor(_t, key) {\n const d = Reflect.getOwnPropertyDescriptor(engine.target, key);\n if (d) d.configurable = true;\n return d;\n },\n get(_t, key, receiver) {\n const t = engine.target;\n if (typeof key === \"symbol\") return Reflect.get(t, key);\n if (key.charCodeAt(0) === 36 /* $ */) return engine.dollar(key);\n if (key.indexOf(\".\") < 0) {\n const p = engine.patterns.peek(key);\n if (p === undefined || p.getter === null) {\n const v = t[key];\n // (a view of the proxy — the readonly createStateAsync's — gets it as it is)\n if (typeof v === \"function\") return (receiver === engine.proxy && engine.bound?.(v)) || v;\n }\n // a known top-level key: no path to parse\n if (p !== undefined && p.depth === 0) return engine.read(p, null);\n }\n engine.resolve(key, engine.ctx);\n return engine.read(engine.rp!, engine.rr);\n },\n set(_t, key, value) {\n if (typeof key === \"symbol\") return Reflect.set(engine.target, key, value);\n engine.resolve(unbound(key), engine.ctx);\n engine.write(engine.rp!, engine.rr, value);\n return true;\n },\n };\n for (const trap of [\"has\", \"ownKeys\", \"deleteProperty\", \"defineProperty\", \"getPrototypeOf\"]) {\n (handler as any)[trap] = (_t: object, ...a: unknown[]) => (Reflect as any)[trap](engine.target, ...a);\n }\n this.proxy = new Proxy({}, handler);\n }\n\n // ---------------------------------------------------------------- patterns\n\n /**\n * The pattern of `path`, pinned: whoever asks keeps it (a binding, a list, an add-on). `loose`: a\n * path read or written (the proxy, `$resolve`, `$getAll`), swept once it holds nothing.\n */\n pattern(path: string, loose?: boolean): Pattern {\n const p = this.patterns.get(path);\n if (!loose) p.pinned = true;\n return p;\n }\n\n private registerAccessors(target: object): void {\n const seen = new Set<string>();\n for (let o: object | null = target; o !== null && o !== Object.prototype; o = Object.getPrototypeOf(o)) {\n for (const key of Object.getOwnPropertyNames(o)) {\n if (seen.has(key)) continue;\n seen.add(key);\n const d = Object.getOwnPropertyDescriptor(o, key)!;\n if (d.get === undefined && d.set === undefined) continue;\n const p = this.pattern(key);\n p.getter = d.get ?? null;\n p.setter = d.set ?? null;\n if (p.getter !== null && p.depth > 0) p.slot = this.slotCount++;\n }\n }\n // accessors registered after their descendants were created: recompute\n for (const p of this.patterns.all()) this.onPatternCreated(p);\n }\n\n private onPatternCreated(p: Pattern): void {\n // (the recursion add-on makes its `**` templates without this, while the state registers)\n if (p.path.includes(\"**\")) recursionUnsupported(p.path);\n // a path through an object's prototype would read and write every object's (once per path)\n if (p.last === \"__proto__\" || p.last === \"prototype\") raise(M.UnsafeSegment, [p.path]);\n const parent = p.parent;\n p.underGetter = parent !== null && p.last !== WILDCARD && parent.depth === p.depth &&\n (parent.getter !== null || parent.underGetter);\n if (p.getter === null) this.markupAccessor(p);\n }\n\n /**\n * Markup names two things the tree does not hold, as `this[...]` reads them: an explicit index\n * (`items.0.v`, the row at that index now) and a loop index (`items.*.$1`, `$1` in a row).\n * Their patterns (only markup makes them: the proxy parses an index into a row) read — and an\n * index path writes — as the proxy resolves them, so the reads are tracked like a getter's.\n * Where a number is a key of an object (`sales.2024.total`), the path resolves to the pattern\n * itself (rowOf): it is read and written through its parent.\n */\n private markupAccessor(p: Pattern): void {\n const path = p.path;\n const last = p.last;\n if (INDEX_PARAM.test(last)) {\n p.getter = function (this: any) {\n return this[last];\n };\n } else {\n const segs = path.split(\".\");\n // (a leading numeric segment is a root key, not an index: parsePath)\n const i = segs.findIndex((s, j) => j > 0 && s.charCodeAt(0) >= 48 && s.charCodeAt(0) <= 57);\n // none, or a `*` after it: a row of a list over the index path (`for: groups.0.items`) reads its\n // own item, and a write through the index reaches it as a list with the same array (mirror)\n if (i < 0 || segs.indexOf(WILDCARD, i) >= 0) return;\n // (the parent read from the context row: the occurrence's, the setter's — at p.depth)\n p.getter = () => {\n this.resolve(path, this.ctx);\n if (this.rp !== p) return this.read(this.rp!, this.rr);\n return (this.read(p.parent!, this.ctx) as any)?.[last];\n };\n p.setter = (v: unknown) => {\n this.resolve(path, this.ctx);\n if (this.rp !== p) return this.write(this.rp!, this.rr, v);\n const o = this.read(p.parent!, this.ctx) as any;\n if (o == null) raise(M.ParentNotObject, [path, o]);\n o[last] = v;\n };\n }\n p.markup = true;\n if (p.depth > 0) p.slot = this.slotCount++;\n }\n\n // ---------------------------------------------------------------- lists\n\n /** The list of list pattern `p` in `row` (null: a root list), made on first use, synced. */\n childList(row: StateRow | null, p: Pattern): StateList {\n const m = row === null ? this.rootLists : (row.children ??= new Map());\n let l = m.get(p);\n if (l === undefined) m.set(p, (l = new StateList(p, row)));\n // (the list holds it: a path's read made it loose, `users.3.name` through `users`)\n p.pinned = true;\n this.sync(l);\n return l;\n }\n\n /** Syncs `l`; a failure (a missing key, a getter that throws) is its for binding's, and it keeps its rows. */\n private trySync(l: StateList): void {\n try {\n this.sync(l);\n } catch (error) {\n this.failAt(error, l.pattern.path, l.view?.anchor ?? null, \"for\");\n }\n }\n\n /** Reconciles a list's rows with the current value of its pattern. */\n sync(l: StateList): void {\n const value = this.readUntracked(l.pattern, l.parentRow);\n const before = l.arr;\n if (value === before) return;\n // out of the lists over its array before (filed again under the new one below)\n this.unfile(l);\n const old = reconcile(l, value, this);\n if (old === null) return;\n // filed under its array: lists that share an array mirror writes\n // (a value that is not an array reconciles against a stand-in: nothing to share)\n if (l.arr === value) {\n const same = upsert(this.listsByArray, value as unknown[], newArray<StateList>);\n same.push(l);\n // (the rows it kept are up to date: a write into an object reached every list showing it, F26)\n if (same.length > 1) for (const x of same) x.shared = true;\n }\n hooks.listSynced?.(this, l, old);\n if ((l.view !== null || l.extra !== null) && !l.queued) {\n l.queued = true;\n this.dirtyLists.push(l);\n this.schedule();\n }\n const keys = l.pattern.eqIndexKeys;\n if (keys !== null) {\n for (const { source, getter } of keys) {\n const sel = this.readUntracked(source, null) as number;\n const before = old[sel];\n const after = l.rows[sel];\n if (before === after) continue;\n if (before !== undefined && before.alive) this.invalidateUnder(getter, before);\n if (after !== undefined) this.invalidateUnder(getter, after);\n }\n }\n }\n\n indexChanged(row: StateRow): void {\n this.strategy.onIndexChange(this, row);\n }\n\n rowRemoved(row: StateRow): void {\n row.alive = false;\n const subs = row.eqSubs;\n if (subs !== null) {\n for (const e of subs) unsubEq(e.source, e.key, e.sub);\n row.eqSubs = null;\n }\n // the rows of its nested lists go with it, and the lists leave the ledger of their arrays\n if (row.children !== null) {\n for (const l of row.children.values()) {\n this.unfile(l);\n for (const r of l.rows) this.rowRemoved(r);\n }\n }\n }\n\n /** Takes `l` out of the lists over its array; one left alone with it no longer mirrors. */\n private unfile(l: StateList): void {\n const was = this.listsByArray.get(l.arr!);\n if (was === undefined) return;\n was.splice(was.indexOf(l) >>> 0, 1);\n l.shared = false;\n if (was.length === 1) was[0].shared = false;\n }\n\n // ---------------------------------------------------------------- resolve / read\n\n /** Splits a concrete path into (pattern, row) — written to this.rp / this.rr. */\n resolve(path: string, ctx: StateRow | null): void {\n const parsed = parsePath(path);\n const p = (this.rp = this.pattern(parsed.pattern, true));\n const idx = parsed.indexes;\n this.rr = p.depth === 0 ? null : idx === null ? ctxRow(ctx, p, p.depth) : this.rowOf(p, idx, ctx, path);\n }\n\n /**\n * The row at p.depth addressed by `idx` (one index per `*`; -1 takes the one of `ctx`). The pattern\n * it is at goes to this.rp — set last: finding the row can sync a list over a getter, whose\n * evaluation resolves paths too. An index of `path` (the proxy's) into an object that is not an\n * array (`sales.2024.total`) is a key: the pattern keeps it as written (into null or a string, it\n * has no row).\n */\n private rowOf(p: Pattern, idx: readonly number[], ctx: StateRow | null, path?: string): StateRow | null {\n let row: StateRow | null = null;\n for (let k = 1, j = 0, v; k <= p.depth; k++) {\n const listP = p.lists[k]!;\n const list = this.childList(row, listP);\n let i = idx[j++];\n if (i < 0) i = ctxRow(ctx, p, k)?.index ?? -1;\n else if (path && list.arr === EMPTY && Object((v = this.readUntracked(listP, row))) === v) {\n const segs = p.path.split(\".\");\n const n = listP.path.split(\".\").length;\n segs[n] = path.split(\".\")[n];\n p = this.pattern(segs.join(\".\"), true);\n k--;\n continue;\n }\n row = list.rows[i] ?? null;\n if (row === null) break;\n }\n this.rp = p;\n return row;\n }\n\n /** Raw data read (no getter, no tracking). `row` is the row at p.depth. */\n readData(p: Pattern, row: StateRow | null): unknown {\n return p.depth === 0 ? dig(this.target, p.tail) : row === null ? undefined : dig(row.item, p.tail);\n }\n\n /** Tracked read. `row` is the row at p.depth (null at the root). */\n read(p: Pattern, row: StateRow | null): unknown {\n const f = this.top;\n if (f !== null && f.untracked === 0) this.track(p, row, f);\n if (p.getter !== null) return this.strategy.readGetter(this, p, row);\n if (p.underGetter) {\n const parent = this.read(p.parent!, row) as any;\n return parent == null ? undefined : parent[p.last];\n }\n // (`then` / `toJSON` are probes — await, JSON.stringify — not reads of the state: undefined)\n if (p.parent === null && !(p.last in this.target) && !this.dropped.has(p.last) && p.last !== \"then\" && p.last !== \"toJSON\") {\n raise(M.PathMissing, [p.path], p.last, Object.keys(this.target));\n }\n return this.readData(p, row);\n }\n\n readUntracked(p: Pattern, row: StateRow | null): unknown {\n const f = this.top;\n if (f === null) return this.read(p, row);\n f.untracked++;\n try {\n return this.read(p, row);\n } finally {\n f.untracked--;\n }\n }\n\n private track(p: Pattern, row: StateRow | null, f: Frame): void {\n const g = f.getter;\n p.addDependent(g);\n // a root getter's reads (once each, but around a nested one): what it no longer reads goes (prune)\n if (g.depth === 0) {\n if (p.mark !== f.epoch) {\n p.mark = f.epoch;\n f.reads.push(p);\n }\n } else if (p.depth > 0 && rowAt(row, Math.min(p.depth, g.depth)) !== rowAt(f.row, Math.min(p.depth, g.depth))) {\n (g.crossSources ?? (g.crossSources = new Set())).add(p);\n }\n }\n\n /** Evaluates a getter occurrence with dependency tracking. Caching is the strategy's. */\n evalGetter(g: Pattern, row: StateRow | null): unknown {\n // frames are reused by depth: an evaluation allocates nothing of its own\n for (let i = 0; i < this.depthNow; i++) {\n const f = this.frames[i];\n if (f.getter === g && f.row === row) raise(M.GetterCycle, [g.path]);\n }\n if (this.depthNow >= MAX_GETTER_DEPTH) raise(M.GetterDepth, [g.path]);\n const depth = this.depthNow++;\n this.readonlyDepth++;\n const frame = (this.frames[depth] ??= { getter: g, row, untracked: 0, epoch: 0, reads: [] });\n frame.getter = g;\n frame.row = row;\n frame.untracked = 0;\n frame.epoch = ++evals;\n frame.reads.length = 0;\n const outer = this.top;\n this.top = frame;\n const prev = this.ctx;\n this.ctx = row;\n try {\n const v = g.getter!.call(this.proxy);\n if (g.depth === 0) this.prune(g, frame);\n return v;\n } finally {\n this.readonlyDepth--;\n this.depthNow--;\n this.top = outer;\n this.ctx = prev;\n frame.row = null;\n }\n }\n\n /**\n * A root getter evaluated (without throwing): the top-level sources it did not read this time are no\n * longer its sources. Its one occurrence is the whole getter, so what it reads is what it depends on\n * (a row getter's sources stay the union over its rows). A key built from data it read before\n * (`this[\"users.\" + this.selectedId]`) then holds nothing, and is swept. One holding an array stays:\n * a write into an object that array shares with the one the getter returns reaches the rows of the\n * list over the getter through it (mirror — F26, 3.x #362).\n */\n private prune(g: Pattern, f: Frame): void {\n const e = f.epoch;\n for (const s of f.reads) s.mark = e;\n g.sources = g.sources.filter((s) => s.mark === e || s.depth > 0 ||\n (!s.underGetter && Array.isArray(s.getter !== null ? s.rootValue : this.readData(s, null))) || this.unlink(s, g));\n }\n\n /** `getter` reads `s` no more (its side is the caller's): `s` may hold nothing now. False (filtered out). */\n private unlink(s: Pattern, getter: Pattern): false {\n s.dropDependent(getter);\n this.loose.push(s);\n return false;\n }\n\n /**\n * After a drain: the patterns only a path made that hold nothing now leave the table, so it grows\n * with the state's shape, not with every key a path was ever built with. A pattern stays while it\n * is pinned (Engine.pattern: `$eqIndex`'s source among them), at the top level (the state's own\n * keys), has children, is read by a getter, is `$eq`'s source, or has an accessor that is not the\n * engine's own for an index path at the top level (one in a row has a cache slot).\n */\n private sweep(): void {\n for (let c = this.loose; c.length > 0; c = this.loose) {\n this.loose = [];\n const parents = new Set<Pattern>();\n for (const p of c) {\n if (p.pinned || p.dead || p.parent === null || p.children.length > 0 || p.dependents.length > 0 ||\n (p.getter !== null && !(p.markup && p.slot < 0)) || p.eqSubs !== null) continue;\n p.dead = true;\n this.patterns.drop(p);\n parents.add(p.parent);\n // an index path's accessor read its parent\n for (const s of p.sources) this.unlink(s, p);\n }\n for (const q of parents) if (!(q.children = q.children.filter((x) => !x.dead)).length) this.loose.push(q);\n }\n }\n\n /** The getter evaluating now reads the index of its row at level `n`: a move of that row re-evaluates it. */\n private watchIndex(n: number): void {\n const f = this.top;\n if (f !== null && f.untracked === 0) {\n const g = f.getter;\n const listP = g.lists[n];\n if (listP) {\n const w = listP.indexWatchers ?? (listP.indexWatchers = []);\n if (!w.includes(g)) w.push(g);\n }\n }\n }\n\n private dollar(key: string): unknown {\n const c = key.charCodeAt(1);\n if (c >= 48 && c <= 57) {\n const n = key.length === 2 ? c - 48 : INDEX_PARAM.test(key) ? +key.slice(1) : 0;\n if (n < 1 || n > MAX_INDEX_PARAM) {\n raise(M.IndexParamRange, [key]);\n }\n this.watchIndex(n);\n return rowAt(this.ctx, n)?.index;\n }\n const fn = this.api[key];\n if (fn !== undefined) return fn;\n // (the 3.x names 4.0 removed, $trackDependency and $untrackDependency, are the diagnostics add-on's)\n switch (key) {\n case \"$stateElement\":\n return this.element;\n case \"$command\":\n return this.commands;\n }\n return hooks.dollar?.(this, key);\n }\n\n /**\n * `$eq(path, key)`: is the value of `path` equal to `key`? Inside a getter the occurrence\n * subscribes under `key` instead of depending on `path`: a write to `path` re-evaluates\n * only the occurrences keyed under its old and its new value. A `path` that is a getter\n * (or under one) changes without a write, so it falls back to an ordinary tracked read.\n */\n private eq(path: string, key: unknown): boolean {\n this.resolve(path, this.ctx);\n const source = this.rp!;\n const row = this.rr;\n if (source.getter !== null || source.underGetter || source.depth > 0) return sameValueZero(this.read(source, row), key);\n const f = this.top;\n if (f !== null && f.untracked === 0) this.subscribeEq(source, key, f);\n return sameValueZero(this.readUntracked(source, null), key);\n }\n\n /**\n * Subscribes the occurrence evaluating in `f` under `key`. A key it subscribed in an earlier\n * evaluation and not in this one moved; one of this evaluation stays (`$eq(p, a) || $eq(p, b)`).\n */\n private subscribeEq(source: Pattern, key: unknown, f: Frame): void {\n const getter = f.getter;\n const row = f.row;\n const list = row === null ? this.rootEqSubs : (row.eqSubs ?? (row.eqSubs = []));\n for (let i = 0; i < list.length; i++) {\n const e = list[i];\n if (e.sub.getter !== getter || e.source !== source) continue;\n if (sameValueZero(e.key, key)) {\n e.epoch = f.epoch;\n return;\n }\n if (e.epoch !== f.epoch) {\n unsubEq(source, e.key, e.sub);\n list.splice(i--, 1);\n }\n }\n const sub: EqSub = { getter, row };\n upsert((source.eqSubs ??= new Map()), key, newSet<EqSub>).add(sub);\n list.push({ source, key, sub, epoch: f.epoch });\n }\n\n /**\n * A root write to `p` (or an object above a `$eq` / `$eqIndex` source): re-key every source at or\n * under it. `all` (`$postUpdate`, which knows no value before): every key.\n */\n private rekeyEqUnder(p: Pattern, before: unknown, after: unknown, all?: boolean): void {\n this.forSubtree(p, (q) => {\n const map = q.eqSubs;\n if (map === null && q.eqIndexWatchers === null) return;\n const rest = q === p ? [] : q.path.slice(p.path.length + 1).split(\".\");\n const b = dig(before, rest);\n const a = dig(after, rest);\n if (q.eqIndexWatchers !== null) this.rekeyEqIndex(q, b, a, all);\n // the occurrences keyed under the value before and the value after\n if (map !== null) for (const k of all ? map.keys() : [b, a]) {\n const set = map.get(k);\n if (set === undefined) continue;\n for (const sub of set) {\n if (sub.row !== null && !sub.row.alive) {\n unsubEq(q, k, sub);\n continue;\n }\n this.strategy.invalidate(this, sub.getter, sub.row);\n }\n }\n });\n }\n\n // ---------------------------------------------------------------- write\n\n /**\n * `occurrence`: an event-semantics write, applied even when equal to the current value.\n * `element`: an element wrote it back (a two-way input, a wc-bindable event), not code.\n */\n write(p: Pattern, row: StateRow | null, value: unknown, occurrence = false, element = false): void {\n if (this.readonlyDepth > 0) raise(M.Readonly);\n if (element || this.feeding > 0) this.fedBack = true;\n else this.codeWrote = true;\n if (hooks.beforeWrite?.(this, p, row, value, element)) return;\n // a setter's write is not a data write: the add-ons hear of it without old and new values\n if (p.setter !== null) {\n // a setter that throws after it wrote: what it wrote still lands (3.x #361), and the error\n // propagates. One that throws before writing anything lands as well, as one that returns\n // without writing does (3.x notifies in `finally` too): `$watch` hears of it, a getter recomputes\n try {\n this.callAt(p.setter, row, [value]);\n } finally {\n this.landed(p, row, undefined, undefined, false);\n }\n return;\n }\n if (p.getter !== null) raise(M.GetterWithoutSetter, [p.path]);\n if (p.depth > 0 && row === null) raise(M.NoRow, [p.path]);\n // under a getter, the value before is read through it (the data has no such path)\n const old = p.underGetter ? this.readUntracked(p, row) : this.readData(p, row);\n if (!occurrence && this.guard && Object.is(old, value) && Object(value) !== value) return;\n if (p.last === WILDCARD) {\n // element write: the position keeps its row, the row takes the new value\n const r = row!;\n (r.list.arr as unknown[])[r.index] = value;\n r.item = value;\n this.strategy.resetRow(r);\n } else {\n const parent = (p.tail.length === 1\n ? (p.depth === 0 ? this.target : row!.item)\n : this.readUntracked(p.parent!, row)) as any;\n if (parent == null) raise(M.ParentNotObject, [p.path, parent]);\n parent[p.last] = value;\n }\n this.syncListsUnder(p, row);\n if (row !== null) this.mirror(row, p, old, value);\n if (p.depth === 0) this.rekeyEqUnder(p, old, value);\n this.landed(p, row, old, value, true);\n }\n\n /** The lists over `l`'s array now (`l` among them), none of a removed row. */\n private sharing(l: StateList): StateList[] {\n return (this.listsByArray.get(l.arr!) ?? []).filter((m) => m.arr === l.arr && (m.parentRow === null || m.parentRow.alive));\n }\n\n /**\n * A write into row `row` of a list whose array another list has too (`for: shown` over a getter\n * returning `todos`, `for: groups.0.items`): the other list's row at the same position shows it.\n *\n * A write into the row's object (not the element) reaches it wherever else it is (F26, `get\n * shown()` filtering `todos`). From the array holding it (the list's own, or one its getter read\n * at a data path), the write goes to the getters that read that array and returned one holding the\n * object (a filter, a sort, a slice: evaluated again), on down their dependents, and to the rows\n * holding the object in the lists over those arrays. A getter whose array does not hold the object\n * is not reached: it read the array, not the object (the dependency boundary).\n */\n private mirror(row: StateRow, p: Pattern, old: unknown, value: unknown, direct = true): void {\n const l = row.list;\n // another list has its array, or it is over a getter or a getter reads it: its object may be in\n // another array too. A plain list pays these checks only\n if (!l.shared && l.pattern.getter === null && !l.pattern.dependents.length) return;\n const o = row.item;\n const suffix = p.path.slice(l.pattern.path.length + 2);\n const land = (m: StateList, r: StateRow | undefined): void => {\n if (r === undefined || r === row) return;\n const mp = this.pattern(`${m.pattern.path}.*${suffix}`, true);\n if (suffix === \"\") {\n r.item = value;\n this.strategy.resetRow(r);\n }\n if (direct) this.syncListsUnder(mp, r);\n else this.touched(mp, r);\n this.landed(mp, r, old, value, direct);\n };\n for (const m of this.sharing(l)) land(m, m.rows[row.index]);\n if (suffix === \"\") return;\n // (a leaf write: the row's item is an object. The lists over its own array were reached above)\n const seen = new Set<unknown>([l.arr]);\n const has = (a: unknown): a is unknown[] => Array.isArray(a) && a.includes(o);\n const down = (arr: unknown, deps: Pattern[]): void => {\n if (!seen.has(arr) && seen.add(arr)) for (const m of this.listsByArray.get(arr as unknown[]) ?? []) for (const r of m.rows) if (r.item === o) land(m, r);\n // each getter once (a cycle across evaluations ends). One passing the array on (`get shown()\n // { return this.todos }`) is not evaluated again: the lists over it were reached already. One\n // reached before (earlier in the batch, or just now through a getter it reads) is evaluated again\n // in the drain, its list synced then: the rows it keeps are those its list shows now\n for (const g of deps) {\n let v = g.rootValue;\n const stale = v === DIRTY;\n if (stale) v = this.rootLists.get(g)?.arr;\n if ((stale || has(v)) && !seen.has(g.dependents) && seen.add(g.dependents)) {\n if (!stale && v !== arr) this.strategy.invalidate(this, g, null);\n down(v, g.dependents);\n }\n }\n };\n const up = (g: Pattern): void => {\n for (const s of g.sources) {\n if (seen.has(s) || !seen.add(s)) continue;\n if (s.getter !== null) up(s);\n else if (!s.underGetter) {\n const a = this.readData(s, null);\n if (has(a)) down(a, s.dependents);\n }\n }\n };\n if (l.pattern.getter !== null) up(l.pattern);\n else down(l.arr!, l.pattern.dependents);\n }\n\n /**\n * `$postUpdate`: what is at `p` changed in place. Its lists are synced as a write syncs them, and\n * their rows (and the rows of the lists over the same arrays) show it again: a write reaches a\n * row's bindings through the row it replaced, an in-place change through none.\n */\n private touched(p: Pattern, row: StateRow | null): void {\n this.forListsUnder(p, row, (l) => {\n this.sync(l);\n for (const m of l.shared ? this.sharing(l) : [l]) {\n const e = this.pattern(`${m.pattern.path}.*`);\n for (const r of m.rows) {\n this.enqueueBound(e, r);\n this.touched(e, r);\n }\n }\n });\n }\n\n private syncListsUnder(p: Pattern, row: StateRow | null): void {\n const ls = row === null ? this.rootLists : row.children;\n if (ls !== null) for (const l of ls.values()) if (l.pattern.isUnder(p)) this.sync(l);\n }\n\n /** The lists of `row` (the root lists at null) whose pattern is `p` or under it. */\n private forListsUnder(p: Pattern, row: StateRow | null, fn: (l: StateList) => void): void {\n const ls = row === null ? this.rootLists : row.children;\n if (ls !== null) for (const l of ls.values()) if (l.pattern.isUnder(p)) fn(l);\n }\n\n /**\n * `$eqIndex(source, level)` compares the index of the row at `level`: when `source` changes, the\n * getter's occurrences under the rows at that level with the old or the new index change (`all`:\n * under every row).\n */\n private rekeyEqIndex(source: Pattern, before: unknown, after: unknown, all?: boolean): void {\n for (const { getter, level } of source.eqIndexWatchers!) {\n this.forAllLists(getter.lists[level]!, (l) => {\n for (const k of all ? l.rows.keys() : [before, after]) {\n const r = typeof k === \"number\" ? l.rows[k] : undefined;\n if (r !== undefined) this.invalidateUnder(getter, r);\n }\n });\n }\n }\n\n /** Invalidates getter `g`'s occurrences at or under `row` (row.depth <= g.depth). */\n private invalidateUnder(g: Pattern, row: StateRow): void {\n if (row.list.depth === g.depth) this.strategy.invalidate(this, g, row);\n else this.forRowsUnder(row, g, (r) => this.strategy.invalidate(this, g, r));\n }\n\n /** A write landed at (p, row): the add-ons hear of it, then its dependents. */\n private landed(p: Pattern, row: StateRow | null, old: unknown, value: unknown, direct: boolean): void {\n hooks.written?.(this, p, row, old, value, direct);\n this.changed(p, row);\n }\n\n changed(p: Pattern, row: StateRow | null): void {\n this.strategy.onWrite(this, p, row);\n this.schedule();\n }\n\n /**\n * One listener per event type on the root, dispatching to the delegated element handlers.\n * Returns the property the element's handler is stored under (one symbol per engine and\n * type, so two engines never run each other's handlers).\n */\n delegate(type: string): symbol {\n const known = this.delegated.get(type);\n if (known !== undefined) return known;\n const key = Symbol(`wcs.on${type}`);\n this.delegated.set(type, key);\n const root = this.root!;\n const blockKey = this.blockKey;\n root.addEventListener(type, (e) => {\n for (let n = e.target as any; n !== null && n !== root; n = n.parentNode) {\n // a handler stored on the element (a root-level one, or one a block pinned)\n const fn = n[key];\n if (fn !== undefined) {\n fn(e);\n if (e.cancelBubble) return;\n }\n // a block's top node: the handlers of the block's elements the event passed\n const block = n[blockKey];\n if (block !== undefined && block.alive && block.dispatch(type, e)) return;\n }\n });\n return key;\n }\n\n // ---------------------------------------------------------------- re-set\n\n /**\n * `setInitialState` on an initialized element: the state is replaced whole and every\n * binding is re-applied to it before this returns. Not a write: no `$renderedCallback`.\n * Everything learned from the old state goes (accessors, dependencies, caches, `$eq`\n * keys); rows are kept where their list's array is the same instance.\n */\n reset(target: Record<string, any>): void {\n const old = this.target;\n // a key the old state had (or an earlier re-set dropped) and this one lacks is empty (B8), as a\n // missing path under a key is — not a key never declared, which fails on read: its bindings, lists\n // and getters read undefined, until it is written. Its accessors too: those on a class state's\n // prototype, which for…in does not list, are the top-level patterns with a getter\n const dropped = this.dropped;\n for (const p of this.patterns.all()) if (p.parent === null && p.getter !== null) dropped.add(p.last);\n this.loadTarget(target);\n for (const k in old) if (k[0] !== \"$\") dropped.add(k);\n for (const k of dropped) if (k in target) dropped.delete(k);\n for (const bs of this.rootBindings.values()) for (const b of bs) this.enqueue(b);\n for (const l of this.rootLists.values()) this.resetList(l);\n this.rendered = null;\n try {\n this.drain();\n } finally {\n this.watchRendered();\n }\n hooks.element?.(this, \"reset\");\n }\n\n /** Takes in a state object: at construction, and on a re-set (everything learned from the old one goes). */\n private loadTarget(target: Record<string, any>): void {\n for (const [key, feature] of DECLARATIONS) if (target[key] !== undefined) requireFeature(feature, key);\n // (the 3.x declarations 4.0 removed — $scan, $streams, $updatedCallback — are the diagnostics add-on's)\n const f = target.$features;\n if (f !== undefined) {\n if (!Array.isArray(f)) raise(M.FeaturesNotArray);\n for (const name of f) requireFeature(name, \"$features\");\n }\n // an options object: null and an array are not one (as for bootstrapState's options)\n const c = target.$behavior === undefined ? {} : target.$behavior;\n if (typeof c !== \"object\" || !c || Array.isArray(c)) raise(M.OptionInvalid, [\"state\", \"$behavior\"]);\n for (const key in c) if (!BEHAVIOR_KEYS.includes(key) || typeof c[key] !== \"boolean\") raise(M.OptionInvalid, [\"$behavior\", key]);\n const [mustache, guard, directional] = BEHAVIOR_KEYS.map((key) => c[key] ?? true);\n // a re-set keeps the engine, and what was built by the old options\n if (this.target !== undefined && (mustache !== this.mustache || guard !== this.guard || directional !== this.directional)) raise(M.BehaviorChanged);\n // (read before anything is taken in: a malformed declaration leaves a re-set's old state in place)\n const commands = commandNamespace(target, this.commands);\n const events = eventTokens(target, this.deliverFn);\n this.mustache = mustache;\n this.guard = guard;\n this.directional = directional;\n hooks.declare?.(this, target);\n this.target = target;\n this.slotCount = 0;\n for (const p of this.patterns.all()) p.forget();\n this.rootEqSubs.length = 0;\n this.registerAccessors(target);\n this.commands = commands;\n this.events = events;\n }\n\n private resetList(l: StateList): void {\n // a list that cannot be read (its getter throws) fails alone: the re-set goes on (and ends with its hook)\n this.trySync(l);\n const element = this.pattern(`${l.pattern.path}.*`);\n for (const row of l.rows) {\n row.cache = null;\n row.eqSubs = null;\n this.enqueueBound(element, row);\n if (row.children !== null) for (const c of row.children.values()) this.resetList(c);\n }\n }\n\n // ---------------------------------------------------------------- tokens\n\n /** The loop indexes of `row`, outermost first (`$1`, `$2`, …). */\n indexesOf(row: StateRow | null): number[] {\n const out: number[] = [];\n for (let r = row; r !== null; r = r.list.parentRow) out.unshift(r.index);\n return out;\n }\n\n /** An element event wired with `eventToken.<prop>: <name>` — the token is resolved at fire time. */\n fireEventToken(name: string, event: Event, row: StateRow | null): void {\n const token = this.events.get(name);\n if (token === undefined) raise(M.EventTokenUndeclared, [name], name, this.events.keys());\n token.emit(event, ...this.indexesOf(row));\n }\n\n /** The `$command.<name>` token (declared in `$commandTokens`). */\n command(name: string): Token {\n const token = this.commands[name];\n if (token === undefined) raise(M.CommandTokenUndeclared, [name], name, Object.keys(this.commands));\n return token;\n }\n\n /** `onclick: $command.<name>` — emits the token with (event, ...listIndexes). */\n emitCommand(name: string, event: Event, row: StateRow | null): void {\n this.command(name).emit(event, ...this.indexesOf(row));\n }\n\n // ---------------------------------------------------------------- methods\n\n invoke(name: string, event: Event, row: StateRow | null): unknown {\n // a dotted name is a path (a volume method lives under its mount path)\n const fn = name.includes(\".\") ? this.readUntracked(this.pattern(name), null) : this.target[name];\n if (typeof fn !== \"function\") raise(M.NotAMethod, [name]);\n return this.callAt(fn, row, [event, ...this.indexesOf(row)]);\n }\n\n /** Calls `fn` on the proxy with the evaluation context at `row`. */\n private callAt(fn: (...args: any[]) => unknown, row: StateRow | null, args: unknown[]): unknown {\n const prev = this.ctx;\n this.ctx = row;\n try {\n return fn.apply(this.proxy, args);\n } finally {\n this.ctx = prev;\n }\n }\n\n // ---------------------------------------------------------------- change walk\n\n /** Queues the bindings on `p` (and patterns under it) in the scope of `row`. */\n enqueueBound(p: Pattern, row: StateRow | null): void {\n // a list over a getter (or under one) is re-synced in the drain: a data write syncs its\n // lists right away, but a getter's value is only known when it is read again\n if (p.getter !== null) {\n const ls = row === null ? this.rootLists : row.children;\n if (ls !== null) {\n for (const l of ls.values()) {\n if (!l.stale && l.pattern.isUnder(p)) {\n l.stale = true;\n this.staleLists.push(l);\n }\n }\n }\n }\n if (row === null) {\n this.forSubtree(p, (q) => {\n const bs = this.rootBindings.get(q);\n if (bs !== undefined) for (const b of bs) this.enqueue(b);\n });\n return;\n }\n const bs = row.bindings;\n if (bs !== null) for (let i = 0; i < bs.length; i++) if (bs[i].pattern.isUnder(p)) this.enqueue(bs[i]);\n // slot bindings of the row's renderings\n const view = row.view;\n if (view !== null && view.slots !== null) view.enqueueSlots(this, p);\n const extra = row.list.extra;\n if (extra !== null) {\n for (const fv of extra) {\n const rv = fv.map!.get(row);\n if (rv !== undefined && rv.slots !== null) rv.enqueueSlots(this, p);\n }\n }\n }\n\n /** Reaches every getter occurrence that read `p` (or a pattern under it) at `row`. */\n walkDependents(p: Pattern, row: StateRow | null, visit: Visit): void {\n this.forSubtree(p, (q) => {\n const deps = q.dependents;\n for (let i = 0; i < deps.length; i++) {\n const g = deps[i];\n if (g.depth === 0) this.visitGetter(g, null, visit);\n else if (row === null || q.depth === 0 || g.lists[1] !== q.lists[1] || (g.crossSources !== null && g.crossSources.has(q))) {\n this.forAllRows(g.lists[g.depth]!, (r) => this.visitGetter(g, r, visit));\n } else if (g.depth <= q.depth) {\n const r = rowAt(row, g.depth);\n if (r !== null) this.visitGetter(g, r, visit);\n } else this.forRowsUnder(row, g, (r) => this.visitGetter(g, r, visit));\n }\n });\n }\n\n visitGetter(g: Pattern, row: StateRow | null, visit: Visit): void {\n if (!visit(g, row)) return;\n hooks.getterReached?.(this, g, row);\n this.enqueueBound(g, row);\n this.walkDependents(g, row, visit);\n }\n\n forSubtree(p: Pattern, fn: (q: Pattern) => void): void {\n fn(p);\n const c = p.children;\n for (let i = 0; i < c.length; i++) this.forSubtree(c[i], fn);\n }\n\n /** Every row of every list instance of list pattern `listP`. */\n forAllRows(listP: Pattern, fn: (row: StateRow) => void): void {\n this.forAllLists(listP, (l) => {\n for (const r of l.rows) fn(r);\n });\n }\n\n /** Every list instance of list pattern `listP`. */\n private forAllLists(listP: Pattern, fn: (l: StateList) => void): void {\n if (listP.depth === 0) {\n const l = this.rootLists.get(listP);\n if (l !== undefined) fn(l);\n return;\n }\n this.forAllRows(listP.lists[listP.depth]!, (parent) => {\n const l = parent.children?.get(listP);\n if (l !== undefined) fn(l);\n });\n }\n\n /** Rows at g.depth at or under `row` (row.depth <= g.depth). */\n forRowsUnder(row: StateRow, g: Pattern, fn: (row: StateRow) => void): void {\n if (row.list.depth === g.depth) return fn(row);\n const l = row.children?.get(g.lists[row.list.depth + 1]!);\n if (l !== undefined) for (const r of l.rows) this.forRowsUnder(r, g, fn);\n }\n\n // ---------------------------------------------------------------- bindings & drain\n\n /** Registers a binding where a change of its location finds it: its row, or the root table. */\n register(b: Binding): void {\n const row = b.row;\n if (row !== null) {\n (row.bindings ?? (row.bindings = [])).push(b);\n return;\n }\n upsert(this.rootBindings, b.pattern, newSet<Binding>).add(b);\n }\n\n unregister(b: Binding): void {\n const row = b.row;\n if (row === null) {\n this.rootBindings.get(b.pattern)?.delete(b);\n return;\n }\n // a row that left its list takes its registrations with it\n const bs = row.bindings;\n if (row.alive && bs !== null) bs.splice(bs.indexOf(b) >>> 0, 1);\n }\n\n enqueue(b: Binding): void {\n if (b.queued) return;\n b.queued = true;\n this.queue.push(b);\n this.schedule();\n }\n\n schedule(): void {\n if (this.scheduled) return;\n this.scheduled = true;\n queueMicrotask(this.drainFn);\n }\n\n /** Drops the queued work of a cut update loop: what it would have shown waits for the next change. */\n private dropWork(): void {\n for (const b of this.queue) b.queued = false;\n for (const l of this.dirtyLists) l.queued = false;\n for (const l of this.staleLists) l.stale = false;\n this.queue = [];\n this.dirtyLists = [];\n this.staleLists = [];\n this.strategy.dropped(this);\n }\n\n /**\n * Cuts an update loop past `max` (`id`: its message): reported with the paths its queued work\n * would have rendered (the console, and DevTools as `state:render-chain-limit`), then dropped.\n */\n private cutLoop(id: M, max: number): void {\n const paths = [...new Set([...this.queue, ...this.dirtyLists, ...this.staleLists].map((x) => x.pattern.path))];\n console.error(`[@wcstack/state] ${text(id)}`, paths);\n hooks.noticed?.(this, { \"type\": \"state:render-chain-limit\", \"maxDepth\": max, \"paths\": paths });\n this.dropWork();\n }\n\n drain(): void {\n this.scheduled = false;\n // a drain only rendering fed (no write from code since the last) continues a chain: the carried\n // one of a deferred apply, or the task's\n const carried = this.carried;\n this.carried = 0;\n let chain = 0;\n if (!this.fedBack || this.codeWrote) this.unchainFn();\n else if (carried > 0) chain = carried;\n else if ((chain = ++this.chain) === 1) setTimeout(this.unchainFn, 0);\n this.fedBack = this.codeWrote = false;\n if (chain > MAX_RENDER_CHAIN) {\n if (chain === MAX_RENDER_CHAIN + 1) this.cutLoop(M.RenderChain, MAX_RENDER_CHAIN);\n else this.dropWork();\n return;\n }\n this.draining = true;\n try {\n for (let pass = 0; this.queue.length > 0 || this.dirtyLists.length > 0 || this.staleLists.length > 0; pass++) {\n if (pass >= MAX_DRAIN_PASSES) {\n // (once a chain: a reaction that starts the same loop again in each drain is not reported again)\n if (this.unsettled) this.dropWork();\n else this.cutLoop(M.DrainNotSettled, MAX_DRAIN_PASSES);\n this.unsettled = true;\n break;\n }\n const stale = this.staleLists;\n if (stale.length > 0) {\n this.staleLists = [];\n for (const l of stale) {\n l.stale = false;\n this.trySync(l);\n }\n }\n const lists = this.dirtyLists;\n const q = this.queue;\n this.dirtyLists = [];\n this.queue = [];\n // the DOM changes of this pass go to the page's view-transition arbiter, if any\n // (transition-runner protocol): with none, they are applied right here. Queued\n // entries stay marked until applied, so a write meanwhile folds into them\n const pending = runTransition(\"state\", () => {\n // list views first (they build rows), then bindings\n for (const l of lists) {\n l.queued = false;\n for (const v of [l.view, ...(l.extra ?? [])]) {\n if (v === null || !v.alive) continue;\n // a row that fails to build (a binding refused as it is attached) fails this view\n // alone: the rest of the pass is still applied (nothing stays queued)\n try {\n v.update();\n } catch (error) {\n this.failAt(error, l.pattern.path, v.anchor, \"for\");\n }\n }\n }\n for (let i = 0; i < q.length; i++) {\n const b = q[i];\n // applied since it was queued (a row slot, when its row was built)\n if (!b.queued) continue;\n b.queued = false;\n if (b.owner === null || b.owner.alive) this.applyBinding(b);\n }\n // applied later by the arbiter, outside any drain: report its failures now, and the drain\n // what it fed back starts (a write-back, `$renderedCallback`) is the next of this drain's chain\n if (!this.draining) {\n this.report();\n if (this.scheduled) this.carried = chain + 1;\n }\n });\n if (pending !== undefined) pending.then(undefined, (e) => console.error(e));\n }\n } finally {\n this.draining = false;\n }\n // (writes made while applying are this drain's own passes)\n this.fedBack = this.codeWrote = false;\n this.report();\n hooks.drained?.(this);\n this.sweep();\n // (as is the one a carried drain's reactions start)\n if (carried > 0 && this.scheduled) this.carried = chain + 1;\n }\n\n // ---------------------------------------------------------------- apply, hooks, reports\n\n /** A binding that failed to apply: reported after the drain. */\n fail(error: unknown, b: Binding): void {\n this.errors.push([error, b]);\n }\n\n /**\n * A failure of what has no Binding object, reported like a binding's: a list that failed to sync\n * or render (its `for`), a binding refused as it was attached in a row.\n */\n failAt(error: unknown, path: string, node: Node | null, type: string): void {\n this.fail(error, { pattern: { path }, node, typeName: () => type } as unknown as Binding);\n }\n\n applyBinding(b: Binding): void {\n try {\n b.apply();\n } catch (error) {\n this.errors.push([error, b]);\n return;\n }\n if (this.rendered !== null) this.noteRendered(b.pattern, b.row);\n }\n\n /** Records an applied binding for `$renderedCallback`. */\n noteRendered(p: Pattern, row: StateRow | null): void {\n const list = upsert(this.rendered!, p.path, newArray<number[]>);\n if (row !== null) list.push(this.indexesOf(row));\n }\n\n /** Starts collecting applied paths when the state declares `$renderedCallback`. */\n watchRendered(): void {\n this.rendered = typeof this.target.$renderedCallback === \"function\" ? new Map() : null;\n }\n\n /** `$renderedCallback` for the paths applied since the last report, then binding failures. */\n report(): void {\n const rendered = this.rendered;\n if (rendered !== null && rendered.size > 0) {\n this.rendered = new Map();\n const paths = [...rendered.keys()];\n const indexes: Record<string, number[][]> = {};\n for (const [p, l] of rendered) if (l.length > 0) indexes[p] = l;\n this.feeding++;\n let r: any;\n try {\n r = this.callHook(\"$renderedCallback\", [paths, indexes]);\n } catch (e) {\n console.error(e);\n }\n if (isThenable(r)) {\n r.then(this.renderedFn, (e: unknown) => {\n this.renderedFn();\n console.error(e);\n });\n } else {\n this.feeding--;\n }\n }\n if (this.errors.length === 0) return;\n const errors = this.errors;\n this.errors = [];\n const hook = this.target.$errorCallback;\n for (const [error, binding] of errors) {\n hooks.failed?.(this, error, binding);\n const path = binding.pattern.path;\n const type = binding.typeName();\n if (typeof hook === \"function\") {\n // quoted keys: the author reads them (mangle.mjs shortens the unquoted ones)\n try {\n const r = this.callHook(\"$errorCallback\", [error, { \"path\": path, \"bindingType\": type, \"node\": binding.node }]) as any;\n if (isThenable(r)) r.then(undefined, (e: unknown) => console.error(e));\n } catch (e) {\n console.error(e);\n }\n } else {\n console.error(`[@wcstack/state] ${text(M.BindingFailed, [type, path])}`, error);\n }\n }\n }\n\n /** Runs a lifecycle hook with the writable proxy; returns its result (awaited by the caller or not). */\n callHook(name: string, args: unknown[] = []): unknown {\n const fn = this.target[name];\n return typeof fn === \"function\" ? this.callAt(fn, null, args) : undefined;\n }\n\n // ---------------------------------------------------------------- $getAll / $setAll / $resolve\n\n /** Calls fn for every row at p.depth that matches `indexes` (a prefix over p's wildcards). */\n private forMatches(p: Pattern, indexes: readonly number[], fn: (row: StateRow | null, idx: number[]) => void): void {\n if (p.depth === 0) {\n fn(null, []);\n return;\n }\n const idx: number[] = [];\n const walk = (k: number, parent: StateRow | null): void => {\n const lp = p.lists[k]!;\n // the list itself is read too: a getter over $getAll sees the first row of an empty list\n this.read(lp, parent);\n const list = this.childList(parent, lp);\n const visit = (r: StateRow): void => {\n idx.push(r.index);\n if (k === p.depth) fn(r, idx);\n else walk(k + 1, r);\n idx.pop();\n };\n for (const r of k - 1 < indexes.length ? [list.rows[indexes[k - 1]]] : list.rows) if (r !== undefined) visit(r);\n };\n walk(1, null);\n }\n\n private getAll(path: string, indexes?: number[]): unknown[] {\n const p = this.pattern(path, true);\n if (indexes !== undefined) this.checkArity(\"$getAll\", path, p, indexes, false);\n // by default the loop context, on the wildcard levels the path shares with it\n let idx = indexes;\n if (idx === undefined) {\n idx = [];\n const ctx = this.ctx;\n if (ctx !== null && p.depth > 0) {\n for (let k = 1; k <= p.depth; k++) {\n const r = ctxRow(ctx, p, k);\n if (r === null) break;\n idx.push(r.index);\n }\n if (idx.length === 0) raise(M.GetAllNoCommonLevel, [path]);\n }\n }\n const out: unknown[] = [];\n this.forMatches(p, idx, (row) => out.push(this.read(p, row)));\n return out;\n }\n\n private setAll(path: string, indexes: number[], value: unknown, options?: { spread?: boolean }): number {\n if (!Array.isArray(indexes)) raise(M.SetAllNeedsIndexes, [path]);\n if (this.readonlyDepth > 0) raise(M.Readonly);\n const p = this.pattern(path, true);\n this.checkArity(\"$setAll\", path, p, indexes, false);\n const targets: [StateRow | null, number[]][] = [];\n this.forMatches(p, indexes, (row, idx) => targets.push([row, idx.slice()]));\n const spread = options?.spread === true;\n if (spread && (!Array.isArray(value) || value.length !== targets.length)) {\n raise(M.SetAllSpreadLength, [path, targets.length]);\n }\n let written = 0;\n for (let i = 0; i < targets.length; i++) {\n const [row, idx] = targets[i];\n const v = typeof value === \"function\"\n ? (value as (cur: unknown, ...i: number[]) => unknown)(this.readUntracked(p, row), ...idx)\n : spread ? (value as unknown[])[i] : value;\n if (v === undefined) continue;\n this.write(p, row, v);\n written++;\n }\n return written;\n }\n\n /** `$resolve` takes exactly one index per `*`; `$getAll` / `$setAll` at most one (fewer expands the rest). */\n private checkArity(api: string, path: string, p: Pattern, indexes: readonly number[], exact: boolean): void {\n const n = indexes.length;\n if (n > p.depth || (exact && n < p.depth)) {\n raise(exact ? M.IndexArityExact : M.IndexArityAtMost, [api, path, p.depth, n]);\n }\n }\n}\n"],"mappings":"mMAWO,IAAMA,EAA4BC,OAAOC,IAAI,+BAI7C,SAASC,IACd,IAAMC,EAASC,WAAoBL,GACnC,OAAiB,OAAVI,GAAmC,iBAAVA,EAAsBA,EAA+B,IACvF,CAEO,SAASE,EAAsBC,GACnCF,WAAoBL,GAA6BO,CACpD,CAEO,SAASC,EAAWC,GACzB,MAAgB,cAATA,GAAiC,cAATA,GAAiC,WAATA,CACzD,CAOO,SAASC,EAAUN,GACxB,GAAKC,WAAmBM,cAAcC,OAAOR,GAAQ,OAAOA,EAC5D,IAAMS,EAAa,MAATT,EAAgB,GAAKU,OAAOV,GAChCG,EAASJ,IACTY,EAASR,GAAQS,WACvB,MAAyB,mBAAXD,EAAwBA,EAAOE,KAAKV,EAAQM,GAAKA,CACjE,CC9BO,IAAMK,EAAN,MAmBL,WAAAC,CAAYC,EAAiBC,EAAeC,GAd5CC,KAAAC,GAA0B,KAE1BD,KAAAE,EAAuB,KAKvBF,KAAAG,GAA6B,KAE7BH,KAAAI,EAA8C,KAE9CJ,KAAAK,EAA2C,KAC3CL,KAAAM,GAAQ,EAGNN,KAAKH,EAAOA,E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,KAC5B,IAAMiD,EAAIzF,KAAKQ,EAAQkD,GAAM,GAC7B1D,KAAKqK,GAAW,UAAW3G,EAAM+B,EAAGsE,GAAS,GAC7C,IAAM6O,EAAyC,GAC/C5Y,KAAKyY,GAAWhT,EAAGsE,EAAS,CAACzE,EAAKmK,IAAQmJ,EAAQ7W,KAAK,CAACuD,EAAKmK,EAAI8B,WACjE,IAAMsH,GAA6B,IAApB3O,GAAS2O,OACpBA,KAAYvW,MAAMC,QAAQ1D,IAAUA,EAAMuG,SAAWwT,EAAQxT,SAC/D5C,KAA4B,CAACkB,EAAMkV,EAAQxT,SAE7C,IAAIgO,EAAU,EACd,QAASjO,EAAI,EAAGA,EAAIyT,EAAQxT,OAAQD,IAAK,CACvC,IAAOG,EAAKmK,GAAOmJ,EAAQzT,GACrBf,EAAqB,mBAAVvF,EACZA,EAAoDmB,KAAKqJ,EAAc5D,EAAGH,MAASmK,GACpFoJ,EAAUha,EAAoBsG,GAAKtG,OAC7B,IAANuF,IACJpE,KAAKuK,EAAM9E,EAAGH,EAAKlB,GACnBgP,IACF,CACA,OAAOA,CACT,CAGQ/I,GAAWjC,EAAa1E,EAAc+B,EAAYsE,EAA4B+O,GACpF,IAAMhL,EAAI/D,EAAQ3E,QACd0I,EAAIrI,EAAEzE,GAAU8X,GAAShL,EAAIrI,EAAEzE,IACjCwB,EAAMsW,UAAgD,CAAC1Q,EAAK1E,EAAM+B,EAAEzE,EAAO8M,GAE/E,UACFiL,OAAAC,OAAAC,OAAAC,OAAApU,OAAAqU,OAAAC,OAAAC,OAAAC,OAAAC,OAAAC","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as t,p as n}from"./chunk-BMGEWHCR.js";import{a as l,b as e,c as r}from"./chunk-ZN52NEIB.js";import{a as o}from"./chunk-4NJBYXIT.js";var i=Symbol.for("wcstack.binder"),u=Symbol.for("wcstack.binder.pending"),s=Symbol.for("wcstack.binder.taken");var a=new Map;function f(l,e){if(1!==l.nodeType||!l.isConnected)return;let r=t.get(l.getRootNode());void 0===r||!1===r.element?.isConnected?a.set(l,e):n(r,l,e?.range)}function c(){let t=[...a];a.clear();for(let[n,l]of t)f(n,l);!function(){let t=function(){let t=globalThis[i];return null==t||"wcs-binder"!==t.protocol||"number"!=typeof t.version||t.version<1||"function"!=typeof t.bind?null:t}();if(null===t)return;let n=function(){let t=globalThis,n=t[u];return void 0===n&&(n=[],t[u]=n),n}();if(0===n.length)return;let l=n.splice(0,n.length),e=function(){let t=globalThis,n=t[s];return void 0===n&&(n=new WeakSet,t[s]=n),n}();for(let n of l)e.add(n),t.bind(n)}()}function h(){let t=globalThis;void 0===t[i]&&(t[i]={protocol:"wcs-binder",version:1,bind:f})}var d=class{constructor(){this.name="dirty",this.Z=(t,n)=>{if(0===t.n){let n=t.z;return n!==l&&n!==e&&(t.z=e,!0)}let r=null===n?null:n.ht;if(null===r)return!1;let o=r[t.A];return o!==l&&o!==e&&(r[t.A]=e,!0)}}Qo(t,n,l){null!==n.getter&&this.Z(n,l),t.$t(n,l),t.Nn(n,l,this.Z)}Ho(t,n){let l=n.l.o.It;if(null!==l)for(let e of l)e.n===n.l.n?t.it(e,n,this.Z):t.Zt(n,e,n=>t.it(e,n,this.Z))}we(t,n,l){this.Z(n,l),o.ve?.(t,n,l),t.$t(n,l),t.Nn(n,l,this.Z)}Ko(t,n,o){let i=0===n.n;if(!i&&null===o)return;let u=i?null:o.ht??=new Array(t.Ie).fill(l),s=null===u?n.z:u[n.A];if(s!==l&&s!==e&&s!==r&&(null===u||n.A in u))return s;s=r;try{return s=t.Uo(n,null===u?null:o)}finally{null===u?n.z=s:u[n.A]=s}}Yt(t){t.ht=null}vt(t){for(let n of t.I.all())null!==n.getter&&(0===n.n?n.z===e&&(n.z=r):t.tn(n.h[n.n],t=>{let l=t.ht;null!==l&&l[n.A]===e&&(l[n.A]=r)}))}};export{f as a,c as b,h as c,d};
|
|
2
|
-
//# sourceMappingURL=chunk-V6VVL4F3.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|