@graview/guest 0.1.8 → 0.1.10
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.md +301 -2
- package/client.js +2 -0
- package/dist/channel.d.ts +11 -3
- package/dist/channel.d.ts.map +1 -1
- package/dist/channel.js +5 -1
- package/dist/channel.js.map +1 -1
- package/dist/cli.d.ts +16 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +75 -0
- package/dist/cli.js.map +1 -0
- package/dist/client-script.d.ts +3 -0
- package/dist/client-script.d.ts.map +1 -0
- package/dist/client-script.js +21 -0
- package/dist/client-script.js.map +1 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.generated.d.ts +4 -0
- package/dist/client.generated.d.ts.map +1 -0
- package/dist/client.generated.js +9 -0
- package/dist/client.generated.js.map +1 -0
- package/dist/client.js +12 -0
- package/dist/client.js.map +1 -0
- package/dist/headless/describe.d.ts +19 -0
- package/dist/headless/describe.d.ts.map +1 -0
- package/dist/headless/describe.js +255 -0
- package/dist/headless/describe.js.map +1 -0
- package/dist/headless/draw.d.ts +17 -0
- package/dist/headless/draw.d.ts.map +1 -0
- package/dist/headless/draw.js +25 -0
- package/dist/headless/draw.js.map +1 -0
- package/dist/headless/index.d.ts +99 -0
- package/dist/headless/index.d.ts.map +1 -0
- package/dist/headless/index.js +143 -0
- package/dist/headless/index.js.map +1 -0
- package/dist/headless/judge.d.ts +16 -0
- package/dist/headless/judge.d.ts.map +1 -0
- package/dist/headless/judge.js +52 -0
- package/dist/headless/judge.js.map +1 -0
- package/dist/headless/node.d.ts +8 -0
- package/dist/headless/node.d.ts.map +1 -0
- package/dist/headless/node.js +80 -0
- package/dist/headless/node.js.map +1 -0
- package/dist/headless/protocol.d.ts +71 -0
- package/dist/headless/protocol.d.ts.map +1 -0
- package/dist/headless/protocol.js +14 -0
- package/dist/headless/protocol.js.map +1 -0
- package/dist/headless/runtime.d.ts +2 -0
- package/dist/headless/runtime.d.ts.map +1 -0
- package/dist/headless/runtime.generated.d.ts +2 -0
- package/dist/headless/runtime.generated.d.ts.map +1 -0
- package/dist/headless/runtime.generated.js +8 -0
- package/dist/headless/runtime.generated.js.map +1 -0
- package/dist/headless/runtime.js +171 -0
- package/dist/headless/runtime.js.map +1 -0
- package/dist/headless/tree.d.ts +54 -0
- package/dist/headless/tree.d.ts.map +1 -0
- package/dist/headless/tree.js +128 -0
- package/dist/headless/tree.js.map +1 -0
- package/dist/host/css.d.ts +118 -0
- package/dist/host/css.d.ts.map +1 -0
- package/dist/host/css.js +963 -0
- package/dist/host/css.js.map +1 -0
- package/dist/host/draw-budget.d.ts +10 -0
- package/dist/host/draw-budget.d.ts.map +1 -0
- package/dist/host/draw-budget.js +29 -0
- package/dist/host/draw-budget.js.map +1 -0
- package/dist/host/frame.d.ts +19 -1
- package/dist/host/frame.d.ts.map +1 -1
- package/dist/host/frame.js +21 -2
- package/dist/host/frame.js.map +1 -1
- package/dist/host/index.d.ts +4 -3
- package/dist/host/index.d.ts.map +1 -1
- package/dist/host/index.js +7 -1
- package/dist/host/index.js.map +1 -1
- package/dist/host/kit.d.ts +6 -2
- package/dist/host/kit.d.ts.map +1 -1
- package/dist/host/kit.js +12 -5
- package/dist/host/kit.js.map +1 -1
- package/dist/host/links.d.ts +24 -0
- package/dist/host/links.d.ts.map +1 -0
- package/dist/host/links.js +35 -0
- package/dist/host/links.js.map +1 -0
- package/dist/host/manifest.d.ts +50 -0
- package/dist/host/manifest.d.ts.map +1 -0
- package/dist/host/manifest.js +103 -0
- package/dist/host/manifest.js.map +1 -0
- package/dist/host/open-draw.d.ts +44 -0
- package/dist/host/open-draw.d.ts.map +1 -0
- package/dist/host/open-draw.js +108 -0
- package/dist/host/open-draw.js.map +1 -0
- package/dist/host/open-judge.d.ts +53 -0
- package/dist/host/open-judge.d.ts.map +1 -0
- package/dist/host/open-judge.js +95 -0
- package/dist/host/open-judge.js.map +1 -0
- package/dist/host/open-render.d.ts +32 -0
- package/dist/host/open-render.d.ts.map +1 -0
- package/dist/host/open-render.js +262 -0
- package/dist/host/open-render.js.map +1 -0
- package/dist/host/press.d.ts +15 -0
- package/dist/host/press.d.ts.map +1 -0
- package/dist/host/press.js +156 -0
- package/dist/host/press.js.map +1 -0
- package/dist/host/react.d.ts +15 -2
- package/dist/host/react.d.ts.map +1 -1
- package/dist/host/react.js +13 -5
- package/dist/host/react.js.map +1 -1
- package/dist/host/session.d.ts +94 -1
- package/dist/host/session.d.ts.map +1 -1
- package/dist/host/session.js +103 -14
- package/dist/host/session.js.map +1 -1
- package/dist/host/theme.d.ts +14 -0
- package/dist/host/theme.d.ts.map +1 -0
- package/dist/host/theme.js +51 -0
- package/dist/host/theme.js.map +1 -0
- package/dist/host/view-runtime.generated.d.ts +2 -0
- package/dist/host/view-runtime.generated.d.ts.map +1 -0
- package/dist/host/view-runtime.generated.js +7 -0
- package/dist/host/view-runtime.generated.js.map +1 -0
- package/dist/host/view-source.d.ts +5 -0
- package/dist/host/view-source.d.ts.map +1 -0
- package/dist/host/view-source.js +39 -0
- package/dist/host/view-source.js.map +1 -0
- package/dist/host/view.d.ts +134 -0
- package/dist/host/view.d.ts.map +1 -0
- package/dist/host/view.js +381 -0
- package/dist/host/view.js.map +1 -0
- package/dist/host/views.d.ts +10 -0
- package/dist/host/views.d.ts.map +1 -0
- package/dist/host/views.js +15 -0
- package/dist/host/views.js.map +1 -0
- package/dist/host/worker-react.d.ts +51 -0
- package/dist/host/worker-react.d.ts.map +1 -0
- package/dist/host/worker-react.js +123 -0
- package/dist/host/worker-react.js.map +1 -0
- package/dist/host/worker-start.d.ts +49 -0
- package/dist/host/worker-start.d.ts.map +1 -0
- package/dist/host/worker-start.js +122 -0
- package/dist/host/worker-start.js.map +1 -0
- package/dist/host/worker.d.ts +17 -12
- package/dist/host/worker.d.ts.map +1 -1
- package/dist/host/worker.js +58 -117
- package/dist/host/worker.js.map +1 -1
- package/dist/host/writes.d.ts +49 -0
- package/dist/host/writes.d.ts.map +1 -0
- package/dist/host/writes.js +76 -0
- package/dist/host/writes.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/open-kit.d.ts +148 -0
- package/dist/open-kit.d.ts.map +1 -0
- package/dist/open-kit.js +321 -0
- package/dist/open-kit.js.map +1 -0
- package/dist/protocol.d.ts +109 -3
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +13 -0
- package/dist/protocol.js.map +1 -1
- package/dist/worker/harden.d.ts +13 -2
- package/dist/worker/harden.d.ts.map +1 -1
- package/dist/worker/harden.js +10 -4
- package/dist/worker/harden.js.map +1 -1
- package/dist/worker/natives.d.ts +1 -0
- package/dist/worker/natives.d.ts.map +1 -1
- package/dist/worker/natives.js +4 -0
- package/dist/worker/natives.js.map +1 -1
- package/dist/worker/view-global.d.ts +70 -0
- package/dist/worker/view-global.d.ts.map +1 -0
- package/dist/worker/view-global.js +264 -0
- package/dist/worker/view-global.js.map +1 -0
- package/dist/worker/view.d.ts +14 -0
- package/dist/worker/view.d.ts.map +1 -0
- package/dist/worker/view.js +64 -0
- package/dist/worker/view.js.map +1 -0
- package/package.json +30 -4
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { describeDrawing } from "./describe.js";
|
|
2
|
+
import { drawTranscript } from "./draw.js";
|
|
3
|
+
/** One refusal of the open kit's, said to the author of the view. */
|
|
4
|
+
export function sayRefusal(refusal) {
|
|
5
|
+
const element = "element" in refusal && refusal.element ? `<${refusal.element}>` : "";
|
|
6
|
+
const name = refusal.name ? ` ${refusal.name}` : "";
|
|
7
|
+
switch (refusal.reason) {
|
|
8
|
+
case "element":
|
|
9
|
+
return { at: `drawing ${element}`, says: `Not drawn: ${element} is not in the open kit.` };
|
|
10
|
+
case "attribute":
|
|
11
|
+
return { at: `drawing ${element}${name}`, says: `Not drawn: ${element || "an element"} does not take${name}.` };
|
|
12
|
+
case "value":
|
|
13
|
+
return { at: `drawing ${element}${name}`, says: `Not drawn: the value of${name} is not one the open kit takes.` };
|
|
14
|
+
case "url":
|
|
15
|
+
return { at: `drawing ${element}${name}`, says: `Not drawn: an address. A view loads nothing; an image is a data: image.` };
|
|
16
|
+
case "child":
|
|
17
|
+
return { at: `drawing ${element}`, says: `Not drawn: ${element} holds nothing.` };
|
|
18
|
+
case "record":
|
|
19
|
+
return { at: "drawing", says: "Not drawn: a record the drawing's format does not know." };
|
|
20
|
+
case "budget":
|
|
21
|
+
return { at: "drawing", says: "Not drawn: more nodes than a view may draw." };
|
|
22
|
+
case "css":
|
|
23
|
+
return { at: `stylesheet${name === " stylesheet" ? "" : name}`, says: `Not drawn: CSS the open kit leaves out${refusal.css ? ` (${refusal.css.reason}${refusal.css.name ? ` ${refusal.css.name}` : ""})` : ""}.` };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function judgeTranscript(transcript, input) {
|
|
27
|
+
const { limits } = input;
|
|
28
|
+
if (transcript.messages > limits.messages)
|
|
29
|
+
return { ok: false, reason: "flood", detail: `It sent ${transcript.messages} messages, more than the ${limits.messages} a view may send in a second.` };
|
|
30
|
+
const acts = new Set(input.acts);
|
|
31
|
+
for (const asked of transcript.asked) {
|
|
32
|
+
if (!acts.has(asked.name))
|
|
33
|
+
return { ok: false, reason: "act", detail: `It asks for the act "${asked.name}", which its manifest does not name.` };
|
|
34
|
+
}
|
|
35
|
+
const drawn = drawTranscript(transcript.renders, transcript.css, { maxNodes: limits.maxNodes });
|
|
36
|
+
if (drawn.over)
|
|
37
|
+
return { ok: false, reason: "nodes", detail: `It drew more than the ${limits.maxNodes.toLocaleString("en-US")} things a view may draw.` };
|
|
38
|
+
const said = describeDrawing(drawn.root, { props: input.props, places: input.places });
|
|
39
|
+
for (const act of said.acts) {
|
|
40
|
+
if (!acts.has(act))
|
|
41
|
+
return { ok: false, reason: "act", detail: `It binds a press to the act "${act}" (data-act), which its manifest does not name.` };
|
|
42
|
+
}
|
|
43
|
+
const problems = [...drawn.refused.map(sayRefusal), ...said.problems];
|
|
44
|
+
for (const went of transcript.went) {
|
|
45
|
+
if ("record" in went && !(input.props.node?.id === went.record || (input.props.nodes ?? []).some((node) => node.id === went.record)))
|
|
46
|
+
problems.push({ at: "navigate", says: `It goes to "${went.record}", which this seat was not shown: the host will not follow it.` });
|
|
47
|
+
if ("place" in went && !input.places.includes(went.place))
|
|
48
|
+
problems.push({ at: "navigate", says: `It goes to the place "${went.place}", which this app does not have.` });
|
|
49
|
+
}
|
|
50
|
+
return { ok: true, parts: said.parts, problems };
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=judge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"judge.js","sourceRoot":"","sources":["../../src/headless/judge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAgB3C,qEAAqE;AACrE,MAAM,UAAU,UAAU,CAAC,OAAoB;IAC7C,MAAM,OAAO,GAAG,SAAS,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACtF,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACpD,QAAQ,OAAO,CAAC,MAAM,EAAE,CAAC;QACvB,KAAK,SAAS;YACZ,OAAO,EAAE,EAAE,EAAE,WAAW,OAAO,EAAE,EAAE,IAAI,EAAE,cAAc,OAAO,0BAA0B,EAAE,CAAC;QAC7F,KAAK,WAAW;YACd,OAAO,EAAE,EAAE,EAAE,WAAW,OAAO,GAAG,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,OAAO,IAAI,YAAY,iBAAiB,IAAI,GAAG,EAAE,CAAC;QAClH,KAAK,OAAO;YACV,OAAO,EAAE,EAAE,EAAE,WAAW,OAAO,GAAG,IAAI,EAAE,EAAE,IAAI,EAAE,0BAA0B,IAAI,iCAAiC,EAAE,CAAC;QACpH,KAAK,KAAK;YACR,OAAO,EAAE,EAAE,EAAE,WAAW,OAAO,GAAG,IAAI,EAAE,EAAE,IAAI,EAAE,yEAAyE,EAAE,CAAC;QAC9H,KAAK,OAAO;YACV,OAAO,EAAE,EAAE,EAAE,WAAW,OAAO,EAAE,EAAE,IAAI,EAAE,cAAc,OAAO,iBAAiB,EAAE,CAAC;QACpF,KAAK,QAAQ;YACX,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,yDAAyD,EAAE,CAAC;QAC5F,KAAK,QAAQ;YACX,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,6CAA6C,EAAE,CAAC;QAChF,KAAK,KAAK;YACR,OAAO,EAAE,EAAE,EAAE,aAAa,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,yCAAyC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;IACvN,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,UAA8B,EAAE,KAAoB;IAClF,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,IAAI,UAAU,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,UAAU,CAAC,QAAQ,4BAA4B,MAAM,CAAC,QAAQ,+BAA+B,EAAE,CAAC;IACnM,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjC,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;QACrC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,wBAAwB,KAAK,CAAC,IAAI,sCAAsC,EAAE,CAAC;IACnJ,CAAC;IACD,MAAM,KAAK,GAAG,cAAc,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChG,IAAI,KAAK,CAAC,IAAI;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,yBAAyB,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,0BAA0B,EAAE,CAAC;IAC1J,MAAM,IAAI,GAAG,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACvF,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,gCAAgC,GAAG,iDAAiD,EAAE,CAAC;IACxJ,CAAC;IACD,MAAM,QAAQ,GAAuB,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1F,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,QAAQ,IAAI,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,KAAK,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,IAAI,CAAC,MAAM,gEAAgE,EAAE,CAAC,CAAC;QAC1Q,IAAI,OAAO,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,yBAAyB,IAAI,CAAC,KAAK,kCAAkC,EAAE,CAAC,CAAC;IAC5K,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HeadlessRun } from "./index.js";
|
|
2
|
+
export interface NodeIsolateOptions {
|
|
3
|
+
/** The thread's heap ceiling, in megabytes. 128 by default. */
|
|
4
|
+
readonly maxHeapMb?: number;
|
|
5
|
+
}
|
|
6
|
+
/** A `run` that gives each headless run a worker thread and a fresh, empty context of its own. */
|
|
7
|
+
export declare function nodeIsolate(options?: NodeIsolateOptions): HeadlessRun;
|
|
8
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/headless/node.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAmB,WAAW,EAAE,MAAM,YAAY,CAAC;AAE/D,MAAM,WAAW,kBAAkB;IACjC,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AA6BD,kGAAkG;AAClG,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,WAAW,CA6BzE"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* AN ISOLATE FOR A HEADLESS RUN, IN NODE (FR-95): `@graview/guest/headless/node`.
|
|
3
|
+
*
|
|
4
|
+
* The reference `run` for `runWorkerViewHeadless`, for tests, for
|
|
5
|
+
* `graview view check`, and for a Node host that has nothing better. Each
|
|
6
|
+
* run gets a worker thread of its own, with a memory ceiling, and in it a
|
|
7
|
+
* fresh V8 context made from nothing: the language's own globals and no
|
|
8
|
+
* others — no `process`, no `require`, no `fetch`, no sockets, no timers —
|
|
9
|
+
* with code from strings and WebAssembly refused. The script is run there
|
|
10
|
+
* with a deadline that covers the microtasks it queues, and only text comes
|
|
11
|
+
* back. Past the deadline the context is abandoned and the thread ended.
|
|
12
|
+
*
|
|
13
|
+
* A context is not a security boundary in Node's own words, and this does
|
|
14
|
+
* not lean on it alone: nothing of the thread's is put into the context to
|
|
15
|
+
* be climbed back out of, the view is hardened inside it as a worker's
|
|
16
|
+
* would be, and the thread is ended when the run is done. A host that runs
|
|
17
|
+
* views it did not write, at scale, should run them in an isolate built
|
|
18
|
+
* for it — workerd with no outbound network is what Graview Cloud uses.
|
|
19
|
+
*/
|
|
20
|
+
import { Worker } from "node:worker_threads";
|
|
21
|
+
/** What runs in the thread: the context, the script, the entry called once, and text back. */
|
|
22
|
+
const THREAD = `
|
|
23
|
+
const { parentPort, workerData } = require("node:worker_threads");
|
|
24
|
+
const vm = require("node:vm");
|
|
25
|
+
const { script, entry, input, timeoutMs } = workerData;
|
|
26
|
+
const deadline = Date.now() + timeoutMs;
|
|
27
|
+
const left = () => Math.max(1, deadline - Date.now());
|
|
28
|
+
const context = vm.createContext(Object.create(null), {
|
|
29
|
+
name: "graview headless view",
|
|
30
|
+
codeGeneration: { strings: false, wasm: false },
|
|
31
|
+
microtaskMode: "afterEvaluate",
|
|
32
|
+
});
|
|
33
|
+
try {
|
|
34
|
+
vm.runInContext(script, context, { timeout: left(), filename: "graview-headless-view.js" });
|
|
35
|
+
const read = vm.runInContext(
|
|
36
|
+
"(function () { var out; var run = globalThis[" + JSON.stringify(entry) + "]; if (typeof run === 'function') run(" + JSON.stringify(input) + ").then(function (text) { out = text; }); return function () { return out; }; })()",
|
|
37
|
+
context,
|
|
38
|
+
{ timeout: left() },
|
|
39
|
+
);
|
|
40
|
+
const text = read();
|
|
41
|
+
parentPort.postMessage(typeof text === "string" ? { ok: true, text } : { ok: false, reason: "isolate", error: "The view's run did not finish: it waits on something a headless run never gives it." });
|
|
42
|
+
} catch (error) {
|
|
43
|
+
const late = error !== null && typeof error === "object" && error.code === "ERR_SCRIPT_EXECUTION_TIMEOUT";
|
|
44
|
+
parentPort.postMessage({ ok: false, reason: late ? "slow" : "isolate", error: late ? "It ran past its deadline." : String(error && typeof error === "object" && "message" in error ? error.message : error).slice(0, 500) });
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
/** A `run` that gives each headless run a worker thread and a fresh, empty context of its own. */
|
|
48
|
+
export function nodeIsolate(options = {}) {
|
|
49
|
+
return (payload) => new Promise((resolve, reject) => {
|
|
50
|
+
const worker = new Worker(THREAD, {
|
|
51
|
+
eval: true,
|
|
52
|
+
workerData: { script: payload.script, entry: payload.entry, input: payload.input, timeoutMs: payload.timeoutMs },
|
|
53
|
+
resourceLimits: { maxOldGenerationSizeMb: options.maxHeapMb ?? 128 },
|
|
54
|
+
env: {},
|
|
55
|
+
stdout: true,
|
|
56
|
+
stderr: true,
|
|
57
|
+
});
|
|
58
|
+
let done = false;
|
|
59
|
+
const end = (settle) => {
|
|
60
|
+
if (done)
|
|
61
|
+
return;
|
|
62
|
+
done = true;
|
|
63
|
+
clearTimeout(timer);
|
|
64
|
+
void worker.terminate();
|
|
65
|
+
settle();
|
|
66
|
+
};
|
|
67
|
+
const refuse = (reason, message) => end(() => reject(Object.assign(new Error(message), { reason })));
|
|
68
|
+
/* The thread's own deadline covers the script and its microtasks; this one covers a thread that never answers. */
|
|
69
|
+
const timer = setTimeout(() => refuse("slow", "It ran past its deadline."), payload.timeoutMs + 500);
|
|
70
|
+
worker.once("message", (message) => {
|
|
71
|
+
if (message.ok && typeof message.text === "string")
|
|
72
|
+
end(() => resolve(message.text));
|
|
73
|
+
else
|
|
74
|
+
refuse(message.reason === "slow" ? "slow" : "isolate", message.error ?? "The isolate could not run it.");
|
|
75
|
+
});
|
|
76
|
+
worker.once("error", (error) => refuse("isolate", error.code === "ERR_WORKER_OUT_OF_MEMORY" ? "It used more memory than a headless run may." : error.message));
|
|
77
|
+
worker.once("exit", () => refuse("isolate", "The isolate stopped before it answered."));
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/headless/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ7C,8FAA8F;AAC9F,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwBd,CAAC;AAEF,kGAAkG;AAClG,MAAM,UAAU,WAAW,CAAC,UAA8B,EAAE;IAC1D,OAAO,CAAC,OAAwB,EAAE,EAAE,CAClC,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE;YAChC,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE;YAChH,cAAc,EAAE,EAAE,sBAAsB,EAAE,OAAO,CAAC,SAAS,IAAI,GAAG,EAAE;YACpE,GAAG,EAAE,EAAE;YACP,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,IAAI;SACb,CAAC,CAAC;QACH,IAAI,IAAI,GAAG,KAAK,CAAC;QACjB,MAAM,GAAG,GAAG,CAAC,MAAkB,EAAE,EAAE;YACjC,IAAI,IAAI;gBAAE,OAAO;YACjB,IAAI,GAAG,IAAI,CAAC;YACZ,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,KAAK,MAAM,CAAC,SAAS,EAAE,CAAC;YACxB,MAAM,EAAE,CAAC;QACX,CAAC,CAAC;QACF,MAAM,MAAM,GAAG,CAAC,MAA0B,EAAE,OAAe,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;QACjI,kHAAkH;QAClH,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,EAAE,OAAO,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC;QACrG,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,OAAoF,EAAE,EAAE;YAC9G,IAAI,OAAO,CAAC,EAAE,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ;gBAAE,GAAG,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAK,CAAC,CAAC,CAAC;;gBACjF,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,IAAI,+BAA+B,CAAC,CAAC;QAChH,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAG,KAA2B,CAAC,IAAI,KAAK,0BAA0B,CAAC,CAAC,CAAC,8CAA8C,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QACtL,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,yCAAyC,CAAC,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { DescribedPart, DescribedProblem } from "@graview/core/describe";
|
|
2
|
+
import type { GuestProps } from "../protocol.js";
|
|
3
|
+
/** The global function a headless script leaves for its isolate to call, once. */
|
|
4
|
+
export declare const HEADLESS_ENTRY = "graviewHeadless";
|
|
5
|
+
/** The global a headless script hands the view to, as a function, on its own last line: run at once. */
|
|
6
|
+
export declare const HEADLESS_VIEW = "graviewHeadlessView";
|
|
7
|
+
/** What a run is told, as the JSON text of `HeadlessPayload.input`. */
|
|
8
|
+
export interface HeadlessInput {
|
|
9
|
+
/** What the view is shown: the seat's sight cut to its manifest (FR-91). */
|
|
10
|
+
readonly props: GuestProps;
|
|
11
|
+
/** What the view may ask for or bind a press to, by the name it uses: the manifest's acts. */
|
|
12
|
+
readonly acts: readonly string[];
|
|
13
|
+
/** The app's places, by slug. */
|
|
14
|
+
readonly places: readonly string[];
|
|
15
|
+
readonly limits: {
|
|
16
|
+
readonly maxNodes: number;
|
|
17
|
+
readonly messages: number;
|
|
18
|
+
readonly pushMs: number;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** What the view said, in order: every message the host would have heard. */
|
|
22
|
+
export interface HeadlessTranscript {
|
|
23
|
+
/** Each batch of Remote DOM mutation records it sent. */
|
|
24
|
+
readonly renders: readonly unknown[][];
|
|
25
|
+
/** Its stylesheet, as it gave it. */
|
|
26
|
+
readonly css?: string;
|
|
27
|
+
/** The acts it asked for from its code. Nothing is applied in a headless run. */
|
|
28
|
+
readonly asked: readonly {
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly args: unknown;
|
|
31
|
+
}[];
|
|
32
|
+
/** Where it asked to go. */
|
|
33
|
+
readonly went: readonly ({
|
|
34
|
+
readonly record: string;
|
|
35
|
+
} | {
|
|
36
|
+
readonly place: string;
|
|
37
|
+
})[];
|
|
38
|
+
/** The view's own time, at the top of its script and over the push, as the isolate's clock says it. */
|
|
39
|
+
readonly ms: number;
|
|
40
|
+
/** What it wrote to the console, the first 50 lines. */
|
|
41
|
+
readonly logs: readonly string[];
|
|
42
|
+
/** How many messages it sent. */
|
|
43
|
+
readonly messages: number;
|
|
44
|
+
}
|
|
45
|
+
/** Why a headless run says a view will not do. The live host's reasons (`WorkerViewFailure`), and two of its own. */
|
|
46
|
+
export type HeadlessFailureReason = "manifest" | "source" | "refused" | "error" | "silent" | "nodes" | "flood" | "slow"
|
|
47
|
+
/** It names an act its manifest does not: asked from its code, or bound to a press (`data-act`). */
|
|
48
|
+
| "act"
|
|
49
|
+
/** The host's isolate could not run it, or answered with something that is not an outcome. */
|
|
50
|
+
| "isolate";
|
|
51
|
+
/** What an isolate answers, as the JSON text its entry resolves with. */
|
|
52
|
+
export type HeadlessOutcome = {
|
|
53
|
+
readonly ok: true;
|
|
54
|
+
readonly transcript: HeadlessTranscript;
|
|
55
|
+
/** What it drew, as the isolate read it. A host that has the transcript reads it again itself. */
|
|
56
|
+
readonly drawn: {
|
|
57
|
+
readonly parts: readonly DescribedPart[];
|
|
58
|
+
readonly problems: readonly DescribedProblem[];
|
|
59
|
+
};
|
|
60
|
+
/** How many names hardening took from the isolate's global, and whether it takes no new ones. */
|
|
61
|
+
readonly hardening: {
|
|
62
|
+
readonly removed: number;
|
|
63
|
+
readonly sealed: boolean;
|
|
64
|
+
};
|
|
65
|
+
} | {
|
|
66
|
+
readonly ok: false;
|
|
67
|
+
readonly reason: HeadlessFailureReason;
|
|
68
|
+
readonly detail: string;
|
|
69
|
+
readonly transcript?: HeadlessTranscript;
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/headless/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAYjD,kFAAkF;AAClF,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,wGAAwG;AACxG,eAAO,MAAM,aAAa,wBAAwB,CAAC;AAEnD,uEAAuE;AACvE,MAAM,WAAW,aAAa;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,8FAA8F;IAC9F,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,iCAAiC;IACjC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CACpG;AAED,6EAA6E;AAC7E,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,SAAS,OAAO,EAAE,EAAE,CAAC;IACvC,qCAAqC;IACrC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IAC7E,4BAA4B;IAC5B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IACrF,uGAAuG;IACvG,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,iCAAiC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,qHAAqH;AACrH,MAAM,MAAM,qBAAqB,GAC7B,UAAU,GACV,QAAQ,GACR,SAAS,GACT,OAAO,GACP,QAAQ,GACR,OAAO,GACP,OAAO,GACP,MAAM;AACR,oGAAoG;GAClG,KAAK;AACP,8FAA8F;GAC5F,SAAS,CAAC;AAEd,yEAAyE;AACzE,MAAM,MAAM,eAAe,GACvB;IACE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IACxC,kGAAkG;IAClG,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAA;KAAE,CAAC;IAC7G,iGAAiG;IACjG,QAAQ,CAAC,SAAS,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC;CAC5E,GACD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* WHAT A HOST AND A HEADLESS RUN SAY TO EACH OTHER (FR-95): text in, text
|
|
3
|
+
* out. The host hands its isolate one script and one JSON string; the
|
|
4
|
+
* isolate calls the script's entry with the string and hands back the
|
|
5
|
+
* string it resolves with. Nothing else crosses — no object, no function —
|
|
6
|
+
* so an isolate the host picked (workerd, a worker thread, a browser
|
|
7
|
+
* worker) is all a run needs, and the host's own context never runs a line
|
|
8
|
+
* of the view.
|
|
9
|
+
*/
|
|
10
|
+
/** The global function a headless script leaves for its isolate to call, once. */
|
|
11
|
+
export const HEADLESS_ENTRY = "graviewHeadless";
|
|
12
|
+
/** The global a headless script hands the view to, as a function, on its own last line: run at once. */
|
|
13
|
+
export const HEADLESS_VIEW = "graviewHeadlessView";
|
|
14
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/headless/protocol.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,kFAAkF;AAClF,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAEhD,wGAAwG;AACxG,MAAM,CAAC,MAAM,aAAa,GAAG,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/headless/runtime.ts"],"names":[],"mappings":"AA4BA,OAAO,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.generated.d.ts","sourceRoot":"","sources":["../../src/headless/runtime.generated.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,EAAE,MAAihpG,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* GENERATED by scripts/guest-view-runtime.mjs from src/headless/runtime.ts — do not edit.
|
|
3
|
+
* A headless run's runtime as one classic script (FR-95): `headlessScript` puts
|
|
4
|
+
* it in front of a view's own source, for an isolate the host picked.
|
|
5
|
+
* Carries Remote DOM (MIT, Shopify Inc.).
|
|
6
|
+
*/
|
|
7
|
+
export const HEADLESS_RUNTIME = "\"use strict\";\n/*! @remote-dom/core and @remote-dom/polyfill — Copyright 2020-present, Shopify Inc. — MIT License.\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * @graview/guest's worker runtime — Elastic License 2.0. */\n\"use strict\";(()=>{var A=Symbol(\"name\"),he=Symbol(\"prefix\"),ge=Symbol(\"value\"),C=Symbol(\"ns\"),Y=Symbol(\"owner\"),I=Symbol(\"owner_document\"),se=Symbol(\"attributes\"),D=Symbol(\"prev\"),S=Symbol(\"next\"),k=Symbol(\"child\"),q=Symbol(\"parent\"),ye=Symbol(\"host\"),Z=Symbol(\"data\"),we=Symbol(\"listeners\"),Dn=Symbol(\"isTrusted\"),Me=Symbol(\"path\"),Le=Symbol(\"stop_immediate_propagation\"),He=Symbol(\"dispatching\"),le=Symbol(\"content\"),M=Symbol(\"hooks\"),Rt=Symbol(\"extensions\"),Se=Symbol(\"hooks_dispatch\"),U=Symbol(\"is_connected\"),Ve=Symbol(\"create_element\"),Dr=0,X=1,Ue=2,je=3,ze=8,Oe=9,Mr=10,be=11,_=\"http://www.w3.org/1999/xhtml\",J=\"http://www.w3.org/2000/svg\",Lr=\"http://www.w3.org/XML/1998/namespace\",at=\"http://www.w3.org/2000/xmlns/\";function At(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function H(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function Hr(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function P(t,e){let n=globalThis.DOMException;if(typeof n==\"function\")return new n(t,e);let r=new Error(t);return r.name=e,r}var Vr=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,Ur=/[\\0\\t\\n\\f\\r />=]/u,Ts=/[\\0\\t\\n\\f\\r />]/u;function ce(t){if(t==null)return null;let e=String(t);return e===\"\"?null:e}function jr(t){Vr.test(t)||Ln(t)}function Mn(t){(t===\"\"||Ur.test(t))&&Ln(t)}function Ct(t,e,n){let r=ce(t),o=String(e),s=o.indexOf(\":\"),i=s<0?null:o.slice(0,s),l=s<0?o:o.slice(s+1);if((i!=null&&(i===\"\"||Ts.test(i))||(n===\"element\"?!Vr.test(l):l===\"\"||Ur.test(l)))&&Ln(o),i!=null&&r==null)throw P(`A namespace is required for the prefix in \"${o}\"`,\"NamespaceError\");if(i===\"xml\"&&r!==Lr)throw P(\"The xml prefix requires the XML namespace\",\"NamespaceError\");if((o===\"xmlns\"||i===\"xmlns\")&&r!==at)throw P(\"The xmlns name requires the XMLNS namespace\",\"NamespaceError\");if(r===at&&o!==\"xmlns\"&&i!==\"xmlns\")throw P(\"The XMLNS namespace requires the xmlns name or prefix\",\"NamespaceError\");return{namespace:r,qualifiedName:o,prefix:i,localName:l}}function Ln(t){throw P(`Invalid name: \"${t}\"`,\"InvalidCharacterError\")}var kt=0,_t=1,zr=2,Hn=3,xs=typeof performance>\"u\"?Date.now:performance.now.bind(performance),j=class{static NONE=kt;static CAPTURING_PHASE=_t;static AT_TARGET=zr;static BUBBLING_PHASE=Hn;timeStamp=xs();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=kt;[Me]=[];[Le]=!1;[He]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,Dn,{writable:!0,value:!1}),n&&(n.bubbles&&(this.bubbles=n.bubbles),n.cancelable&&(this.cancelable=n.cancelable),n.composed&&(this.composed=n.composed))}get isTrusted(){return this[Dn]}composedPath(){return[...this[Me]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[Le]=!0,this.cancelBubble=!0}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}set returnValue(e){e||this.preventDefault()}get returnValue(){return!this.defaultPrevented}initEvent(e,n,r){this.type=e,this.bubbles=!!n,this.cancelable=!!r}};function Vn(t,e,n){if(t.cancelBubble)return;let o=e[we]?.get(t.type)?.[n===_t?\"capture\":\"bubble\"];if(o)for(let s of[...o]){if(!o.has(s)||s.signal?.aborted)continue;t.eventPhase=t.target===e?zr:n,t.currentTarget=e;let i=s.normalizedListener;try{typeof i==\"object\"?i.handleEvent(t):i.call(e,t)}catch(l){setTimeout(ws,0,l)}if(t[Le])break}}function ws(t){throw t}var lt=[],Pt=new WeakMap;function It(t,e){let n=Pt.get(t);n?n.push(e):Pt.set(t,[e]),lt[lt.length-1].push(t)}function z(t){let e=[];lt.push(e);let n;try{n=t()}catch(r){lt.pop();try{$r(e)}catch{}throw r}return lt.pop(),$r(e),n}function $r(t){let e,n=!1;for(let r of t){let o=Pt.get(r);if(o){for(;o.length>0;){let s=o.shift();try{s()}catch(i){n||(e=i,n=!0)}}Pt.delete(r)}}if(n)throw e}var Dt=[],ct=[],Un=!1;function ve(t){for(let e of t)Dt.push(e),e[1]&&ct.push(e[1]);if(!Un){Un=!0;try{let e,n=!1;for(let r=0;r<Dt.length;r++){let[o,s]=Dt[r];s&&ct.splice(ct.indexOf(s),1);try{o()}catch(i){n||(e=i,n=!0)}}if(n)throw e}finally{Dt.length=0,ct.length=0,Un=!1}}}function ut(t){let e=t;for(;e;){if(ct.includes(e))return!0;e=e[q]??e[ye]}return!1}var dt=Symbol(\"listenerRegistrations\"),Ee=class{[we]=void 0;[dt]=void 0;[I]=void 0;addEventListener(e,n,r){if(n==null)return;let o=r===!0||typeof r==\"object\"&&r.capture===!0,s=typeof r==\"object\"&&r.once===!0,i=typeof r==\"object\"?r.signal:void 0;if(i?.aborted)return;let l=jn(o),u=this[dt];u||(u=new Map,this[dt]=u);let d=u.get(e);d||(d={},u.set(e,d));let p=d[l];if(p||(p=new Map,d[l]=p),p.has(n))return;let E=this,f={type:e,listener:n,capture:o,once:s,normalizedListener:n,signal:i};(s||i)&&(f.normalizedListener=function(...c){if(f.signal?.aborted){Mt(E,f);return}return f.once&&Mt(E,f),typeof f.listener==\"object\"?f.listener.handleEvent(...c):f.listener.call(this,...c)});let b=this[we];b||(b=new Map,this[we]=b);let N=b.get(e);N||(N={},b.set(e,N));let O=N[l];if(O||(O=new Set,N[l]=O),p.set(n,f),O.add(f),i){let y=()=>{Mt(E,f)};f.abortListener=y,i.addEventListener(\"abort\",y,{once:!0})}this[I]?.defaultView[Se].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return Ss.call(this,e,n,r)}dispatchEvent(e){if(e[He])throw P(\"Failed to execute 'dispatchEvent' on 'EventTarget': The event is already being dispatched.\",\"InvalidStateError\");e[He]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[Me]=n;for(let s=n.length;s--;)if(Vn(e,n[s],_t),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let s=0;s<o.length;s++)if(Vn(e,o[s],Hn),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[He]=!1,e.cancelBubble=!1,e[Le]=!1,e.eventPhase=kt,e.currentTarget=null,e[Me]=[]}}};function Ss(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=jn(!!r),s=this[dt]?.get(t)?.[o]?.get(e);s&&Mt(this,s)}function jn(t){return t?\"capture\":\"bubble\"}function Mt(t,e){let n=jn(e.capture),r=t[dt],o=r?.get(e.type);if(!o)return;let s=o[n];if(!s||s.get(e.listener)!==e)return;s.delete(e.listener),s.size===0&&delete o[n],!o.bubble&&!o.capture&&r?.delete(e.type),e.signal&&e.abortListener&&e.signal.removeEventListener(\"abort\",e.abortListener);let i=t[we],l=i?.get(e.type);if(!l)return;let u=l[n];u?.delete(e)&&(u.size===0&&delete l[n],!l.bubble&&!l.capture&&i?.delete(e.type),t[I]?.defaultView[Se].removeEventListener?.(t,e.type,e.listener,e.capture))}var Q=class extends Array{item(e){return this[e]??null}};var mt=0,Fr=1,Fn=2,Bn=3,pt=4,Br=0,Gr=1,Vt=2,Ut=3,Yr=4,$n=5,qr=6,Wr=7,Lt=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function Os(t,e){let n=1,r=null;for(let o=e;o<t.length;o++){let s=t[o];if(r){s===\"\\\\\"?o++:s===r&&(r=null);continue}if(s==='\"'||s===\"'\")r=s;else if(s===\"(\")n++;else if(s===\")\"&&--n===0)return[t.slice(e,o),o+1]}return[t.slice(e),t.length]}function W(t){throw P(`Invalid or unsupported selector: \"${t}\"`,\"SyntaxError\")}function jt(t,e){let n=typeof e==\"string\"?ht(e):[{combinator:pt,matchers:e}],r=null,o=t[k];return o&&n[0].matchers.length&&Gn(o,n,s=>(r=s,!1)),r}function zt(t,e){let n=typeof e==\"string\"?ht(e):[{combinator:pt,matchers:e}],r=new Q,o=t[k];return o&&n[0].matchers.length&&Gn(o,n,s=>{r.push(s)}),r}function ht(t,e=!1,n=!1){let r={combinator:pt,matchers:[]},o=[r],s=/[\\t\\n\\f\\r ]*?([>\\t\\n\\f\\r +~]?)[\\t\\n\\f\\r ]*?(?:(?:\\[[\\t\\n\\f\\r ]*([^\\]=\\t\\n\\f\\r ]+)[\\t\\n\\f\\r ]*(?:=[\\t\\n\\f\\r ]*(?:(['\"])(.*?)\\3|([^\\]\\t\\n\\f\\r ]+)))?[\\t\\n\\f\\r ]*(?:\\]|$))|([#.]?)([^\\t\\n\\f\\r #.[>:+~()]+)|:(\\w+)(\\()?)/gi,i=t.replace(/^[\\t\\n\\f\\r ]+|[\\t\\n\\f\\r ]+$/g,\"\");i===\"\"&&W(t);let l=0,u;for(;u=s.exec(i);){u.index!==l&&W(t),u[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&W(t),u[1]===\">\"?r.combinator=Fr:u[1]===\"+\"?r.combinator=Bn:u[1]===\"~\"?r.combinator=Fn:r.combinator=mt,r={combinator:pt,matchers:[]},o.push(r));let d=u[8]?H(u[8]):u[2]||u[7];u[7]!=null&&!u[6]&&r.matchers.length>0&&W(t);let E,f=u[4]??u[5]??u[7];if(u[2]){Lt.test(d)||W(t);let b=u[5],N=b?.[0];if(u[3]==null&&(N==='\"'||N===\"'\")){let O=u[0].lastIndexOf(b);f=i.slice(u.index+O+1),s.lastIndex=i.length}else b!=null&&!Lt.test(b)&&W(t);E=Yr}else u[6]?(Lt.test(d)||W(t),E=u[6]===\"#\"?Vt:Ut):u[8]?E=u[9]==null?$n:qr:u[7]===\"*\"?E=Br:u[7]&&Lt.test(u[7])?E=Gr:W(t);u[9]?([f,s.lastIndex]=Os(i,s.lastIndex),d!==\"has\"&&d!==\"not\"&&W(t),d===\"has\"&&e&&W(t),ht(f,e||d===\"has\",d===\"has\")):E===$n&&W(t),r.matchers.push({type:E,name:d,value:f}),l=s.lastIndex}return(l!==i.length||r.matchers.length===0)&&W(t),o}function vs(t,e){let n=ht(e);return n[0]?.matchers.length?ft(t,n):!1}function Rs(t,e){let n=ht(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=mt,s={type:Wr,name:\":scope\"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(s)):n.unshift({combinator:mt,matchers:[s]}),n.some(({matchers:u})=>u.length===0))return!1;let i=o===Bn||o===Fn?t[S]:t[k];if(!i)return!1;let l=!1;return Gn(i,n,()=>(l=!0,!1),t),l}function Gn(t,e,n,r){let o=[],s=t;for(;s;){if(G(s)){if(ft(s,e,r)&&n(s)===!1)return!1;let i=s[k];if(i){let l=s[S];l&&o.push(l),s=i;continue}}s=s[S]??o.pop()??null}return!0}function ft(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===pt){if(!Ht(t,o,n))return!1;let l=e.slice(0,-1);return l.length===0||ft(t,l,n)}let s=r===Fr||r===mt?q:D,i=t[s];if(!i)return!1;if(r===mt||r===Fn){for(;i;){if(G(i)&&Ht(i,o,n)){let l=e.slice(0,-1);if(l.length===0||ft(i,l,n))return!0}i=i[s]}return!1}else{if(r===Bn&&!G(i)){for(;i&&!G(i);)i=i[s];if(!i)return!1}if(!G(i)||!Ht(i,o,n))return!1;let l=e.slice(0,-1);return l.length===0||ft(i,l,n)}}function zn(t,e){return t.getAttributeNS(null,t.namespaceURI===_?H(e):e)}function Ht(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let i of e)if(Ht(t,i,n)===!1)return!1;return!0}let{type:r,name:o,value:s}=e;switch(r){case Br:return o===\"*\";case Gr:return t.namespaceURI===_?t.localName===H(o):t.localName===o;case Vt:return zn(t,\"id\")===o;case Ut:let i=zn(t,\"class\");return i?At(i).includes(o):!1;case Yr:let l=zn(t,o);return s==null?l!=null:l===s;case Wr:return t===n;case $n:W(`:${o}`);case qr:switch(o){case\"has\":return Rs(t,s||\"\");case\"not\":return!vs(t,s||\"\");default:W(`:${o}(${s})`)}}return!1}function As(t){return t.nodeType===Ue}function gt(t){return Z in t}function qn(t){return t.nodeType===je}function Cs(t){return t.nodeType===ze}function G(t){return t.nodeType===X}function Yn(t){return t.nodeType===be}function Jr(t){return\"appendChild\"in t}function $t(t){let e=[],n=[t],r=new Set(n),o=new Set,s;for(;n.length>0;){let i=n.pop();if(r.delete(i),o.has(i))continue;let l=[];for(let u of bt(i)){if(o.has(u)||(o.add(u),e.push(u),l.push(u),!G(u)))continue;let d=u[se];if(d)for(let E of d)o.has(E)||(o.add(E),e.push(E));let p=u[le];p&&!o.has(p)&&!r.has(p)&&(r.add(p),n.push(p))}s??=l}return{nodes:e,treeNodes:s}}function yt(t,e){for(let n of t)n[I]=e}function Xr(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[I]=e,r}function Kr(t,e){if(qn(t))return e.createTextNode(t.data);if(Cs(t))return e.createComment(t.data);if(As(t))return Xr(t,e);if(G(t)){let n=e[Ve](t[A],t.namespaceURI,t[he],t.localName);if(t[se])for(let r=0;r<t[se].length;r++){let o=t[se].item(r);n.attributes.setNamedItem(Xr(o,e))}return n}else{if(Yn(t))return e.createDocumentFragment();{let n=new t.constructor;return n[I]=e,n}}}function Ft(t,e,n=t.ownerDocument){if(t.nodeType===Oe)throw P(\"Cannot clone a document node\",\"NotSupportedError\");let r=Kr(t,n);if(!e||!G(t)&&!Yn(t))return r;let o=new Set([t]),s=[{source:t,destination:r,childIndex:0,cloningContent:!1}];for(;s.length>0;){let i=s[s.length-1],l,u;if(i.cloningContent)if(i.contentSource&&i.contentDestination)l=i.contentSource.childNodes[i.childIndex++],u=i.contentDestination;else{s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}else if(l=i.source.childNodes[i.childIndex++],u=i.destination,!l){if(i.cloningContent=!0,i.childIndex=0,G(i.source)&&i.source.namespaceURI===_&&i.source.localName===\"template\"){let p=i.source[le];p&&(o.has(p)&&Zr(),o.add(p),i.contentSource=p,i.contentDestination=i.destination.content)}continue}if(!l){s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}o.has(l)&&Zr(),o.add(l);let d=Kr(l,n);G(l)||Yn(l)?s.push({source:l,destination:d,appendTo:u,childIndex:0,cloningContent:!1}):u.appendChild(d)}return r}function Zr(){throw new Error(\"Cannot clone a cyclic or repeated node graph\")}function Bt(t,e){let n=String(e);return n===\"\"?null:jt(t,[{type:Vt,name:n}])}function Gt(t,e){let n=[...new Set(At(String(e)))];return zt(t,n.map(r=>({type:Ut,name:r})))}function Yt(t,e){let n=String(e),r=H(n),o=[];for(let s of qt(t))G(s)&&(n===\"*\"||(s.namespaceURI===_?s[A]===r:s[A]===n))&&o.push(s);return o}function qt(t){let e=[],n=[],r=t[k];for(;r;){e.push(r);let o=r[k],s=r[S];o?(s&&n.push(s),r=o):r=s??n.pop()??null}return e}function bt(t){let e=qt(t);return e.unshift(t),e}var ee=class extends Ee{nodeType=Dr;[A]=\"\";[q]=null;[ye]=null;[k]=null;[D]=null;[S]=null;[U]=!1;get[M](){return this[I].defaultView[Se]}get localName(){return this[A]}get nodeName(){return this[A]}get ownerDocument(){return this[I]}get isConnected(){return this[U]}isDefaultNamespace(e){let n=ce(e);return ks(this)===n}get parentNode(){return this[q]}set parentNode(e){}get parentElement(){let e=this[q];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[D]}set previousSibling(e){}get nextSibling(){return this[S]}set nextSibling(e){}get previousElementSibling(){let e=this[D];for(;e&&e.nodeType!==1;)e=e[D];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[S];for(;e&&e.nodeType!==1;)e=e[S];return e}set nextElementSibling(e){}get firstChild(){return this[k]}set firstChild(e){}get lastChild(){let e=this[k];for(;e;){let n=e[S];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return gt(this)?this.data:null}set nodeValue(e){gt(this)&&(this.data=e)}get textContent(){if(gt(this))return this.data;let e=\"\";for(let n of qt(this))qn(n)&&(e+=n.data);return e}set textContent(e){if(gt(this))this.data=e;else if(Jr(this)){let n=e==null?\"\":String(e);n===\"\"?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return Ft(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function ks(t){let e=t;for(;e;)switch(e.nodeType){case X:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS(at,\"xmlns\");if(r!=null&&r.prefix==null)return ce(r.value);e=n.parentElement;break}case Oe:e=e.documentElement;break;case Mr:case be:return null;case Ue:e=e.ownerElement;break;default:e=e.parentElement}return null}var te=Symbol(\"insertNode\"),Kn=Symbol(\"preflightInsertions\"),Wt=Symbol(\"replaceNode\"),Ne=class extends ee{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=Re(e),r=this.parentNode;if(r)return Wn(o=>{ue(r,n);let s=this[S];for(;s&&n.includes(s);)s=s[S];let i=Xn(r,n,o);this.parentNode===r?r[Wt](i,this,o):r[te](i,s,o)})}before(...e){let n=Re(e),r=this.parentNode;if(r)return Wn(o=>{ue(r,n);let s=this[D];for(;s&&n.includes(s);)s=s[D];let i=Xn(r,n,o);r[te](i,s?s[S]:r.firstChild,o)})}after(...e){let n=Re(e),r=this.parentNode;if(r)return Wn(o=>{ue(r,n);let s=this[S];for(;s&&n.includes(s);)s=s[S];let i=Xn(r,n,o);r[te](i,s,o)})}};function Wn(t){return z(()=>{let e=[];try{t(e)}catch(n){try{ve(e)}catch{}throw n}ve(e)})}function Re(t){return t.map(e=>e instanceof ee?e:String(e))}function Et(t,e){return e instanceof ee?e:t.ownerDocument.createTextNode(String(e))}function ue(t,e){for(let n of e){if(!(n instanceof ee))continue;let r=t;for(;r;){if(r===n)throw P(\"Cannot insert a node into itself or one of its descendants\",\"HierarchyRequestError\");r=r[q]??r[ye]}}}function Xn(t,e,n){let r=[];for(let s of e)r.push(Et(t,s));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[Kn](r);for(let s of r)o[te](s,null,n);return o}var Xt,Zn=0,Qr=0,eo=0,to=0,$e=!1,Qn=!1,Nt=!1,Kt=class{#t;#n=[];#e=new Set;#r=!1;constructor(e){if(typeof e!=\"function\")throw new TypeError(\"MutationObserver callback must be a function\");this.#t=e}observe(e,n={}){let r=_s(n),o=Xt??=new WeakMap,s=o.get(e);s==null&&(s=new Map,o.set(e,s));let i=s.get(this);i==null?Zn++:Jn(i,-1),s.set(this,r),Jn(r,1),this.#e.add(e)}disconnect(){let e=Xt;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),Zn--,Jn(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,Zn===0&&(Xt=void 0)}}takeRecords(){return this.#n.splice(0)}enqueue(e){this.#n.push(e),!this.#r&&(this.#r=!0,queueMicrotask(()=>{this.#r=!1;let n=this.takeRecords();n.length>0&&this.#t.call(this,n,this)}))}};function ne(t){let e=Xt;if(e==null)return;let n=new Map,r=t.target;for(;r;){let o=e.get(r);if(o)for(let[s,i]of o){if(r!==t.target&&!i.subtree)continue;let l=!1;if(t.type===\"attributes\"){if(!i.attributes||i.attributeFilter&&!i.attributeFilter.has(t.attributeName??\"\"))continue;l=i.attributeOldValue}else if(t.type===\"characterData\"){if(!i.characterData)continue;l=i.characterDataOldValue}else if(!i.childList)continue;n.set(s,n.get(s)===!0||l)}r=r.parentNode}for(let[o,s]of n)o.enqueue({addedNodes:t.addedNodes??new Q,attributeName:t.attributeName??null,attributeNamespace:t.attributeNamespace??null,nextSibling:t.nextSibling??null,oldValue:s?t.oldValue??null:null,previousSibling:t.previousSibling??null,removedNodes:t.removedNodes??new Q,target:t.target,type:t.type})}function Zt(...t){let e=new Q;return e.push(...t),e}function _s(t){if(t.attributes===!1&&(t.attributeOldValue||t.attributeFilter!=null))throw new TypeError(\"attributeOldValue and attributeFilter require attributes to be enabled\");if(t.characterData===!1&&t.characterDataOldValue)throw new TypeError(\"characterDataOldValue requires characterData to be enabled\");let e=t.attributes??(t.attributeOldValue===!0||t.attributeFilter!=null),n=t.characterData??t.characterDataOldValue===!0,r=t.childList===!0;if(!e&&!n&&!r)throw new TypeError(\"MutationObserver options must enable childList, attributes, or characterData\");return{attributes:e,attributeFilter:t.attributeFilter==null?void 0:new Set(t.attributeFilter.map(String)),attributeOldValue:t.attributeOldValue===!0,characterData:n,characterDataOldValue:t.characterDataOldValue===!0,childList:r,subtree:t.subtree===!0}}function Jn(t,e){t.attributes&&(Qr+=e),t.characterData&&(eo+=e),t.childList&&(to+=e),$e=Qr>0,Qn=eo>0,Nt=to>0}var ie=class extends Ne{childNodes=new Q;children=new Q;appendChild(e){return z(()=>this[te](e,null))}insertBefore(e,n){return z(()=>this[te](e,n||null))}append(...e){return z(()=>{let n=Re(e.filter(r=>r!=null));n.length>1&&ue(this,n);for(let r of n)this[te](Et(this,r),null)})}prepend(...e){return z(()=>{let n=Re(e.filter(o=>o!=null));n.length>1&&ue(this,n);let r=this.firstChild;for(let o of n)this[te](Et(this,o),r)})}replaceChildren(...e){return z(()=>{let n=Re(e.filter(o=>o!=null));ue(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[te](Et(this,o),null)})}removeChild(e){return z(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw P(\"The node is not a child of this node\",\"NotFoundError\");let n=this[U]?bt(e):void 0,r=e[D],o=e[S],s=Jt(this,e);if(n)for(let i of n)i[U]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,\"disconnectedCallback\"),ve(this.collectRemovalHookEffects(e,s))}replaceChild(e,n){return z(()=>this[Wt](e,n))}[Wt](e,n,r){if(ue(this,[e]),n.parentNode!==this)throw P(\"The reference node is not a child of this parent\",\"NotFoundError\");let o=n[D],s=n[S],i=this.prepareInsertion(e),l=this[U]?bt(n):void 0,u=new Set(i.map(({node:f})=>f)),d=s;for(;d&&u.has(d);)d=d[S];let p=Jt(this,n);if(l){for(let b of l)b[U]=!1;let f=new Set(l);for(let b of i)f.has(b.node)&&(b.shouldDisconnect=!1)}this.commitInsertion(i,d);let E=this[U];return this.queueRemovalMutationRecord(this,n,o,s),this.queueInsertionMutationRecords(i),l&&this.enqueueTreeReactions(l,\"disconnectedCallback\"),this.enqueueInsertionReactions(i,E),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,p),...this.collectInsertionHookEffects(i)],r),n}querySelectorAll(e){return zt(this,e)}querySelector(e){return jt(this,e)}[te](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[Kn](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(ue(this,[e]),n&&n.parentNode!==this)throw P(\"The reference node is not a child of this parent\",\"NotFoundError\")}insertIntoValidated(e,n,r){e===n&&(n=e[S]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let s=this[U];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,s),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):ve(e)}prepareInsertion(e){let n=[];if(e.nodeType===be){let i=e[k];for(;i;)n.push(i),i=i[S]}else n.push(e);let r=this[U],o=this[I],s=[];for(let i of n){let l=i[U],u=l||r,d,p;if(i[I]===o)u&&(d=bt(i));else{let E=$t(i);p=E.nodes,u&&(d=E.treeNodes)}s.push({node:i,nodes:d,adoption:p,shouldDisconnect:l})}return s}commitInsertion(e,n){for(let s of e){let i=s.node[q];if(i){let l=s.node[D],u=s.node[S];s.source={parent:i,index:Jt(i,s.node),previousSibling:l,nextSibling:u}}}for(let s of e){let i=this.attachChild(s.node,n);s.insertIndex=i.index,s.previousSibling=i.previousSibling,s.nextSibling=i.nextSibling}let r=this[I];for(let{adoption:s}of e)s&&yt(s,r);let o=this[U];for(let{nodes:s}of e)if(s)for(let i of s)i[U]=o}attachChild(e,n){if(n){let s=n[D];e[S]=n,e[D]=s,s?s[S]=e:this[k]=e,n[D]=e}else{e[S]=null;let s=this[k];if(s){let i;for(;i=s[S];)s=i;s[S]=e,e[D]=s}else this[k]=e,e[D]=null}let r=G(e);e[q]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let s=n;for(;s&&!G(s);)s=s[S];s?this.children.splice(this.children.indexOf(s),0,e):this.children.push(e)}}else o=this.childNodes.length,this.childNodes.push(e),r&&this.children.push(e);return{index:o,previousSibling:e[D],nextSibling:e[S]}}queueRemovalMutationRecord(e,n,r,o){Nt&&ne({type:\"childList\",target:e,removedNodes:Zt(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(Nt)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),ne({type:\"childList\",target:this,addedNodes:Zt(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==X||ut(this)?[]:[[()=>this[M].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:s}=r;s?.parent.nodeType===X&&!ut(s.parent)&&n.push([()=>s.parent[M].removeChild?.(s.parent,o,s.index)]),this.nodeType===X&&!ut(this)&&n.push([()=>this[M].insertChild?.(this,o,r.insertIndex),o])}return n}enqueueInsertionReactions(e,n){for(let r of e){let{nodes:o}=r;o&&(r.shouldDisconnect&&this.enqueueTreeReactions(o,\"disconnectedCallback\"),n&&this.enqueueTreeReactions(o,\"connectedCallback\"))}}enqueueTreeReactions(e,n){ro(e,n)}};function no(t,e,n,r){if(e.parentNode!==t)throw Error(\"not a child of this node\");let o=t[U]?n.treeNodes:void 0,s=e[D],i=e[S],l=Jt(t,e);if(o)for(let d of o)d[U]=!1;yt(n.nodes,r),Nt&&ne({type:\"childList\",target:t,removedNodes:Zt(e),previousSibling:s,nextSibling:i}),o&&ro(o,\"disconnectedCallback\");let u=[];t.nodeType===X&&!ut(t)&&u.push([()=>t[M].removeChild?.(t,e,l)]),ve(u)}function Jt(t,e){let n=e[D],r=e[S];n?n[S]=r:t[k]=r,r&&(r[D]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),G(e)&&t.children.splice(t.children.indexOf(e),1),e[q]=null,e[S]=null,e[D]=null,o}function ro(t,e){for(let n of t){let r=n[e];typeof r==\"function\"&&It(n,()=>r.call(n))}}function Tt(t,e,n,r,o){let{observedAttributes:s}=t.constructor,{attributeChangedCallback:i}=t;i==null||s==null||!s.includes(e)||It(t,()=>i.call(t,e,n,r,o))}var Qt=class{[k]=null;constructor(e){this[Y]=e}getNamedItem(e){let n=String(e),r=this[Y][C]===_?H(n):n,o=this[k];for(;o;){if(o.name===r)return o;o=o[S]}return null}getNamedItemNS(e,n){let r=ce(e),o=String(n),s=this[k];for(;s;){if(s.localName===o&&s[C]===r)return s;s=s[S]}return null}item(e){let n=this[k],r=0;for(;n;){if(r++===e)return n;n=n[S]}return null}get length(){let e=0,n=this[k];for(;n;)e++,n=n[S];return e}removeNamedItem(e){let n=String(e),r=this[Y][C]===_?H(n):n;return z(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ce(e),o=String(n);return z(()=>this.removeNamedItemImmediately(s=>s.localName===o&&s[C]===r))}removeNamedItemImmediately(e){let n=this[Y],r=this[k],o=null;for(;r!=null;){if(e(r)){o&&(o[S]=r[S]),this[k]===r&&(this[k]=r[S]);let s=r.value;return r[S]=null,r[Y]=null,$e&&ne({type:\"attributes\",target:n,attributeName:r.name,attributeNamespace:r[C],oldValue:s}),n[M].removeAttribute?.(n,r.name,r[C]),Tt(n,r.localName,s,null,r[C]),r}o=r,r=r[S]}return null}setNamedItem(e){return z(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[Y],r=e[Y];if(r!=null&&r!==n)throw P(\"The attribute is already in use by another element.\",\"InUseAttributeError\");let o=null,s=this[k],i=null;for(;s;){if(s.localName===e.localName&&s[C]===e[C]){if(s===e)return s;i?i[S]=e:this[k]=e,e[S]=s[S],s[S]=null,o=s;break}i=s,s=s[S]}o==null&&(i?i[S]=e:this[k]=e),e[Y]=n,e[I]=n[I],o&&(o[Y]=null);let l=o==null||o.value!==e.value,u=o!=null&&o.name!==e.name;return l&&$e&&ne({type:\"attributes\",target:n,attributeName:e.name,attributeNamespace:e[C],oldValue:o?.value??null}),u&&n[M].removeAttribute?.(n,o.name,o[C]),(l||u)&&n[M].setAttribute?.(n,e.name,e.value,e[C]),l&&Tt(n,e.localName,o?.value??null,e.value,e[C]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[k];for(;e;)yield e,e=e[S]}};var Ae=class extends ee{nodeType=Ue;[C]=null;[S]=null;[Y]=null;constructor(e,n,r){super(),this[A]=e,this[ge]=n,r&&(this[C]=r)}get nodeName(){return this[A]}set nodeName(e){}get name(){return this[A]}set name(e){}get localName(){if(this[C]==null)return this[A];let e=this[A].indexOf(\":\");return e<0?this[A]:this[A].slice(e+1)}get prefix(){if(this[C]==null)return null;let e=this[A].indexOf(\":\");return e<0?null:this[A].slice(0,e)}get value(){return this[ge]}set value(e){let n=String(e),r=this[Y];if(!r){this[ge]=n;return}z(()=>{let o=this[ge];this[ge]=n,$e&&o!==n&&ne({type:\"attributes\",target:r,attributeName:this[A],attributeNamespace:this[C],oldValue:o}),this[M].setAttribute?.(r,this[A],n,this[C]),Tt(r,this.localName,o,n,this[C])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[Y]}get namespaceURI(){return this[C]}get specified(){return!0}};var Ps={amp:\"&\",AMP:\"&\",apos:\"'\",gt:\">\",GT:\">\",lt:\"<\",LT:\"<\",quot:'\"',QUOT:'\"'},Is=new Set([\"area\",\"base\",\"br\",\"col\",\"embed\",\"hr\",\"img\",\"input\",\"link\",\"meta\",\"param\",\"source\",\"track\",\"wbr\"]),Ds=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>'\"=/\\s]+(?:=(['\"])[^]*?\\3|=[^>'\"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,io=/\\s([^<>'\"=/\\n\\s]+)(?:=([\"'])([\\s\\S]*?)\\2|=([^>'\"\\n\\s]*)|)/g,Ms=\"|b|big|blockquote|body|br|center|code|dd|div|dl|dt|em|embed|h1|h2|h3|h4|h5|h6|head|hr|i|img|li|listing|menu|meta|nobr|ol|p|pre|ruby|s|small|span|strong|strike|sub|sup|table|tt|u|ul|var|\",Ls=/^(?:color|face|size)$/i;function oo(t){return t.replace(/&(?:(amp|AMP|apos|gt|GT|lt|LT|quot|QUOT)|#(\\d+)|#[xX]([\\da-fA-F]+));/g,(e,n,r,o)=>{if(n)return Ps[n];let s=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(s)}catch{return e}})}function ao(t){return t.namespaceURI===_&&Is.has(t.localName)}function so(t){let e=t.localName;return t[C]===J&&(e===\"foreignObject\"||e===\"desc\"||e===\"title\")}function Hs(t,e){if(Ms.includes(`|${t}|`))return!0;if(t!==\"font\")return!1;for(let n of e.matchAll(io))if(Ls.test(n[1]))return!0;return!1}function en(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],s=r;for(let i of t.matchAll(Ds)){let l=i[1];if(l){let u=i[2],d=H(l),p=o[o.length-1]?.element??e,E=p[C]===J?J:_;if(d===\"svg\")E=J;else if(E===J){if(so(p))E=_;else if(Hs(d,u)){for(;o.length>0;){let N=o[o.length-1];if(N.element[C]!==J||so(N.element))break;o.pop(),s=N.target}E=_}}let f=E===_?d:l,b=n[Ve](f,E,null,f);for(let N of u.matchAll(io))b.setAttribute(N[1],oo(N[3]||N[4]||\"\"));if(s.append(b),ao(b)||E!==_&&i[4])continue;o.push({element:b,target:s}),s=E===_&&d===\"template\"?b.content:b}else if(i[5]){let u=H(i[5]);for(let d=o.length-1;d>=0;d--){let p=o[d],E=H(p.element[A]);if(E===u){s=p.target,o.length=d;break}if(p.element[C]===_&&E===\"template\")break}}else i[6]?s.append(n.createComment(i[6])):s.append(oo(i[7]))}return r}function tn(t){return co([{type:\"content\",child:t[k]}])}function lo(t){return co([{type:\"opening\",node:t}])}function co(t){let e=[],n;for(;n=t.pop();)switch(n.type){case\"opening\":{let r=n.node;switch(r.nodeType){case X:{let o=r;e.push(`<${o[A]}`);let s=o[se]?.[k];for(;s;){e.push(` ${s[A]}`);let l=s[ge];l!==\"\"&&(l=String(l).replace(/&/g,\"&\").replace(/\"/g,\""\"),e.push(`=\"${l}\"`)),s=s[S]}if(e.push(\">\"),ao(o))break;let i=o.namespaceURI===_&&o.localName===\"template\"?o[le]:o;t.push({type:\"closing\",name:o[A]}),t.push({type:\"content\",child:i?.[k]??null});break}case je:{let o=r;e.push(o[Z].replace(/&/g,\"&\").replace(/\"/g,\""\").replace(/</g,\"<\").replace(/>/g,\">\"));break}case ze:{let o=r;e.push(`<!--${o[Z]}-->`);break}}break}case\"content\":{let r=n.child;r&&(t.push({type:\"content\",child:r[S]}),t.push({type:\"opening\",node:r}));break}case\"closing\":e.push(`</${n.name}>`);break}return e.join(\"\")}var V=class extends ie{nodeType=X;[C]=_;[he]=null;get namespaceURI(){return this[C]}get prefix(){return this[he]}get localName(){let e=this[he];return e==null?this[A]:this[A].slice(e.length+1)}get nodeName(){return this[C]===_?Hr(this[A]):this[A]}get tagName(){return this.nodeName}get id(){return this.getAttributeNS(null,\"id\")??\"\"}set id(e){this.setAttribute(\"id\",String(e))}get slot(){return this.getAttributeNS(null,\"slot\")??\"\"}set slot(e){let n=String(e);this.getAttributeNS(null,\"slot\")!==n&&this.attributes.setNamedItem(new Ae(\"slot\",n))}get attributes(){let e=this[se];return e||(e=new Qt(this),this[se]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return Yt(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return Gt(this,e)}get lastElementChild(){return this.children[this.children.length-1]??null}get nextElementSibling(){let e=this.nextSibling;for(;e&&e.nodeType!==1;)e=e.nextSibling;return e}get previousElementSibling(){let e=this.previousSibling;for(;e&&e.nodeType!==1;)e=e.previousSibling;return e}setAttribute(e,n){let r=String(e),o=String(n);Mn(r);let s=this[C]===_?H(r):r,i=this.attributes.getNamedItemNS(null,s);i?i.value=o:this.attributes.setNamedItem(new Ae(s,o))}setAttributeNS(e,n,r){let o=ce(e),s=String(n),i=String(r),l=Ct(o,s,\"attribute\"),u=this.attributes.getNamedItemNS(l.namespace,l.localName);u?u.value=i:this.attributes.setNamedItemNS(new Ae(l.qualifiedName,i,l.namespace))}toggleAttribute(e,n){let r=String(e);Mn(r);let o=this[C]===_?H(r):r,s=this.attributes.getNamedItemNS(null,o),i=n===void 0?void 0:!!n;return s==null?i===!1?!1:(this.attributes.setNamedItem(new Ae(o,\"\")),!0):i===!0?!0:(this.attributes.removeNamedItemNS(null,o),!1)}getAttribute(e){let n=this.attributes.getNamedItem(e);return n&&n.value}getAttributeNS(e,n){let r=this.attributes.getNamedItemNS(e,n);return r&&r.value}hasAttribute(e){return this.attributes.getNamedItem(e)!=null}hasAttributeNS(e,n){return this.attributes.getNamedItemNS(e,n)!=null}removeAttribute(e){let n=String(e),r=this[C]===_?H(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return lo(this)}get innerHTML(){return tn(this)}set innerHTML(e){if(e==null||e===\"\")this.replaceChildren();else{let n=en(String(e),this);this.replaceChildren(n)}}};var Fe=class t extends V{[C]=J;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var Te=class extends Ne{[Z]=\"\";constructor(e){super(),this[Z]=e==null?\"\":String(e)}setData(e){let n=Qn,r=n?this[Z]:null,o=\"\";e!=null&&(o=typeof e==\"string\"?e:String(e)),this[Z]=o,n&&r!==o&&ne({type:\"characterData\",target:this,oldValue:r}),this[M].setText?.(this,o)}get data(){return this[Z]}set data(e){this.setData(e)}};var Be=class extends Te{nodeType=je;[A]=\"#text\"};var Ge=class extends Te{nodeType=ze;[A]=\"#comment\"};var Ye=class extends ie{nodeType=be;[A]=\"#document-fragment\";[I]=typeof window<\"u\"?window.document:null;getElementById(e){return Bt(this,e)}};var qe=class extends V{get content(){let e=this[le];return e||(e=this.ownerDocument.createDocumentFragment(),e[ye]=this,this[le]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(en(String(e),this))}get innerHTML(){let e=this[le];return e?tn(e):\"\"}};var nn=class extends V{};var rn=class extends V{};var on=class extends V{};var xt=class extends ie{nodeType=Oe;[A]=\"#document\";[U]=!0;constructor(e){super(),this.defaultView=e,this[I]=this,this.documentElement=an(new on,this,\"html\"),this.body=an(new nn,this,\"body\"),this.head=an(new rn,this,\"head\"),this.appendChild(this.documentElement),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body)}get textContent(){return null}set textContent(e){}getElementsByClassName(e){return Gt(this,e)}createElement(e){let n=String(e);return jr(n),er(this,H(n))}createElementNS(e,n){let r=Ct(e,n,\"element\");return er(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ve](e,n,r,o){return er(this,e,n,r,o)}createTextNode(e){let n=sn(new Be(e),this);return this[M].createText?.(n,n.data),n}createComment(e){return sn(new Ge(e),this)}createDocumentFragment(){return sn(new Ye,this)}createEvent(){return new j(\"\")}getElementById(e){return Bt(this,e)}getElementsByTagName(e){return Yt(this,e)}importNode(e,n){if(e.nodeType===Oe)throw P(\"Cannot import a document node\",\"NotSupportedError\");return Ft(e,n,this)}adoptNode(e){if(e[I]===this)return e;let n=$t(e);return z(()=>{let r=e.parentNode;return r?no(r,e,n,this):yt(n.nodes,this),e})}};function sn(t,e){return Object.defineProperty(t,I,{value:e,writable:!0,enumerable:!1}),t}function er(t,e,n=_,r=null,o=e){let s;if(n===J)s=new Fe;else if(n===_&&o===\"template\")s=new qe;else if(n===_){let i=t.defaultView.customElements.get(o);s=i?new i:new V}else s=new V;return an(s,t,e,n,r)}function an(t,e,n,r=_,o=null){return sn(t,e),Object.defineProperties(t,{[A]:{value:n},[C]:{value:r},[he]:{value:o}}),e[M].createElement?.(t,r),t}var ln=class extends j{constructor(e,n){super(e,n),this.detail=n?.detail??null}initCustomEvent(e,n,r,o){super.initEvent(e,n,r),this.detail=o??null}};var cn=class extends j{constructor(e,n){super(e,n),this.message=n.message,this.filename=n.filename,this.lineno=n.lineno,this.colno=n.colno,this.error=n.error}};var un=class extends j{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var dn=class extends j{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var fn=class extends j{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var mn=class extends j{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var pn=class extends V{};var Vs=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,Us=new Set([\"annotation-xml\",\"color-profile\",\"font-face\",\"font-face-src\",\"font-face-uri\",\"font-face-format\",\"font-face-name\",\"missing-glyph\"]);function uo(t){return Vs.test(t)&&!Us.has(t)}function fo(t){return P(`Invalid custom element name: \"${t}\"`,\"SyntaxError\")}var hn=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!uo(e))throw fo(e);if(this.registry.has(e))throw P(`A custom element named \"${e}\" has already been defined`,\"NotSupportedError\");if(this.getName(n)!=null)throw P(\"This constructor has already been registered in this custom element registry\",\"NotSupportedError\");this.registry.set(e,n);let o=this.listenersByName.get(e);if(o!=null){this.listenersByName.delete(e);for(let s of o)s(n)}}get(e){return this.registry.get(e)}getName(e){for(let[n,r]of this.registry)if(r===e)return n;return null}whenDefined(e){if(!uo(e))return Promise.reject(fo(e));let n=this.registry.get(e);if(n!=null)return Promise.resolve(n);let r=this.listenersByName.get(e);return r==null&&(r=[],this.listenersByName.set(e,r)),new Promise(o=>{r.push(o)})}upgrade(e){}initialize(e){}};var js=[\"onerror\",\"onunhandledrejection\"],po=Symbol.for(\"@remote-dom/polyfill/global-property\");function ho(t){return Object.getOwnPropertyDescriptors(t)}function go(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(Ee.prototype)))n!==\"constructor\"&&typeof r.value==\"function\"&&(r.value=tr(r.value.bind(t)),e[n]=r);return e}function yo(t){let e={};for(let n of js)e[n]={configurable:!0,enumerable:!0,get:tr(()=>t[n]),set:tr(r=>{t[n]=r})};return e}function zs(t){return Object.assign(ho(t),go(t),yo(t))}function tr(t){return Object.defineProperty(t,po,{value:!0}),t}function mo(t,e){for(let n of Reflect.ownKeys(e)){let r=$s(t,n);(r==null||Fs(r))&&Object.defineProperty(t,n,e[n])}}function $s(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function Fs(t){return[t.value,t.get,t.set].some(e=>typeof e==\"function\"&&e[po]===!0)}var Ce=class extends Ee{[M]={};[Rt]=[];[Se]=Gs(this);name=\"\";window=this;parent=this;self=this;top=this;document=new xt(this);customElements=new hn;location=globalThis.location;navigator=globalThis.navigator;Event=j;ErrorEvent=cn;PromiseRejectionEvent=un;ToggleEvent=dn;FocusEvent=fn;ClipboardEvent=mn;EventTarget=Ee;CustomEvent=ln;Node=ee;ParentNode=ie;ChildNode=Ne;DocumentFragment=Ye;Document=xt;CharacterData=Te;Comment=Ge;Text=Be;Element=V;HTMLElement=pn;SVGElement=Fe;HTMLTemplateElement=qe;MutationObserver=Kt;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)Bs(this,o)}}}get onerror(){return this.#n}set onerror(e){this.#t&&this.removeEventListener(\"error\",this.#t),e&&typeof e==\"function\"?(this.#n=e,this.#t=n=>{e(n.message??\"Error\",n.filename,n.lineno,n.colno,n.error)},this.addEventListener(\"error\",this.#t)):(this.#t=null,this.#n=null)}get onunhandledrejection(){return this.#e}set onunhandledrejection(e){this.#e&&this.removeEventListener(\"unhandledrejection\",this.#e),e&&typeof e==\"function\"?(this.#e=e,this.addEventListener(\"unhandledrejection\",this.#e)):this.#e=null}static setGlobal(e){let n=globalThis.self,r=globalThis.window,o=ho(e),s=Object.assign(go(e),yo(e));delete o.self,Object.defineProperties(globalThis,o),mo(globalThis,s),typeof n>\"u\"||n===r&&n!==globalThis?Object.defineProperty(globalThis,\"self\",{value:e,configurable:!0,writable:!0,enumerable:!0}):n!==globalThis&&(Object.defineProperties(n,o),mo(n,s))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,zs(e))}};function Bs(t,e){t[Rt].push(e(t)??{})}function Gs(t){return{createElement:de.bind(null,t,\"createElement\"),setAttribute:de.bind(null,t,\"setAttribute\"),removeAttribute:de.bind(null,t,\"removeAttribute\"),createText:de.bind(null,t,\"createText\"),setText:de.bind(null,t,\"setText\"),insertChild:de.bind(null,t,\"insertChild\"),removeChild:de.bind(null,t,\"removeChild\"),addEventListener:de.bind(null,t,\"addEventListener\"),removeEventListener:de.bind(null,t,\"removeEventListener\")}}function de(t,e,...n){for(let s of t[Rt])s[e]?.apply(s,n);let r=t[M];r[e]?.apply(r,n)}var gn=new Ce;var nr=\"~\";var xe=new WeakMap;function We(t){return xe.get(t)}var ir=new WeakMap,qs=0;function re(t){let e=ir.get(t);return e==null&&(e=String(qs++),yn(t,e)),e}function yn(t,e){ir.set(t,e)}var or=new WeakMap;function Ws(t){return or.get(t)}var sr=new WeakMap;function Xs(t){let e=sr.get(t);if(e!=null)return e;if(!(!(t instanceof Element)||t.tagName.includes(\"-\"))){e={};for(let{name:n,value:r}of t.attributes)e[n]=r;return e}}var Ks=new WeakMap;function Zs(t){return Ks.get(t)}function ar(t,e,n){let r=or.get(t);if(r==null&&(r={},or.set(t,r)),r[e]===n)return;r[e]=n;let o=xe.get(t);o?.mutate([[3,re(t),e,n,1]])}function bn(t,e,n){let r=sr.get(t);if(r==null&&(r={},sr.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=xe.get(t);o?.mutate([[3,re(t),e,n,2]])}function Xe(t,e){if(xe.get(t)!==e&&(xe.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)Xe(t.childNodes[r],e)}function En(t){if(xe.get(t)!=null&&(xe.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)En(t.childNodes[n])}function Ke(t){let{nodeType:e}=t;switch(e){case 1:return{id:re(t),type:e,element:t.localName,properties:rr(Ws(t)),attributes:rr(Xs(t)),eventListeners:rr(Zs(t)),children:Array.from(t.childNodes).map(Ke)};case 3:case 8:return{id:re(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function rr(t){return t?{...t}:void 0}function lr(t,e,...n){let r=ir.get(t),o=xe.get(t);if(r==null||o==null)throw new Error(`Cannot call method ${e} on an unconnected node`);return o.call(r,e,...n)}var Ze=gn[M];Ze.insertChild=(t,e,n)=>{let r=We(t);r!=null&&(Xe(e,r),r.mutate([[0,re(t),Ke(e),n]]))};Ze.removeChild=(t,e,n)=>{let r=We(t);r!=null&&(En(e),r.mutate([[1,re(t),n]]))};Ze.setText=(t,e)=>{let n=We(t);n?.mutate([[2,re(t),e]])};Ze.setAttribute=(t,e,n)=>{t.tagName.includes(\"-\")||bn(t,e,n)};Ze.removeAttribute=(t,e)=>{t.tagName.includes(\"-\")||bn(t,e)};Ce.setGlobal(gn);var No=[\"globalThis\",\"Infinity\",\"NaN\",\"undefined\",\"isFinite\",\"isNaN\",\"parseFloat\",\"parseInt\",\"decodeURI\",\"decodeURIComponent\",\"encodeURI\",\"encodeURIComponent\",\"escape\",\"unescape\",\"Object\",\"Function\",\"Array\",\"Number\",\"Boolean\",\"String\",\"Symbol\",\"BigInt\",\"Date\",\"Promise\",\"RegExp\",\"Math\",\"JSON\",\"Reflect\",\"Proxy\",\"Intl\",\"Error\",\"AggregateError\",\"EvalError\",\"RangeError\",\"ReferenceError\",\"SyntaxError\",\"TypeError\",\"URIError\",\"SuppressedError\",\"Map\",\"Set\",\"WeakMap\",\"WeakSet\",\"WeakRef\",\"FinalizationRegistry\",\"Iterator\",\"AsyncIterator\",\"DisposableStack\",\"AsyncDisposableStack\",\"ArrayBuffer\",\"SharedArrayBuffer\",\"DataView\",\"Atomics\",\"Int8Array\",\"Uint8Array\",\"Uint8ClampedArray\",\"Int16Array\",\"Uint16Array\",\"Int32Array\",\"Uint32Array\",\"Float16Array\",\"Float32Array\",\"Float64Array\",\"BigInt64Array\",\"BigUint64Array\"],To=[\"window\",\"parent\",\"top\",\"document\",\"customElements\",\"Event\",\"ErrorEvent\",\"PromiseRejectionEvent\",\"ToggleEvent\",\"FocusEvent\",\"ClipboardEvent\",\"CustomEvent\",\"EventTarget\",\"Node\",\"ParentNode\",\"ChildNode\",\"DocumentFragment\",\"Document\",\"CharacterData\",\"Comment\",\"Text\",\"Element\",\"HTMLElement\",\"SVGElement\",\"HTMLTemplateElement\",\"MutationObserver\"],xo=[\"self\",\"postMessage\",\"setTimeout\",\"clearTimeout\",\"setInterval\",\"clearInterval\",\"queueMicrotask\",\"structuredClone\",\"crypto\",\"console\",\"DOMException\"],wo=[\"TEMPORARY\",\"PERSISTENT\"],tu=Object.freeze([...No,...To,...xo,...wo]),nu=Object.freeze([\"constructor\",\"__defineGetter__\",\"__defineSetter__\",\"hasOwnProperty\",\"__lookupGetter__\",\"__lookupSetter__\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toString\",\"valueOf\",\"__proto__\",\"toLocaleString\"]),Eo=t=>typeof t==\"symbol\"?`[${t.description??\"symbol\"}]`:t;function So(t=globalThis,e=[],n={}){let r=[],o=[],s=new Set([...No,...To,...xo,...e,\"constructor\",Symbol.toStringTag]),i=(g,a)=>{let m=Reflect.getOwnPropertyDescriptor(g,a);return m===void 0||!(\"value\"in m)||m.writable||m.configurable?!1:n.primitivesStay&&typeof a==\"symbol\"&&(typeof m.value!=\"object\"||m.value===null)&&typeof m.value!=\"function\"?!0:wo.includes(a)&&typeof m.value==\"number\"},l=t,u=l.setTimeout,d=l.setInterval,p=l.crypto,E=(g,a)=>function(m,T,...x){if(typeof m!=\"function\")throw new TypeError(`${a} takes a function: a guest view cannot run code from text`);return g.call(t,m,T,...x)},f=p?Object.freeze({getRandomValues:g=>p.getRandomValues(g)}):void 0,b=l.document?.defaultView;if(b&&b!==l)for(let g of Reflect.ownKeys(b))typeof g==\"symbol\"||s.has(g)||Reflect.deleteProperty(b,g)||o.push(`window.${g}`);let N=[];for(let g=t;g&&g!==Object.prototype;g=Object.getPrototypeOf(g))N.push(g);for(let g of N)for(let a of Reflect.ownKeys(g))s.has(a)||(Reflect.deleteProperty(g,a)?r.push(Eo(a)):i(g,a)||o.push(Eo(a)));let O=()=>function(){throw new EvalError(\"A guest view cannot make code from text.\")},y=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let g of y){let a=O();Object.defineProperty(a,\"prototype\",{value:g,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(g,\"constructor\",{value:a,writable:!1,enumerable:!1,configurable:!1})||o.push(\"Function.prototype.constructor\"),g===Function.prototype&&Reflect.defineProperty(t,\"Function\",{value:a,writable:!0,enumerable:!1,configurable:!0})}let c=(g,a)=>{Reflect.defineProperty(t,g,{value:a,writable:!0,enumerable:!0,configurable:!0})||o.push(g)};c(\"setTimeout\",E(u,\"setTimeout\")),c(\"setInterval\",E(d,\"setInterval\")),f&&c(\"crypto\",f);for(let g of N.slice(1))Object.freeze(g);for(let g of Reflect.ownKeys(t)){let a=Reflect.getOwnPropertyDescriptor(t,g);Reflect.defineProperty(t,g,\"value\"in a?{...a,writable:!1,configurable:!1}:{...a,configurable:!1})}let h;try{h=Reflect.preventExtensions(t)}catch{h=!1}return{removed:r,stuck:o,sealed:h}}var wt=class extends HTMLElement{constructor(){super(),yn(this,nr)}connect(e){if(We(this)===e||(Xe(this,e),this.childNodes.length===0))return;let n=[];for(let r=0;r<this.childNodes.length;r++){let o=this.childNodes[r];n.push([0,nr,Ke(o),r])}e.mutate(n)}updateRemoteProperty(e,n){ar(this,e,n)}callRemoteMethod(e,...n){return lr(this,e,...n)}};var w={},cr={empty:!0},Js={id:\"text\",class:\"text\",title:\"text\",lang:\"text\",dir:{oneOf:[\"ltr\",\"rtl\",\"auto\"]},hidden:\"text\",tabindex:{oneOf:[\"-1\",\"0\"]},role:\"text\",style:\"style\",translate:{oneOf:[\"yes\",\"no\"]},spellcheck:{oneOf:[\"true\",\"false\"]},draggable:{oneOf:[\"true\",\"false\"]},inert:\"boolean\"},Qe={div:w,section:w,article:w,aside:w,header:w,footer:w,nav:w,hgroup:w,search:w,address:w,figure:w,figcaption:w,blockquote:w,p:w,pre:w,hr:cr,br:cr,wbr:cr,h1:w,h2:w,h3:w,h4:w,h5:w,h6:w,span:w,strong:w,em:w,b:w,i:w,u:w,s:w,small:w,mark:w,abbr:w,cite:w,q:w,code:w,kbd:w,samp:w,var:w,sub:w,sup:w,dfn:w,bdi:w,bdo:w,ruby:w,rt:w,rp:w,time:{attributes:{datetime:\"text\"}},data:{attributes:{value:\"text\"}},del:{attributes:{datetime:\"text\"}},ins:{attributes:{datetime:\"text\"}},a:w,ul:w,menu:w,dl:w,dt:w,dd:w,ol:{attributes:{start:\"number\",reversed:\"boolean\",type:{oneOf:[\"1\",\"a\",\"A\",\"i\",\"I\"]}}},li:{attributes:{value:\"number\"}},table:w,caption:w,thead:w,tbody:w,tfoot:w,tr:w,colgroup:{attributes:{span:\"number\"}},col:{attributes:{span:\"number\"},empty:!0},th:{attributes:{colspan:\"number\",rowspan:\"number\",headers:\"text\",scope:{oneOf:[\"row\",\"col\",\"rowgroup\",\"colgroup\"]},abbr:\"text\"}},td:{attributes:{colspan:\"number\",rowspan:\"number\",headers:\"text\"}},details:{attributes:{open:\"boolean\",name:\"text\"}},summary:w,button:{attributes:{type:{oneOf:[\"button\"]},disabled:\"boolean\",name:\"text\",value:\"text\"}},input:{empty:!0,attributes:{type:{oneOf:[\"text\",\"search\",\"number\",\"range\",\"checkbox\",\"radio\",\"date\",\"time\",\"datetime-local\",\"month\",\"week\",\"color\",\"email\",\"tel\",\"url\"]},name:\"text\",value:\"text\",placeholder:\"text\",min:\"text\",max:\"text\",step:\"text\",checked:\"boolean\",disabled:\"boolean\",readonly:\"boolean\",required:\"boolean\",maxlength:\"number\",minlength:\"number\",size:\"number\",pattern:\"text\",multiple:\"boolean\",inputmode:\"text\",enterkeyhint:\"text\"}},select:{attributes:{name:\"text\",disabled:\"boolean\",multiple:\"boolean\",required:\"boolean\",size:\"number\"}},option:{attributes:{value:\"text\",selected:\"boolean\",disabled:\"boolean\",label:\"text\"}},optgroup:{attributes:{label:\"text\",disabled:\"boolean\"}},textarea:{attributes:{name:\"text\",placeholder:\"text\",rows:\"number\",cols:\"number\",disabled:\"boolean\",readonly:\"boolean\",required:\"boolean\",maxlength:\"number\",minlength:\"number\",wrap:{oneOf:[\"soft\",\"hard\",\"off\"]}}},label:{attributes:{for:\"text\"}},fieldset:{attributes:{disabled:\"boolean\",name:\"text\"}},legend:w,output:w,meter:{attributes:{value:\"number\",min:\"number\",max:\"number\",low:\"number\",high:\"number\",optimum:\"number\"}},progress:{attributes:{value:\"number\",max:\"number\"}},img:{empty:!0,attributes:{src:\"image\",alt:\"text\",width:\"number\",height:\"number\",decoding:{oneOf:[\"async\",\"sync\",\"auto\"]}}}},Qs=[\"fill\",\"fill-opacity\",\"fill-rule\",\"stroke\",\"stroke-width\",\"stroke-linecap\",\"stroke-linejoin\",\"stroke-dasharray\",\"stroke-dashoffset\",\"stroke-opacity\",\"stroke-miterlimit\",\"opacity\",\"color\",\"display\",\"visibility\",\"transform-origin\",\"clip-path\",\"clip-rule\",\"marker-start\",\"marker-mid\",\"marker-end\",\"font-family\",\"font-size\",\"font-weight\",\"font-style\",\"text-anchor\",\"dominant-baseline\",\"alignment-baseline\",\"letter-spacing\",\"text-decoration\",\"paint-order\",\"vector-effect\",\"shape-rendering\",\"pointer-events\",\"stop-color\",\"stop-opacity\",\"overflow\",\"mask\"],ei={id:\"text\",class:\"text\",style:\"style\",lang:\"text\",role:\"text\",tabindex:{oneOf:[\"-1\",\"0\"]},transform:\"geometry\",...Object.fromEntries(Qs.map(t=>[t,\"css\"]))},Je={x:\"geometry\",y:\"geometry\",width:\"geometry\",height:\"geometry\"},Nn={viewBox:\"geometry\",preserveAspectRatio:\"geometry\"},Oo={gradientUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},gradientTransform:\"geometry\",spreadMethod:{oneOf:[\"pad\",\"reflect\",\"repeat\"]},href:\"fragment\"},Tn={svg:{attributes:{...Je,...Nn}},g:w,defs:w,symbol:{attributes:{...Je,...Nn,refX:\"geometry\",refY:\"geometry\"}},use:{attributes:{...Je,href:\"fragment\"}},title:w,desc:w,path:{attributes:{d:\"geometry\",pathLength:\"number\"}},rect:{attributes:{...Je,rx:\"geometry\",ry:\"geometry\",pathLength:\"number\"}},circle:{attributes:{cx:\"geometry\",cy:\"geometry\",r:\"geometry\",pathLength:\"number\"}},ellipse:{attributes:{cx:\"geometry\",cy:\"geometry\",rx:\"geometry\",ry:\"geometry\",pathLength:\"number\"}},line:{attributes:{x1:\"geometry\",y1:\"geometry\",x2:\"geometry\",y2:\"geometry\",pathLength:\"number\"}},polyline:{attributes:{points:\"geometry\",pathLength:\"number\"}},polygon:{attributes:{points:\"geometry\",pathLength:\"number\"}},text:{attributes:{x:\"geometry\",y:\"geometry\",dx:\"geometry\",dy:\"geometry\",rotate:\"geometry\",textLength:\"geometry\",lengthAdjust:{oneOf:[\"spacing\",\"spacingAndGlyphs\"]}}},tspan:{attributes:{x:\"geometry\",y:\"geometry\",dx:\"geometry\",dy:\"geometry\",rotate:\"geometry\",textLength:\"geometry\"}},textPath:{attributes:{href:\"fragment\",startOffset:\"geometry\",method:{oneOf:[\"align\",\"stretch\"]},spacing:{oneOf:[\"auto\",\"exact\"]},side:{oneOf:[\"left\",\"right\"]}}},linearGradient:{attributes:{x1:\"geometry\",y1:\"geometry\",x2:\"geometry\",y2:\"geometry\",...Oo}},radialGradient:{attributes:{cx:\"geometry\",cy:\"geometry\",r:\"geometry\",fx:\"geometry\",fy:\"geometry\",fr:\"geometry\",...Oo}},stop:{attributes:{offset:\"geometry\"}},clipPath:{attributes:{clipPathUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},mask:{attributes:{...Je,maskUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},maskContentUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},pattern:{attributes:{...Je,...Nn,patternUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},patternContentUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},patternTransform:\"geometry\",href:\"fragment\"}},marker:{attributes:{...Nn,markerWidth:\"geometry\",markerHeight:\"geometry\",refX:\"geometry\",refY:\"geometry\",orient:\"geometry\",markerUnits:{oneOf:[\"strokeWidth\",\"userSpaceOnUse\"]}}}};var vo=[\"alert\",\"alertdialog\",\"dialog\",\"banner\",\"main\",\"navigation\",\"contentinfo\",\"complementary\",\"search\",\"form\",\"region\",\"application\",\"status\",\"log\",\"marquee\",\"timer\"],St={nav:\"div\",header:\"div\",footer:\"div\",aside:\"div\",search:\"div\",output:\"span\"},xn={section:[\"aria-label\",\"aria-labelledby\",\"title\"]};function ti(t){return/^aria-[a-z]+$/.test(t)}function ni(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var Ro=[\"display\",\"position\",\"top\",\"right\",\"bottom\",\"left\",\"inset\",\"inset-block\",\"inset-inline\",\"inset-block-start\",\"inset-block-end\",\"inset-inline-start\",\"inset-inline-end\",\"width\",\"height\",\"min-width\",\"min-height\",\"max-width\",\"max-height\",\"inline-size\",\"block-size\",\"min-inline-size\",\"min-block-size\",\"max-inline-size\",\"max-block-size\",\"margin\",\"margin-top\",\"margin-right\",\"margin-bottom\",\"margin-left\",\"margin-block\",\"margin-inline\",\"margin-block-start\",\"margin-block-end\",\"margin-inline-start\",\"margin-inline-end\",\"padding\",\"padding-top\",\"padding-right\",\"padding-bottom\",\"padding-left\",\"padding-block\",\"padding-inline\",\"padding-block-start\",\"padding-block-end\",\"padding-inline-start\",\"padding-inline-end\",\"box-sizing\",\"overflow\",\"overflow-x\",\"overflow-y\",\"overflow-wrap\",\"float\",\"clear\",\"z-index\",\"aspect-ratio\",\"object-fit\",\"object-position\",\"vertical-align\",\"isolation\",\"contain\",\"container\",\"container-type\",\"container-name\",\"content-visibility\",\"flex\",\"flex-direction\",\"flex-wrap\",\"flex-flow\",\"flex-grow\",\"flex-shrink\",\"flex-basis\",\"order\",\"grid\",\"grid-template\",\"grid-template-columns\",\"grid-template-rows\",\"grid-template-areas\",\"grid-auto-columns\",\"grid-auto-rows\",\"grid-auto-flow\",\"grid-area\",\"grid-column\",\"grid-row\",\"grid-column-start\",\"grid-column-end\",\"grid-row-start\",\"grid-row-end\",\"gap\",\"row-gap\",\"column-gap\",\"align-items\",\"align-content\",\"align-self\",\"justify-items\",\"justify-content\",\"justify-self\",\"place-items\",\"place-content\",\"place-self\",\"columns\",\"column-count\",\"column-width\",\"column-rule\",\"column-rule-color\",\"column-rule-style\",\"column-rule-width\",\"column-span\",\"column-fill\",\"color\",\"background\",\"background-color\",\"background-image\",\"background-position\",\"background-position-x\",\"background-position-y\",\"background-size\",\"background-repeat\",\"background-origin\",\"background-clip\",\"background-attachment\",\"background-blend-mode\",\"border\",\"border-top\",\"border-right\",\"border-bottom\",\"border-left\",\"border-block\",\"border-inline\",\"border-block-start\",\"border-block-end\",\"border-inline-start\",\"border-inline-end\",\"border-width\",\"border-style\",\"border-color\",\"border-top-width\",\"border-right-width\",\"border-bottom-width\",\"border-left-width\",\"border-top-style\",\"border-right-style\",\"border-bottom-style\",\"border-left-style\",\"border-top-color\",\"border-right-color\",\"border-bottom-color\",\"border-left-color\",\"border-radius\",\"border-top-left-radius\",\"border-top-right-radius\",\"border-bottom-right-radius\",\"border-bottom-left-radius\",\"border-start-start-radius\",\"border-start-end-radius\",\"border-end-start-radius\",\"border-end-end-radius\",\"border-collapse\",\"border-spacing\",\"outline\",\"outline-width\",\"outline-style\",\"outline-color\",\"outline-offset\",\"box-shadow\",\"opacity\",\"visibility\",\"mix-blend-mode\",\"filter\",\"backdrop-filter\",\"clip-path\",\"accent-color\",\"caret-color\",\"color-scheme\",\"appearance\",\"-webkit-appearance\",\"font\",\"font-family\",\"font-size\",\"font-weight\",\"font-style\",\"font-stretch\",\"font-variant\",\"font-variant-numeric\",\"font-variant-caps\",\"font-variant-ligatures\",\"font-feature-settings\",\"font-variation-settings\",\"font-kerning\",\"font-optical-sizing\",\"font-size-adjust\",\"font-synthesis\",\"line-height\",\"letter-spacing\",\"word-spacing\",\"text-align\",\"text-align-last\",\"text-indent\",\"text-transform\",\"text-decoration\",\"text-decoration-line\",\"text-decoration-color\",\"text-decoration-style\",\"text-decoration-thickness\",\"text-underline-offset\",\"text-underline-position\",\"text-shadow\",\"text-overflow\",\"text-wrap\",\"text-wrap-mode\",\"text-wrap-style\",\"white-space\",\"white-space-collapse\",\"word-break\",\"line-break\",\"hyphens\",\"tab-size\",\"direction\",\"unicode-bidi\",\"writing-mode\",\"text-orientation\",\"text-rendering\",\"-webkit-font-smoothing\",\"-webkit-line-clamp\",\"-webkit-box-orient\",\"line-clamp\",\"-webkit-text-fill-color\",\"-webkit-background-clip\",\"list-style\",\"list-style-type\",\"list-style-position\",\"content\",\"quotes\",\"counter-reset\",\"counter-increment\",\"counter-set\",\"table-layout\",\"caption-side\",\"empty-cells\",\"transform\",\"transform-origin\",\"transform-box\",\"transform-style\",\"translate\",\"rotate\",\"scale\",\"perspective\",\"perspective-origin\",\"backface-visibility\",\"transition\",\"transition-property\",\"transition-duration\",\"transition-timing-function\",\"transition-delay\",\"transition-behavior\",\"animation\",\"animation-name\",\"animation-duration\",\"animation-timing-function\",\"animation-delay\",\"animation-iteration-count\",\"animation-direction\",\"animation-fill-mode\",\"animation-play-state\",\"animation-composition\",\"will-change\",\"cursor\",\"pointer-events\",\"user-select\",\"-webkit-user-select\",\"touch-action\",\"resize\",\"scroll-behavior\",\"overscroll-behavior\",\"overscroll-behavior-x\",\"overscroll-behavior-y\",\"scroll-snap-type\",\"scroll-snap-align\",\"scroll-snap-stop\",\"scroll-margin\",\"scroll-padding\",\"scrollbar-width\",\"scrollbar-color\",\"scrollbar-gutter\",\"fill\",\"fill-opacity\",\"fill-rule\",\"stroke\",\"stroke-width\",\"stroke-linecap\",\"stroke-linejoin\",\"stroke-dasharray\",\"stroke-dashoffset\",\"stroke-opacity\",\"stroke-miterlimit\",\"stop-color\",\"stop-opacity\",\"clip-rule\",\"marker\",\"marker-start\",\"marker-mid\",\"marker-end\",\"paint-order\",\"vector-effect\",\"shape-rendering\",\"text-anchor\",\"dominant-baseline\",\"alignment-baseline\",\"r\",\"cx\",\"cy\",\"rx\",\"ry\",\"x\",\"y\",\"d\",\"mask\"],Ao=[\"var\",\"env\",\"calc\",\"min\",\"max\",\"clamp\",\"round\",\"mod\",\"rem\",\"abs\",\"sign\",\"sin\",\"cos\",\"tan\",\"asin\",\"acos\",\"atan\",\"atan2\",\"pow\",\"sqrt\",\"hypot\",\"log\",\"exp\",\"rgb\",\"rgba\",\"hsl\",\"hsla\",\"hwb\",\"lab\",\"lch\",\"oklab\",\"oklch\",\"color\",\"color-mix\",\"light-dark\",\"linear-gradient\",\"radial-gradient\",\"conic-gradient\",\"repeating-linear-gradient\",\"repeating-radial-gradient\",\"repeating-conic-gradient\",\"translate\",\"translatex\",\"translatey\",\"translatez\",\"translate3d\",\"rotate\",\"rotatex\",\"rotatey\",\"rotatez\",\"rotate3d\",\"scale\",\"scalex\",\"scaley\",\"scalez\",\"scale3d\",\"skew\",\"skewx\",\"skewy\",\"matrix\",\"matrix3d\",\"perspective\",\"cubic-bezier\",\"steps\",\"linear\",\"repeat\",\"minmax\",\"fit-content\",\"blur\",\"brightness\",\"contrast\",\"drop-shadow\",\"grayscale\",\"hue-rotate\",\"invert\",\"saturate\",\"sepia\",\"opacity\",\"circle\",\"ellipse\",\"inset\",\"polygon\",\"path\",\"xywh\",\"rect\",\"counter\",\"counters\"],Co=[\"fill\",\"stroke\",\"clip-path\",\"mask\",\"marker\",\"marker-start\",\"marker-mid\",\"marker-end\"],ko=[\"media\",\"supports\",\"container\",\"keyframes\"],_o={position:[\"static\",\"relative\",\"absolute\"],appearance:[\"auto\",\"none\",\"menulist-button\",\"textfield\"],\"-webkit-appearance\":[\"auto\",\"none\",\"menulist-button\",\"textfield\"]},Po=[\"host\",\"host-context\",\"slotted\",\"part\",\"backdrop\",\"picker\",\"view-transition\",\"view-transition-group\",\"view-transition-image-pair\",\"view-transition-old\",\"view-transition-new\"],ur=64e3,dr=4e3,Io=1e5,Do=512e3,fr=1e4,Mo=\"http://www.w3.org/1999/xhtml\",Lo=\"http://www.w3.org/2000/svg\",ri=new Map(Object.keys(Tn).map(t=>[t.toLowerCase(),t]));function wn(t){return ri.get(t.toLowerCase())}function Sn(t,e,n){let r=n.toLowerCase(),o=t===\"html\"?[Qe[e]?.attributes,Js]:[Tn[e]?.attributes,ei],s=t===\"svg\"&&r===\"xlink:href\"?\"href\":r;for(let i of o)if(i){for(let[l,u]of Object.entries(i))if(l.toLowerCase()===s)return{name:l,kind:u}}if(ti(r)||ni(r))return{name:r,kind:\"text\"}}var Ho=\"~\",On=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t),ae=(t,e=0)=>{if(t===null||typeof t==\"string\"||typeof t==\"number\"||typeof t==\"boolean\"||t===void 0)return t;if(!(e>64||typeof t!=\"object\"))return Array.isArray(t)?t.map(n=>ae(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,ae(r,e+1)]))};function Vo(){let t=new Map,e=new Map,n=new Map([[Ho,{children:[],listeners:new Map}]]),r=0,o=d=>{let p=e.get(d);return p===void 0&&(p=r+=1,e.set(d,p),t.set(p,{listener:d,count:0})),t.get(p).count+=1,p},s=d=>{let p=t.get(d);p&&(p.count-=1,!(p.count>0)&&(t.delete(d),e.delete(p.listener)))},i=d=>{let p=n.get(d);if(p){n.delete(d);for(let E of p.listeners.values())s(E);for(let E of p.children)i(E)}},l=(d,p,E=0)=>{if(!On(d)||E>64)return ae(d);let f=typeof d.id==\"string\"?d.id:void 0,b=p&&f!==void 0&&f!==Ho;b&&i(f);let N={children:[],listeners:new Map};b&&n.set(f,N);let O={};for(let[y,c]of Object.entries(d))y===\"children\"&&Array.isArray(c)?O[y]=c.map(h=>{let g=l(h,b,E+1);return b&&On(h)&&typeof h.id==\"string\"&&N.children.push(h.id),g}):y===\"eventListeners\"&&On(c)?O[y]=Object.fromEntries(Object.entries(c).map(([h,g])=>{if(typeof g!=\"function\"||!b)return[h,void 0];let a=o(g);return N.listeners.set(h,a),[h,{listener:a}]})):O[y]=ae(c,E+1);return O},u=d=>{if(!Array.isArray(d))return ae(d);let[p,E]=d,f=typeof E==\"string\"?n.get(E):void 0;if(p===0){let b=l(d[2],f!==void 0),N=On(d[2])?d[2].id:void 0;if(f&&typeof N==\"string\"&&n.has(N)){let O=Number(d[3]);f.children.splice(Number.isInteger(O)&&O>=0&&O<=f.children.length?O:f.children.length,0,N)}return[p,ae(E),b,ae(d[3])]}if(p===1){let b=Number(d[2]);return f&&Number.isInteger(b)&&b>=0&&b<f.children.length&&i(f.children.splice(b,1)[0]),ae(d)}if(p===3&&d[4]===3){let b=String(d[2]),N=d[3],O=f&&typeof N==\"function\"?o(N):void 0,y=f?.listeners.get(b);return y!==void 0&&s(y),O===void 0?f?.listeners.delete(b):f.listeners.set(b,O),[p,ae(E),b,O===void 0?void 0:{listener:O},3]}return ae(d)};return{encode:d=>d.map(u),listener:d=>t.get(d)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var mr=\"graview-view-root\",oi=t=>t.replace(/&/g,\"&\").replace(/</g,\"<\").replace(/>/g,\">\").replace(/\"/g,\""\").replace(/'/g,\"'\"),si=t=>Object.freeze({html:t,toString:()=>t}),Uo=t=>typeof t==\"object\"&&t!==null&&typeof t.html==\"string\"&&Object.isFrozen(t),jo=t=>t==null||t===!1?\"\":Array.isArray(t)?t.map(jo).join(\"\"):Uo(t)?t.html:oi(String(t));function zo(t){customElements.get(mr)||customElements.define(mr,wt);let e=Event,n=Vo(),r=new Set,o=new Set,s,i=[],l=document.createElement(mr),u=a=>{let m=T=>{for(let x of Array.from(T.childNodes)){if(x.nodeType!==1)continue;if(re(x)===a)return x;let v=m(x);if(v)return v}};return m(l)},d=a=>{let m=u(a.target);if(!m)return;let T=new e(a.event,{bubbles:!0});for(let x of[\"value\",\"checked\",\"key\",\"pressed\"])a[x]!==void 0&&Object.defineProperty(T,x,{value:a[x],enumerable:!0});m.dispatchEvent(T);for(let x of o){if(x.type!==a.event)continue;let v;try{v=new Set(Array.from(l.querySelectorAll(x.selector)))}catch{continue}for(let R=m;R&&R!==l;R=R.parentNode)if(v.has(R)){x.listener(Object.freeze({type:a.event,target:m,element:R,...a.value!==void 0?{value:a.value}:{},...a.checked!==void 0?{checked:a.checked}:{},...a.key!==void 0?{key:a.key}:{},...a.pressed!==void 0?{pressed:a.pressed}:{}}));break}}},p=a=>{if(a.type===\"dom-event\"&&typeof a.target==\"string\")return d(a);if(a.type!==\"props\")return;s=a.props;let m=t.now();for(let v of r)try{v(a.props)}catch(R){t.threw(R)}let T=t.now()-m,x=a.push;typeof x==\"number\"&&t.microtask(()=>t.microtask(()=>t.send({type:\"pushed\",push:x,ms:T})))},E;l.connect({mutate(a){E||(E=[],t.microtask(()=>{let m=E??[];E=void 0,t.send({type:\"render\",records:n.encode(m)})})),E.push(...a)},call:()=>{}});let f=a=>a.nodeType===1?a.getAttribute(\"data-key\")??a.getAttribute(\"id\"):null,b=(a,m)=>a.nodeType===m.nodeType&&(a.nodeType!==1||a.localName===m.localName&&a.namespaceURI===m.namespaceURI&&f(a)===f(m));function N(a,m){let T=Array.from(m.childNodes),x=0;for(let v of T){let R=a.childNodes[x]??null;if(R&&b(R,v)){O(R,v),x+=1;continue}if(f(v)!==null){let pe=Array.from(a.childNodes).slice(x+1).find(it=>b(it,v));if(pe){a.insertBefore(pe,R),O(pe,v),x+=1;continue}}a.insertBefore(v,R),x+=1}for(;a.childNodes.length>x;)a.removeChild(a.lastChild)}function O(a,m){if(a.nodeType!==1){a.data!==m.data&&(a.data=m.data);return}let T=a,x=m;for(let v of T.getAttributeNames())x.hasAttribute(v)||T.removeAttribute(v);for(let v of x.getAttributeNames()){let R=x.getAttribute(v);T.getAttribute(v)!==R&&T.setAttribute(v,R)}N(T,x)}function y(a,m,T){for(let x of Array.from(a.childNodes)){if(x.nodeType!==1)continue;let v=x,R=v.localName,st=m||R.toLowerCase()===\"svg\",pe=st?wn(R):Object.prototype.hasOwnProperty.call(Qe,R.toLowerCase())?R.toLowerCase():void 0;if(!pe){T.add(`<${R}>`);continue}for(let it of v.getAttributeNames())(!Sn(st?\"svg\":\"html\",pe,it)||!st&&xn[pe]?.includes(it.toLowerCase()))&&T.add(`${pe} ${it}`);y(v,st,T)}}function c(a){let m=document.createElement(\"div\"),T=Array.isArray(a)?a:[a];for(let v of T)if(v!=null)if(typeof v==\"string\"||Uo(v)){let R=document.createElement(\"div\");R.innerHTML=typeof v==\"string\"?v:v.html,m.append(...Array.from(R.childNodes))}else m.append(v);let x=new Set;y(m,!1,x),i=[...x],i.length>0&&t.warn(`The host will not draw: ${i.join(\", \")}`),N(l,m)}let h;return{view:Object.freeze({get props(){return s},onProps(a){return r.add(a),s&&a(s),()=>void r.delete(a)},render:c,style(a){typeof a!=\"string\"||a===h||(h=a,t.send({type:\"style\",css:a}))},on(a,m,T){let x={type:a,selector:m,listener:T};return o.add(x),()=>void o.delete(x)},act:(a,m={})=>t.act(a,m),navigate(a){typeof a==\"string\"?t.navigate(a):a&&typeof a.place==\"string\"&&t.send({type:\"navigate\",place:a.place})},html(a,...m){return si(a.reduce((T,x,v)=>T+x+(v<m.length?jo(m[v]):\"\"),\"\"))},get refused(){return i},get hardening(){return t.hardening()}}),hear:p}}var ii=\"http://www.w3.org/1999/xhtml\",et=class{constructor(e){this.ownerDocument=e}parentNode=null;childNodes=[];get firstChild(){return this.childNodes[0]??null}get parentElement(){return this.parentNode instanceof _e?this.parentNode:null}get textContent(){return this.childNodes.map(e=>e.textContent).join(\"\")}insertBefore(e,n){e.parentNode&&e.parentNode.removeChild(e);let r=n?this.childNodes.indexOf(n):-1;return r<0?this.childNodes.push(e):this.childNodes.splice(r,0,e),e.parentNode=this,e}appendChild(e){return this.insertBefore(e,null)}removeChild(e){let n=this.childNodes.indexOf(e);return n>=0&&this.childNodes.splice(n,1),e.parentNode=null,e}},ke=class extends et{constructor(n,r){super(n);this.data=r}nodeType=3;get textContent(){return this.data}},pr=class extends et{nodeType=8;get textContent(){return\"\"}},_e=class extends et{constructor(n,r,o){super(n);this.namespaceURI=r;this.localName=o}nodeType=1;attributes=new Map;value=\"\";checked=!1;selected=!1;setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.get(n)??null}hasAttribute(n){return this.attributes.has(n)}closest(n){for(let r=this;r;r=r.parentElement)if(r.localName===n)return r;return null}},hr=class extends et{nodeType=9;constructor(){super(null)}createElementNS(e,n){return new _e(this,e,n)}createElement(e){return new _e(this,ii,e)}createTextNode(e){return new ke(this,e)}createComment(e){return new pr(this)}};function $o(){let t=new hr,e=t.createElement(\"div\");return e.setAttribute(\"data-graview-view-root\",\"\"),t.appendChild(e),{document:t,root:e}}var gr={h1:1,h2:2,h3:3,h4:4,h5:5,h6:6},Fo=new Set([\"a\",\"abbr\",\"b\",\"bdi\",\"bdo\",\"br\",\"cite\",\"code\",\"data\",\"del\",\"dfn\",\"em\",\"i\",\"ins\",\"kbd\",\"q\",\"s\",\"samp\",\"small\",\"span\",\"strong\",\"sub\",\"sup\",\"time\",\"u\",\"var\",\"wbr\",\"label\"]),Bo=new Set([\"style\",\"template\",\"datalist\",\"option\"]),L=t=>t.replace(/\\s+/g,\" \").trim(),K=t=>t instanceof _e,Ot=t=>t.hasAttribute(\"hidden\")||t.getAttribute(\"aria-hidden\")===\"true\";function $(t){return t instanceof ke?t.data:!K(t)||Ot(t)||Bo.has(t.localName)?\"\":t.localName===\"br\"?\" \":t.localName===\"img\"?t.getAttribute(\"alt\")??\"\":t.childNodes.map($).join(t.localName===\"td\"||t.localName===\"th\"?\" \":\"\")}function*Pe(t){for(let e of t.childNodes)K(e)&&(yield e,yield*Pe(e))}function Go(t,e){let n=[],r=new Set,o=new Set,s=new Map;for(let f of[...e.props.node?[e.props.node]:[],...e.props.nodes??[]])s.set(f.id,f);let i=new Set(e.places);for(let f of Pe(t)){let b=f.getAttribute(\"data-act\");b!==null&&r.add(b);let N=f.getAttribute(\"data-record\");N!==null&&(o.add(N),s.has(N)||n.push({at:`drawing <${f.localName} data-record=\"${N}\">`,says:`It names \"${N}\", which this seat was not shown: the host will not follow it.`}));let O=f.getAttribute(\"data-place\");O!==null&&!i.has(O)&&n.push({at:`drawing <${f.localName} data-place=\"${O}\">`,says:`It names the place \"${O}\", which this app does not have.`})}let l=f=>{let b=f.getAttribute(\"data-record\");if(b!==null)return b;let N=f.getAttribute(\"data-key\")??f.getAttribute(\"id\");if(N!==null&&s.has(N))return N;let O=new Set;for(let y of Pe(f)){let c=y.getAttribute(\"data-record\");c!==null&&O.add(c)}return O.size===1?[...O][0]:void 0},u=(f,b)=>{let N=s.get(b),O=N?.kind??(b.includes(\":\")?b.slice(0,b.indexOf(\":\")):\"\"),y=[...Pe(f)],c=y.find(a=>a.localName in gr)??y.find(a=>a.localName===\"a\"&&a.getAttribute(\"data-record\")===b)??y.find(a=>a.localName===\"strong\"||a.localName===\"b\"),h=L(c?$(c):\"\")||N?.label||b,g=p(f,c);return!c&&g[0]?.t===\"text\"&&L(g[0].text)===h&&g.shift(),{id:b,kind:O,title:h,parts:g}},d=f=>{let b=[...Pe(f)].filter(c=>c.localName===\"tr\"&&!Ot(c)),N=b.find(c=>c.parentElement?.localName===\"thead\"||c.childNodes.every(h=>!K(h)||h.localName===\"th\")),O=N?N.childNodes.filter(K).map(c=>L($(c))):[];return{t:\"list\",as:\"row\",columns:1,groups:[{items:b.filter(c=>c!==N).map(c=>{let h=c.childNodes.filter(K),g=l(c),a=g?s.get(g):void 0;return{id:g??\"\",kind:a?.kind??\"\",title:L($(h[0]??c)),parts:h.slice(1).map((m,T)=>({t:\"field\",label:O[T+1]??\"\",text:L($(m))}))}})}]}};function p(f,b){let N=[],O=\"\",y=()=>{let h=L(O);O=\"\",h&&N.push({t:\"text\",text:h})},c=f.childNodes;for(let h=0;h<c.length;h+=1){let g=c[h];if(g===b)continue;if(g instanceof ke){O+=g.data;continue}if(!K(g)||Ot(g)||Bo.has(g.localName))continue;if(b&&[...Pe(g)].includes(b)){y(),N.push(...p(g,b));continue}let a=[];for(let m=h;m<c.length;m+=1){let T=c[m];if(T instanceof ke&&L(T.data)===\"\")continue;if(!K(T)||Ot(T)||Fo.has(T.localName)||T.localName in gr)break;let x=l(T);if(!x)break;a.push({element:T,id:x}),h=m}if(a.length>0){y();let m=a.every(T=>T.element.localName===\"li\"||T.element.localName===\"tr\");N.push({t:\"list\",as:m?\"row\":\"card\",columns:1,groups:[{items:a.map(T=>u(T.element,T.id))}]});continue}N.push(...E(g,m=>O+=m,y))}return y(),N}function E(f,b,N){let O=f.localName;if(Fo.has(O)&&O!==\"label\")return b($(f)),[];if(O===\"mark\"){N();let c=L($(f));return c?[{t:\"badge\",text:c}]:[]}N();let y=gr[O]??(f.getAttribute(\"role\")===\"heading\"?Number(f.getAttribute(\"aria-level\")??2):void 0);if(y!==void 0){let c=L($(f));return c?[{t:\"heading\",level:y,text:c}]:[]}switch(O){case\"ul\":case\"ol\":case\"menu\":return[{t:\"list\",as:\"row\",columns:1,groups:[{items:f.childNodes.filter(h=>K(h)&&h.localName===\"li\"&&!Ot(h)).map(h=>{let g=l(h);if(g)return u(h,g);let a=p(h),m=a[0],T=m&&(m.t===\"text\"||m.t===\"heading\")?m.text:\"\";return{id:\"\",kind:\"\",title:T,parts:T?a.slice(1):a}})}]}];case\"table\":return[d(f)];case\"dl\":{let c=[],h=\"\";for(let g of f.childNodes.filter(K))if(g.localName===\"dt\")h=L($(g));else if(g.localName===\"dd\")c.push({t:\"field\",label:h,text:L($(g))});else if(g.localName===\"div\")for(let a of g.childNodes.filter(K))a.localName===\"dt\"?h=L($(a)):a.localName===\"dd\"&&c.push({t:\"field\",label:h,text:L($(a))});return c}case\"figure\":{let c=f.childNodes.find(a=>K(a)&&a.localName===\"figcaption\"),h=L(f.childNodes.filter(a=>a!==c).map($).join(\" \")),g=c?L($(c)):\"\";return h?[{t:\"figure\",text:h,...g?{label:g}:{}}]:g?[{t:\"text\",text:g}]:[]}case\"meter\":case\"progress\":{let c=Number(f.getAttribute(\"value\")??0),h=Number(f.getAttribute(\"max\")??1)||1;return[{t:\"progress\",label:f.getAttribute(\"aria-label\")??f.getAttribute(\"title\")??\"\",text:`${Math.round(c/h*100)}%`}]}case\"svg\":{let c=f.childNodes.find(a=>K(a)&&a.localName===\"title\"),h=L(f.getAttribute(\"aria-label\")??(c?$(c):\"\"));if(h)return[{t:\"text\",text:h,tone:\"picture\"}];let g=[...Pe(f)].filter(a=>a.localName===\"text\").map(a=>L($(a))).filter(Boolean);return g.length>0?[{t:\"text\",text:g.join(\" \\xB7 \"),tone:\"picture\"}]:[]}case\"img\":{let c=L(f.getAttribute(\"alt\")??\"\");return c?[{t:\"text\",text:c,tone:\"picture\"}]:[]}case\"button\":{let c=L($(f));return c?[{t:\"text\",text:c,tone:\"button\"}]:[]}case\"input\":case\"textarea\":case\"select\":{let c=L(f.getAttribute(\"aria-label\")??f.getAttribute(\"placeholder\")??f.getAttribute(\"name\")??\"\"),h=O===\"select\"?L($(f.childNodes.find(g=>K(g)&&g.localName===\"option\"&&g.selected)??f)):f.value;return[{t:\"field\",label:c,text:h}]}case\"label\":return p(f);default:return p(f)}}return{parts:p(t),problems:n,acts:[...r],records:[...o]}}var F=t=>t>=48&&t<=57,Yo=t=>F(t)||t>=65&&t<=70||t>=97&&t<=102,xr=t=>t>=65&&t<=90||t>=97&&t<=122,wr=t=>t>=128,vn=t=>xr(t)||wr(t)||t===95,qo=t=>vn(t)||F(t)||t===45,Wo=t=>t===10,fe=t=>t===10||t===9||t===32,ai=t=>t>=0&&t<=8||t===11||t>=14&&t<=31||t===127,oe=-1;function li(t){let e=[];for(let n=0;n<t.length;n+=1){let r=t.codePointAt(n);r>65535&&(n+=1),r===13?(t.charCodeAt(n+1)===10&&(n+=1),r=10):r===12?r=10:(r===0||r>=55296&&r<=57343)&&(r=65533),e.push(r)}return e}function ci(t){let e=li(t),n=0,r=(y=0)=>n+y<e.length?e[n+y]:oe,o=[],s=(y,c)=>y===92&&c!==10&&c!==oe,i=(y,c,h)=>y===45?vn(c)||c===45||s(c,h):vn(y)?!0:s(y,c),l=(y,c,h)=>y===43||y===45?F(c)||c===46&&F(h):F(y===46?c:y),u=()=>{let y=r();if(n+=1,y===oe)return 65533;if(Yo(y)){let c=String.fromCodePoint(y);for(;c.length<6&&Yo(r());)c+=String.fromCodePoint(r()),n+=1;fe(r())&&(n+=1);let h=parseInt(c,16);return h===0||h>=55296&&h<=57343||h>1114111?65533:h}return y},d=()=>{let y=\"\";for(;;){let c=r();if(qo(c))y+=String.fromCodePoint(c),n+=1;else if(s(c,r(1)))n+=1,y+=String.fromCodePoint(u());else return y}},p=()=>{let y=\"\";for((r()===43||r()===45)&&(y+=String.fromCodePoint(e[n++]));F(r());)y+=String.fromCodePoint(e[n++]);if(r()===46&&F(r(1)))for(y+=String.fromCodePoint(e[n++],e[n++]);F(r());)y+=String.fromCodePoint(e[n++]);if((r()===69||r()===101)&&(F(r(1))||(r(1)===43||r(1)===45)&&F(r(2))))for(y+=String.fromCodePoint(e[n++]),F(r())||(y+=String.fromCodePoint(e[n++]));F(r());)y+=String.fromCodePoint(e[n++]);return y},E=()=>{let y=p();return i(r(),r(1),r(2))?{type:\"dimension\",repr:y,unit:d()}:r()===37?(n+=1,{type:\"percentage\",repr:y}):{type:\"number\",repr:y}},f=()=>{for(;;){let y=r();if(n+=1,y===41||y===oe)return;s(y,r())&&u()}},b=()=>{let y=\"\";for(;fe(r());)n+=1;for(;;){let c=r();if(n+=1,c===41)return{type:\"url\",value:y};if(c===oe)return{type:\"url\",value:y};if(fe(c)){for(;fe(r());)n+=1;return r()===41||r()===oe?(r()===41&&(n+=1),{type:\"url\",value:y}):(f(),{type:\"bad-url\"})}if(c===34||c===39||c===40||ai(c))return f(),{type:\"bad-url\"};if(c===92){if(s(c,r()))y+=String.fromCodePoint(u());else return f(),{type:\"bad-url\"};continue}y+=String.fromCodePoint(c)}},N=()=>{let y=d();if(y.toLowerCase()===\"url\"&&r()===40){for(n+=1;fe(r())&&fe(r(1));)n+=1;let c=fe(r())?r(1):r();return c===34||c===39?{type:\"function\",value:y}:b()}return r()===40?(n+=1,{type:\"function\",value:y}):{type:\"ident\",value:y}},O=y=>{let c=\"\";for(;;){let h=r();if(n+=1,h===y||h===oe)return{type:\"string\",value:c};if(Wo(h))return n-=1,{type:\"bad-string\"};if(h===92){if(r()===oe)continue;if(Wo(r())){n+=1;continue}c+=String.fromCodePoint(u());continue}c+=String.fromCodePoint(h)}};for(;;){for(;r()===47&&r(1)===42;){for(n+=2;r()!==oe&&!(r()===42&&r(1)===47);)n+=1;r()!==oe&&(n+=2)}let y=r();if(y===oe)return o;if(fe(y)){for(;fe(r());)n+=1;o.push({type:\"whitespace\"});continue}switch(n+=1,y){case 34:case 39:o.push(O(y));continue;case 35:if(qo(r())||s(r(),r(1))){let c=i(r(),r(1),r(2));o.push({type:\"hash\",value:d(),id:c})}else o.push({type:\"delim\",value:\"#\"});continue;case 40:o.push({type:\"(\"});continue;case 41:o.push({type:\")\"});continue;case 43:case 46:l(y,r(),r(1))?(n-=1,o.push(E())):o.push({type:\"delim\",value:String.fromCodePoint(y)});continue;case 44:o.push({type:\",\"});continue;case 45:l(y,r(),r(1))?(n-=1,o.push(E())):r()===45&&r(1)===62?(n+=2,o.push({type:\"CDC\"})):i(y,r(),r(1))?(n-=1,o.push(N())):o.push({type:\"delim\",value:\"-\"});continue;case 58:o.push({type:\":\"});continue;case 59:o.push({type:\";\"});continue;case 60:r()===33&&r(1)===45&&r(2)===45?(n+=3,o.push({type:\"CDO\"})):o.push({type:\"delim\",value:\"<\"});continue;case 64:i(r(),r(1),r(2))?o.push({type:\"at-keyword\",value:d()}):o.push({type:\"delim\",value:\"@\"});continue;case 91:o.push({type:\"[\"});continue;case 92:s(y,r())?(n-=1,o.push(N())):o.push({type:\"delim\",value:\"\\\\\"});continue;case 93:o.push({type:\"]\"});continue;case 123:o.push({type:\"{\"});continue;case 125:o.push({type:\"}\"});continue;default:F(y)?(n-=1,o.push(E())):vn(y)?(n-=1,o.push(N())):o.push({type:\"delim\",value:String.fromCodePoint(y)})}}}var Qo={\"{\":\"}\",\"[\":\"]\",\"(\":\")\"},es=32,br=class{constructor(e){this.tokens=e}i=0;peek(){return this.tokens[this.i]}next(){return this.tokens[this.i++]}};function ts(t,e){let n=t.next();return n.type===\"{\"||n.type===\"[\"||n.type===\"(\"?{type:\"block\",open:n.type,value:Xo(t,Qo[n.type],e+1)}:n.type===\"function\"?{type:\"func\",name:n.value,value:Xo(t,\")\",e+1)}:n}function Xo(t,e,n){let r=[];for(;;){let o=t.peek();if(!o)return r;if(o.type===e)return t.next(),r;if(n>es){t.next(),r.push({type:\"bad-string\"});continue}r.push(ts(t,n))}}function tt(t,e){let n=[],r=0;for(;r<t.length;){let o=t[r];if(o.type===\"whitespace\"||e&&(o.type===\"CDO\"||o.type===\"CDC\")){r+=1;continue}if(o.type===\"at-keyword\"){let l=[];r+=1;let u;for(;r<t.length;){let d=t[r];if(r+=1,d.type===\";\")break;if(d.type===\"block\"&&d.open===\"{\"){u=d.value;break}l.push(d)}n.push({type:\"at-rule\",name:o.value,prelude:l,...u?{block:u}:{}});continue}let s=[],i;for(;r<t.length;){let l=t[r];if(r+=1,l.type===\"block\"&&l.open===\"{\"){i=l.value;break}s.push(l)}i&&n.push({type:\"qualified\",prelude:s,block:i})}return n}function Sr(t){let e=[],n=0;for(;n<t.length;){let r=t[n];if(r.type===\"whitespace\"||r.type===\";\"){n+=1;continue}if(r.type===\"at-keyword\"){let s=(()=>{for(let i=n+1;i<t.length;i+=1){let l=t[i];if(l.type===\";\"||l.type===\"block\"&&l.open===\"{\")return i+1}return t.length})();e.push(...tt(t.slice(n,s),!1)),n=s;continue}if(r.type===\"ident\"){let s=n+1;for(;t[s]?.type===\"whitespace\";)s+=1;if(t[s]?.type===\":\"){let i=s+1;for(;i<t.length&&t[i].type!==\";\";)i+=1;let l=ns(r.value,t.slice(s+1,i));if(l.value.some(u=>u.type===\"block\"&&u.open===\"{\")){let u=t.findIndex((d,p)=>p>n&&d.type===\"block\"&&d.open===\"{\");e.push(...tt(t.slice(n,u+1),!1)),n=u+1;continue}e.push(l),n=i+1;continue}}let o=n;for(;o<t.length&&!(t[o].type===\"block\"&&t[o].open===\"{\")&&t[o].type!==\";\";)o+=1;o<t.length&&t[o].type===\"block\"&&e.push(...tt(t.slice(n,o+1),!1)),n=o+1}return e}function ns(t,e){let n=[...e];for(;n[0]?.type===\"whitespace\";)n.shift();for(;n.at(-1)?.type===\"whitespace\";)n.pop();let r=!1,s=n.length-1;if(n[s]?.type===\"ident\"&&n[s].value.toLowerCase()===\"important\"){for(s-=1;n[s]?.type===\"whitespace\";)s-=1;let i=n[s];if(i?.type===\"delim\"&&i.value===\"!\")for(r=!0,n.length=s;n.at(-1)?.type===\"whitespace\";)n.pop()}return{type:\"declaration\",name:t,value:n,important:r}}function Or(t){let e=new br(ci(t)),n=[];for(;e.peek();)n.push(ts(e,0));return n}function Rn(t){let e=\"\",n=[...t].map(r=>r.codePointAt(0));return n.forEach((r,o)=>{r===0?e+=\"\\uFFFD\":r>=1&&r<=31||r===127||o===0&&F(r)||o===1&&F(r)&&n[0]===45?e+=`\\\\${r.toString(16)} `:o===0&&r===45&&n.length===1?e+=\"\\\\-\":wr(r)||r===45||r===95||F(r)||xr(r)?e+=String.fromCodePoint(r):e+=`\\\\${String.fromCodePoint(r)}`}),e}function An(t){let e=\"\";for(let n of t){let r=n.codePointAt(0);wr(r)||r===45||r===95||F(r)||xr(r)?e+=n:r>=1&&r<=31||r===127?e+=`\\\\${r.toString(16)} `:e+=`\\\\${n}`}return e}function Er(t){let e='\"';for(let n of t){let r=n.codePointAt(0);r===0?e+=\"\\uFFFD\":r>=1&&r<=31||r===127||r===60||r===62?e+=`\\\\${r.toString(16)} `:r===34||r===92?e+=`\\\\${n}`:e+=n}return`${e}\"`}function ui(t){let e=An(t);return/^[eE]([0-9]|[+-][0-9])/.test(t)?`\\\\${t.codePointAt(0).toString(16)} ${An(t.slice(1))}`:e}var Ko=t=>{switch(t.type){case\"ident\":case\"url\":case\"bad-url\":case\"number\":case\"percentage\":case\"dimension\":case\"CDC\":case\"hash\":case\"at-keyword\":return t.type;case\"func\":case\"function\":return\"function\";case\"block\":return t.open===\"(\"?\"(\":\"other\";case\"(\":return\"(\";case\"delim\":return`delim${t.value}`;default:return\"other\"}};function di(t,e){let n=[\"ident\",\"function\",\"url\",\"bad-url\",\"delim-\",\"number\",\"percentage\",\"dimension\",\"CDC\"];return t===\"ident\"?[...n,\"(\"].includes(e):t===\"at-keyword\"||t===\"hash\"||t===\"dimension\"||t===\"delim#\"||t===\"delim-\"?n.includes(e):t===\"number\"?[\"ident\",\"function\",\"url\",\"bad-url\",\"number\",\"percentage\",\"dimension\",\"delim%\"].includes(e):t===\"delim@\"?[\"ident\",\"function\",\"url\",\"bad-url\",\"delim-\",\"CDC\"].includes(e):t===\"delim.\"||t===\"delim+\"?[\"number\",\"percentage\",\"dimension\"].includes(e):t===\"delim/\"?e===\"delim*\":!1}function fi(t){switch(t.type){case\"whitespace\":return\" \";case\"ident\":return Rn(t.value);case\"at-keyword\":return`@${Rn(t.value)}`;case\"hash\":return`#${An(t.value)}`;case\"string\":return Er(t.value);case\"url\":return`url(${Er(t.value)})`;case\"delim\":return t.value===\"\\\\\"?`\\\\\n`:t.value;case\"CDO\":return\"<!--\";case\"CDC\":return\"-->\";case\"number\":return t.repr;case\"percentage\":return`${t.repr}%`;case\"dimension\":return`${t.repr}${ui(t.unit)}`;case\"func\":return`${Rn(t.name)}(${nt(t.value)})`;case\"block\":return`${t.open}${nt(t.value)}${Qo[t.open]}`;case\":\":case\";\":case\",\":case\"[\":case\"]\":case\"(\":case\")\":case\"{\":case\"}\":return t.type;default:return\"\"}}function nt(t){let e=\"\",n;for(let r of t)r.type===\"whitespace\"&&n?.type===\"whitespace\"||(n&&di(Ko(n),Ko(r))&&(e+=\"/**/\"),e+=fi(r),n=r);return e}var mi=new Set(Ro),rs=new Set(Ao),Zo=new Set(Co),pi=new Set(ko),hi=new Set(Po),Jo=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,me=t=>t.replace(/[A-Z]/g,e=>e.toLowerCase()),gi=t=>me(t);function Nr(t,e,n){let r=[];for(let o of e){if(o.type===\"bad-url\"||o.type===\"bad-string\"){n({reason:\"unreadable\",...t?{name:t}:{}});return}if(o.type===\"url\"){if(t&&Zo.has(t)&&Jo.test(o.value)){r.push({type:\"func\",name:\"url\",value:[{type:\"string\",value:o.value}]});continue}n({reason:\"url\",...t?{name:t}:{}});return}if(o.type===\"func\"){let s=me(o.name);if(s===\"url\"||s===\"src\"){let l=o.value.filter(d=>d.type!==\"whitespace\"),u=l[0];if(s===\"url\"&&l.length===1&&u?.type===\"string\"&&t&&Zo.has(t)&&Jo.test(u.value)){r.push({type:\"func\",name:\"url\",value:[{type:\"string\",value:u.value}]});continue}n({reason:\"url\",...t?{name:t}:{}});return}if(!rs.has(s)){n({reason:\"function\",name:s});return}let i=Nr(t,o.value,n);if(!i)return;s===\"var\"?r.push({type:\"whitespace\"},{type:\"func\",name:s,value:i},{type:\"whitespace\"}):r.push({type:\"func\",name:s,value:i});continue}if(o.type===\"block\"){if(o.open===\"{\"||o.open===\"(\"&&r.at(-1)?.type===\"ident\"){n({reason:\"unreadable\",...t?{name:t}:{}});return}let s=Nr(t,o.value,n);if(!s)return;r.push({type:\"block\",open:o.open,value:s});continue}if(o.type===\"at-keyword\"||o.type===\"CDO\"||o.type===\"CDC\"||o.type===\"{\"||o.type===\"}\"||o.type===\";\"||o.type===\"delim\"&&o.value===\"\\\\\"){n({reason:\"unreadable\",...t?{name:t}:{}});return}r.push(o)}return r}function kn(t,e){let n=t.name.startsWith(\"--\"),r=n?t.name:gi(t.name);if(!n&&!mi.has(r)){e({reason:\"property\",name:r});return}let o=_o[r];if(o){let l=t.value.filter(p=>p.type!==\"whitespace\"),u=l[0],d=l.length===1&&u?.type===\"ident\"?me(u.value):void 0;if(!d||![...o,\"inherit\",\"initial\",\"unset\",\"revert\"].includes(d)){e({reason:\"value\",name:r});return}return`${r}: ${d}${t.important?\" !important\":\"\"}`}let s=Nr(n?void 0:r,t.value,e);if(!s)return;let i=nt(s).trim();return`${n?`--${An(t.name.slice(2))}`:r}: ${i}${t.important?\" !important\":\"\"}`}function os(t,e){let n=r=>{for(let o=0;o<r.length;o+=1){let s=r[o];if(o>0&&r[o-1].type===\":\"&&(s.type===\"ident\"||s.type===\"func\")){let l=me(s.type===\"ident\"?s.value:s.name);if(hi.has(l)||l.startsWith(\"-webkit-\")||l.startsWith(\"-moz-\"))return e({reason:\"selector\",name:l}),!1}if(s.type===\"url\"||s.type===\"bad-url\"||s.type===\"bad-string\"||s.type===\"at-keyword\"||s.type===\"CDO\"||s.type===\"CDC\"||s.type===\"block\"&&s.open===\"{\")return e({reason:\"unreadable\",name:\"selector\"}),!1;if(s.type===\"func\"&&!n(s.value)||s.type===\"block\"&&!n(s.value))return!1}return!0};return n(t)}function yr(t,e,n){let r=[];for(let o of Sr(t))if(o.type===\"declaration\"){let s=kn(o,e);s&&r.push(`${s};`)}else{let s=Cn(o,e,n+1,\"style\");s&&r.push(s)}return r.join(\" \")}function yi(t,e,n){let r=o=>o.every(s=>{if(s.type===\"url\"||s.type===\"bad-url\"||s.type===\"bad-string\"||s.type===\"block\"&&s.open===\"{\")return n({reason:s.type===\"url\"?\"url\":\"unreadable\",name:`@${e}`}),!1;if(s.type===\"func\"){let i=me(s.name);return e===\"supports\"&&i===\"selector\"?os(s.value,n):rs.has(i)?r(s.value):(n({reason:\"function\",name:i}),!1)}if(s.type===\"block\"){if(e===\"supports\"){let i=Sr(s.value);if(i.length===1&&i[0].type===\"declaration\")return kn(i[0],n)!==void 0}return r(s.value)}return!0});return r(t)?nt(t).trim():void 0}function Tr(t){return t.map((e,n)=>{let r=t[n-1],o=r?.type===\":\"||r?.type===\"delim\"&&(r.value===\".\"||r.value===\"|\");return e.type===\"ident\"&&!o&&Object.prototype.hasOwnProperty.call(St,me(e.value))?{type:\"block\",open:\"[\",value:[{type:\"ident\",value:\"data-graview-as\"},{type:\"delim\",value:\"=\"},{type:\"string\",value:me(e.value)}]}:e.type===\"func\"?{type:\"func\",name:e.name,value:Tr(e.value)}:e.type===\"block\"&&e.open===\"(\"?{type:\"block\",open:\"(\",value:Tr(e.value)}:e})}function Cn(t,e,n,r){if(n>es){e({reason:\"unreadable\",name:\"nesting\"});return}if(t.type===\"qualified\"){if(r===\"keyframes\"){if(!t.prelude.every(p=>p.type===\"whitespace\"||p.type===\",\"||p.type===\"percentage\"||p.type===\"ident\"&&[\"from\",\"to\"].includes(me(p.value)))){e({reason:\"unreadable\",name:\"keyframe\"});return}return`${nt(t.prelude).trim()} { ${yr(t.block,e,n)} }`}if(!os(t.prelude,e))return;let u=nt(Tr(t.prelude)).trim();if(u===\"\"){e({reason:\"unreadable\",name:\"selector\"});return}return`${u} { ${yr(t.block,e,n)} }`}let o=me(t.name),s=o===\"-webkit-keyframes\"?\"keyframes\":o;if(!pi.has(s)||r===\"keyframes\"){e({reason:\"at-rule\",name:`@${o}`});return}if(!t.block){e({reason:\"unreadable\",name:`@${o}`});return}if(s===\"keyframes\"){if(r!==\"sheet\"){e({reason:\"at-rule\",name:\"@keyframes\"});return}let u=t.prelude.filter(f=>f.type!==\"whitespace\"),d=u[0];if(u.length!==1||!d||d.type!==\"ident\"&&d.type!==\"string\"){e({reason:\"unreadable\",name:\"@keyframes\"});return}let p=tt(t.block,!1).map(f=>Cn(f,e,n+1,\"keyframes\")).filter(f=>f!==void 0);return`@keyframes ${d.type===\"ident\"?Rn(d.value):Er(d.value)} { ${p.join(\" \")} }`}let i=yi(t.prelude,s,e);if(i===void 0)return;let l=r===\"style\"?yr(t.block,e,n):tt(t.block,!1).map(u=>Cn(u,e,n+1,\"sheet\")).filter(u=>u!==void 0).join(\" \");return`@${s} ${i} { ${l} }`}function ss(t,e=ur){let n=[];if(t.length>e)return{css:\"\",refused:[{reason:\"size\"}]};let r=s=>void n.push(s);return{css:tt(Or(t),!0).map(s=>Cn(s,r,0,\"sheet\")).filter(s=>s!==void 0).join(`\n`),refused:n}}function is(t,e=ur){let n=[];if(t.length>e)return{css:\"\",refused:[{reason:\"size\"}]};let r=s=>void n.push(s),o=[];for(let s of Sr(Or(t))){if(s.type!==\"declaration\"){r({reason:\"unreadable\",name:\"a rule in a style attribute\"});continue}let i=kn(s,r);i&&o.push(i)}return{css:o.join(\"; \"),refused:n}}function as(t,e){let n,r=kn(ns(t,Or(e)),o=>n??=o);return r===void 0||n?{refused:n??{reason:\"unreadable\",name:t}}:{value:r.slice(r.indexOf(\":\")+1).trim()}}function ls(t,e){if(e===\"svg\"){let r=wn(t);return r?{namespace:\"svg\",name:r}:{refused:{reason:\"element\",element:t}}}let n=t.toLowerCase();return n===\"svg\"?{namespace:\"svg\",name:\"svg\"}:Object.prototype.hasOwnProperty.call(Qe,n)?Object.prototype.hasOwnProperty.call(St,n)?{namespace:\"html\",name:St[n],as:n}:{namespace:\"html\",name:n}:{refused:{reason:\"element\",element:t}}}function vr(t,e){return(t===\"html\"?Qe[e]:Tn[e])?.empty===!0}var bi=/^[+-]?(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$/,Ei=/^[0-9A-Za-z\\s.,+\\-%()]*$/,Ni=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,Ti=/^data:image\\/(png|gif|jpeg|webp|avif|bmp|svg\\+xml)(;[A-Za-z0-9=._+-]+)*,/i;function Rr(t,e,n,r,o){let s=Sn(t,e,n);if(!s)return{refused:{reason:\"attribute\",element:e,name:n}};if(t===\"html\"&&xn[e]?.includes(s.name))return{refused:{reason:\"attribute\",element:e,name:n}};if(r===null)return{name:s.name,value:null};let i=xi(s.name,s.kind,r,o);return\"refused\"in i?{refused:{...i.refused,element:e}}:s.name===\"role\"&&i.value.split(/\\s+/).some(l=>vo.includes(l.toLowerCase()))?{refused:{reason:\"value\",element:e,name:n}}:s.name===\"aria-live\"&&![\"polite\",\"off\"].includes(i.value.toLowerCase())?{refused:{reason:\"value\",element:e,name:n}}:{name:s.name,value:i.value,...i.dropped?{dropped:i.dropped.map(l=>({reason:l.reason===\"url\"?\"url\":\"css\",element:e,name:s.name,css:l}))}:{}}}function xi(t,e,n,r){let o=(s,i)=>({refused:{reason:s,name:t,...i?{css:i}:{}}});if(e===\"geometry\")return n.length>Io||!Ei.test(n)||/url/i.test(n)?o(\"value\"):{value:n};if(e===\"image\")return n.length>Do?o(\"url\"):Ti.test(n)?{value:n}:n.startsWith(`blob:${r.origin}/`)&&/^blob:[^\\s\"'<>]+$/.test(n)?{value:n}:o(\"url\");if(n.length>dr)return o(\"value\");if(typeof e==\"object\"){let s=e.oneOf.find(i=>i.toLowerCase()===n.toLowerCase());return s===void 0?o(\"value\"):{value:s}}switch(e){case\"text\":return{value:n};case\"number\":return bi.test(n.trim())&&Number.isFinite(Number(n))?{value:n.trim()}:o(\"value\");case\"boolean\":return{value:\"\"};case\"fragment\":return Ni.test(n)?{value:n}:o(\"url\");case\"style\":{let s=is(n,dr);return s.refused.length>0&&s.css===\"\"?o(s.refused[0].reason===\"url\"?\"url\":\"css\",s.refused[0]):{value:s.css,...s.refused.length>0?{dropped:s.refused}:{}}}case\"css\":{let s=as(t,n);return\"refused\"in s?o(s.refused.reason===\"url\"?\"url\":\"css\",s.refused):{value:s.value}}}}var wi=0,Si=1,Oi=2,vi=3,cs=1,Ri=2,us=3,Ai=1,Ci=3,ki=8,ds=\"~\",_n=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t),fs=new Set([\"input\",\"select\",\"textarea\",\"option\"]),_i=new Set([\"value\",\"checked\",\"selected\"]);function ms(t,e){let n=t.ownerDocument??t,r=e.maxNodes??5e3,o=[],s=new Map,i=new WeakMap,l={dom:t,name:\"div\",namespace:\"html\",children:[],id:ds};s.set(ds,l);let u=0,d=!1,p=c=>{o.push(c),o.length>200&&o.shift()},E=()=>({dom:n.createComment(\"\"),children:[],refused:!0}),f=(c,h)=>{if(c.namespace===\"html\"&&c.name&&fs.has(c.name))return c.dom;if(h?.namespace===\"html\"&&h.name===\"textarea\")return h.dom},b=(c,h,g)=>{let a=c.dom;if(g!=null&&typeof g!=\"string\")return p({reason:\"value\",element:c.name,name:h});let m=Rr(c.namespace,c.name,h,g??null,e);if(\"refused\"in m){let R=Rr(c.namespace,c.name,h,null,e);return\"refused\"in R||a.removeAttribute(R.name),p(m.refused)}for(let R of m.dropped??[])p(R);let T=c.namespace===\"html\"&&_i.has(m.name)&&fs.has(c.name),x=a,v=T?m.name===\"value\"?x.value:m.name===\"checked\"?x.checked:x.selected:void 0;m.value===null?a.removeAttribute(m.name):a.setAttribute(m.name,m.value),e.onAttribute?.(a,m.name),T&&(m.name===\"value\"&&\"value\"in x?(x.value=m.value??\"\",v!==x.value&&e.onFieldSet?.(a)):m.name===\"checked\"&&\"checked\"in x?(x.checked=m.value!==null,v!==x.checked&&e.onFieldSet?.(a)):m.name===\"selected\"&&\"selected\"in x&&(x.selected=m.value!==null,v!==x.selected&&e.onFieldSet?.(a.parentElement?.closest(\"select\")??a)))},N=c=>{if(!c.refused){u-=1,c.id!==void 0&&s.delete(c.id);for(let h of c.children)N(h)}},O=(c,h)=>{if(!_n(c)||typeof c.id!=\"string\"||s.has(c.id))return p({reason:\"record\"}),E();if(u>=r)return p({reason:\"budget\"}),d||(d=!0,e.onOverBudget?.()),E();let g=c.id;if(c.type===ki)return E();if(c.type===Ci){if(vr(h.namespace,h.name))return p({reason:\"child\",element:h.name}),E();let v=n.createTextNode(String(c.data??\"\").slice(0,fr)),R={dom:v,children:[],text:!0,id:g,parent:h};return s.set(g,R),i.set(v,g),u+=1,R}if(c.type!==Ai)return p({reason:\"record\"}),E();let a=String(c.element);if(vr(h.namespace,h.name))return p({reason:\"child\",element:a}),E();let m=ls(a,h.namespace);if(\"refused\"in m)return p(m.refused),E();let T=n.createElementNS(m.namespace===\"svg\"?Lo:Mo,m.name);m.as&&T.setAttribute(\"data-graview-as\",m.as);let x={dom:T,name:m.name,namespace:m.namespace,children:[],id:g,parent:h};if(s.set(g,x),i.set(T,g),u+=1,_n(c.attributes))for(let[v,R]of Object.entries(c.attributes))b(x,v,R);if(e.decorate?.(T,m.name,m.namespace),_n(c.properties))for(let v of Object.keys(c.properties))p({reason:\"attribute\",element:m.name,name:v});if(_n(c.eventListeners))for(let v of Object.keys(c.eventListeners))c.eventListeners[v]!=null&&p({reason:\"attribute\",element:m.name,name:`on${v}`});if(Array.isArray(c.children))for(let v of c.children){let R=O(v,x);x.children.push(R),T.appendChild(R.dom)}return x},y=c=>{if(!Array.isArray(c))return p({reason:\"record\"});let[h,g]=c,a=typeof g==\"string\"?s.get(g):void 0;if(!a)return p({reason:\"record\"});switch(h){case wi:{if(a.text)return p({reason:\"record\"});let m=Number(c[3]),T=Number.isInteger(m)&&m>=0&&m<=a.children.length?m:a.children.length,x=O(c[2],a);a.dom.insertBefore(x.dom,a.children[T]?.dom??null),a.children.splice(T,0,x),a.namespace===\"html\"&&a.name===\"textarea\"&&e.onFieldSet?.(a.dom);return}case Si:{let m=Number(c[2]),T=a.children[m];if(!T)return p({reason:\"record\"});a.children.splice(m,1),T.dom.parentNode?.removeChild(T.dom),N(T);return}case Oi:{if(!a.text)return p({reason:\"record\"});a.dom.data=String(c[2]??\"\").slice(0,fr);let m=f(a,a.parent);m&&e.onFieldSet?.(m);return}case vi:{if(a===l||a.text)return p({reason:\"record\"});let m=String(c[2]),T=c[4]??cs;return T===Ri?b(a,m,c[3]):p(T===cs||T===us?{reason:\"attribute\",element:a.name,name:T===us?`on${m}`:m}:{reason:\"record\"})}default:return p({reason:\"record\"})}};return{apply(c,h){if(!Array.isArray(c))return p({reason:\"record\"}),!0;for(let g=0;g<c.length;g+=1){if(h&&g%32===0&&h())return!1;y(c[g])}return!0},get refused(){return o},get size(){return u},idOf:c=>i.get(c),elementOf(c){let h=s.get(c);return h&&!h.text&&h!==l?h.dom:void 0},dispose(){for(let c of l.children)N(c);for(l.children.length=0;t.firstChild;)t.removeChild(t.firstChild)}}}function ps(t,e,n){let{root:r}=$o(),o=!1,s=ms(r,{origin:n.origin??\"null\",maxNodes:n.maxNodes,onOverBudget:()=>o=!0});for(let u of t)s.apply(u);let i=[...s.refused],l=\"\";if(typeof e==\"string\"){let u=ss(e);l=u.css;for(let d of u.refused)i.push({reason:\"css\",name:\"stylesheet\",css:d})}return{root:r,refused:i,size:s.size,over:o,css:l}}function Pi(t){let e=\"element\"in t&&t.element?`<${t.element}>`:\"\",n=t.name?` ${t.name}`:\"\";switch(t.reason){case\"element\":return{at:`drawing ${e}`,says:`Not drawn: ${e} is not in the open kit.`};case\"attribute\":return{at:`drawing ${e}${n}`,says:`Not drawn: ${e||\"an element\"} does not take${n}.`};case\"value\":return{at:`drawing ${e}${n}`,says:`Not drawn: the value of${n} is not one the open kit takes.`};case\"url\":return{at:`drawing ${e}${n}`,says:\"Not drawn: an address. A view loads nothing; an image is a data: image.\"};case\"child\":return{at:`drawing ${e}`,says:`Not drawn: ${e} holds nothing.`};case\"record\":return{at:\"drawing\",says:\"Not drawn: a record the drawing's format does not know.\"};case\"budget\":return{at:\"drawing\",says:\"Not drawn: more nodes than a view may draw.\"};case\"css\":return{at:`stylesheet${n===\" stylesheet\"?\"\":n}`,says:`Not drawn: CSS the open kit leaves out${t.css?` (${t.css.reason}${t.css.name?` ${t.css.name}`:\"\"})`:\"\"}.`}}}function hs(t,e){let{limits:n}=e;if(t.messages>n.messages)return{ok:!1,reason:\"flood\",detail:`It sent ${t.messages} messages, more than the ${n.messages} a view may send in a second.`};let r=new Set(e.acts);for(let l of t.asked)if(!r.has(l.name))return{ok:!1,reason:\"act\",detail:`It asks for the act \"${l.name}\", which its manifest does not name.`};let o=ps(t.renders,t.css,{maxNodes:n.maxNodes});if(o.over)return{ok:!1,reason:\"nodes\",detail:`It drew more than the ${n.maxNodes.toLocaleString(\"en-US\")} things a view may draw.`};let s=Go(o.root,{props:e.props,places:e.places});for(let l of s.acts)if(!r.has(l))return{ok:!1,reason:\"act\",detail:`It binds a press to the act \"${l}\" (data-act), which its manifest does not name.`};let i=[...o.refused.map(Pi),...s.problems];for(let l of t.went)\"record\"in l&&!(e.props.node?.id===l.record||(e.props.nodes??[]).some(u=>u.id===l.record))&&i.push({at:\"navigate\",says:`It goes to \"${l.record}\", which this seat was not shown: the host will not follow it.`}),\"place\"in l&&!e.places.includes(l.place)&&i.push({at:\"navigate\",says:`It goes to the place \"${l.place}\", which this app does not have.`});return{ok:!0,parts:s.parts,problems:i}}var Ar=\"graviewHeadless\",Cr=\"graviewHeadlessView\";var Es=globalThis,Ii=Promise.prototype.then,Di=Promise.resolve(),_r=t=>void Ii.call(Di,t),Pn=Es.performance,vt=Pn&&typeof Pn.now==\"function\"?Pn.now.bind(Pn):Date.now,Ie=JSON.stringify,Ns=JSON.parse,Mi=Object.defineProperty,Pr=t=>(t instanceof Error?`${t.name}: ${t.message}`:String(t)).slice(0,500),gs=t=>{try{return Ns(Ie(t??null))}catch{return null}},B={renders:[],asked:[],went:[],ms:0,logs:[],messages:0},De,In=(t,e)=>{De??={reason:t,detail:e}},rt=t=>{B.logs.length<50&&B.logs.push(t.slice(0,500))},ot={removed:[],stuck:[],sealed:!1},Ir=zo({send(t){B.messages+=1,t.type===\"render\"?B.renders.push(gs(t.records)):t.type===\"style\"?B.css=String(t.css):t.type===\"navigate\"&&\"place\"in t&&B.went.push({place:String(t.place)})},act(t,e){return B.messages+=1,B.asked.push({name:String(t),args:gs(e)}),Promise.resolve({type:\"answer\",id:B.asked.length,ok:!1,reason:\"refused\",message:\"Nothing is applied in a headless run.\"})},navigate(t){B.messages+=1,B.went.push({record:String(t)})},microtask:_r,now:vt,threw:t=>In(\"error\",`It threw: ${Pr(t)}`),warn:rt,hardening:()=>ot}),ys=!1,kr=!1;function Li(t){if(kr||typeof t!=\"function\"||(kr=!0,De))return;let e=vt();try{t.call(void 0,Ir.view)}catch(n){In(\"error\",`It threw: ${Pr(n)}`)}B.ms+=vt()-e}async function Hi(t){if(ys)return Ie({ok:!1,reason:\"refused\",detail:\"A headless script runs one view, once: something called its entry before the host did.\"});ys=!0;let e;try{e=Ns(String(t))}catch{return Ie({ok:!1,reason:\"isolate\",detail:\"The run was not handed its input as JSON.\"})}if(!kr&&!De)return Ie({ok:!1,reason:\"isolate\",detail:\"The script held no view.\"});let n=vt();De||Ir.hear({type:\"props\",props:e.props,push:1}),B.ms+=vt()-n,B.ms>=e.limits.pushMs&&In(\"slow\",`It took longer than ${e.limits.pushMs.toLocaleString(\"en-US\")} ms to draw what it was shown.`);for(let o=0;o<64&&!De;o+=1)await new Promise(s=>_r(s));if(De)return Ie({ok:!1,...De,transcript:B});let r=hs(B,e);return r.ok?Ie({ok:!0,transcript:B,drawn:{parts:r.parts,problems:r.problems},hardening:{removed:ot.removed.length,sealed:ot.sealed}}):Ie({ok:!1,reason:r.reason,detail:r.detail,transcript:B})}var Vi=Object.freeze({log:(...t)=>rt(t.map(String).join(\" \")),info:(...t)=>rt(t.map(String).join(\" \")),debug:(...t)=>rt(t.map(String).join(\" \")),warn:(...t)=>rt(t.map(String).join(\" \")),error:(...t)=>rt(t.map(Pr).join(\" \"))}),Ui=0,bs=()=>Ui+=1,ji=[[\"console\",Vi],[\"setTimeout\",bs],[\"setInterval\",bs],[\"clearTimeout\",()=>{}],[\"clearInterval\",()=>{}],[\"queueMicrotask\",_r],[\"graview\",Ir.view],[Cr,Li],[Ar,t=>Hi(t)]];for(let[t,e]of ji)Mi(Es,t,{value:e,writable:!0,enumerable:!1,configurable:!0});ot=So(globalThis,[\"graview\",Cr,Ar],{primitivesStay:!0});ot.stuck.length>0&&In(\"refused\",`This isolate could not be hardened: ${ot.stuck.join(\", \")} would not go.`);})();\n";
|
|
8
|
+
//# sourceMappingURL=runtime.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.generated.js","sourceRoot":"","sources":["../../src/headless/runtime.generated.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAW,wgpGAAwgpG,CAAC"}
|