diff options
Diffstat (limited to '')
| -rwxr-xr-x | source/common.ts | 2 | ||||
| -rw-r--r-- | source/gql.ts | 3 | ||||
| -rw-r--r-- | source/graphiql/assets.ts | 28 | ||||
| -rw-r--r-- | source/graphiql/favicon.svg | 15 | ||||
| -rwxr-xr-x | source/graphiql/render.ts | 56 | ||||
| -rw-r--r-- | source/graphiql/standalone.css | 2 | ||||
| -rw-r--r-- | source/graphiql/standalone.js | 207 | ||||
| -rw-r--r-- | source/graphiql/version.ts | 1 | ||||
| -rwxr-xr-x | source/http.ts | 10 | ||||
| -rw-r--r-- | source/import.ts | 2 | ||||
| -rw-r--r-- | source/utility/pubsub.ts | 64 | ||||
| -rwxr-xr-x | source/utility/types.ts | 2 | ||||
| -rw-r--r-- | source/ws.ts | 4 |
13 files changed, 362 insertions, 34 deletions
diff --git a/source/common.ts b/source/common.ts index 902bdd0..777bb98 100755 --- a/source/common.ts +++ b/source/common.ts @@ -3,7 +3,7 @@ /*** IMPORT ------------------------------------------- ***/ -import { graphql, type ExecutionResult } from "graphql"; +import { graphql, type ExecutionResult } from "#deps"; /*** UTILITY ------------------------------------------ ***/ diff --git a/source/gql.ts b/source/gql.ts index f88d8ff..823f73a 100644 --- a/source/gql.ts +++ b/source/gql.ts @@ -8,7 +8,7 @@ import { type DefinitionNode, type DocumentNode, type Location -} from "graphql"; +} from "#deps"; /*** UTILITY ------------------------------------------ ***/ @@ -143,6 +143,7 @@ function parseDocument(source: string) { const cacheKey = normalize(source); if (!docCache.has(cacheKey)) { + // @ts-ignore: TS2353 const parsed = parse(source, { allowLegacyFragmentVariables }); if (!parsed || parsed.kind !== "Document") diff --git a/source/graphiql/assets.ts b/source/graphiql/assets.ts new file mode 100644 index 0000000..d0848e7 --- /dev/null +++ b/source/graphiql/assets.ts @@ -0,0 +1,28 @@ +// source/graphiql/assets.ts +import css from "./standalone.css" with { type: "text" }; +import favicon from "./favicon.svg" with { type: "text" }; +import js from "./standalone.js" with { type: "text" }; +import { GRAPHIQL_VERSION } from "./version.ts"; + +const base = `/_graphiql/${GRAPHIQL_VERSION}`; + +export const assets: Record<string, { body: string; type: string }> = { + [`${base}/favicon.svg`]: { body: favicon, type: "image/svg+xml" }, + [`${base}/standalone.css`]: { body: css, type: "text/css; charset=utf-8" }, + [`${base}/standalone.js`]: { body: js, type: "text/javascript; charset=utf-8" } +}; + +export function serveAsset(request: { url: string }): Response | undefined { + const { pathname } = new URL(request.url); + const key = Object.keys(assets).find((path) => pathname.endsWith(path)); + + if (!key) + return; + + return new Response(assets[key].body, { + headers: { + "cache-control": "public, max-age=31536000, immutable", + "content-type": assets[key].type + } + }); +} diff --git a/source/graphiql/favicon.svg b/source/graphiql/favicon.svg new file mode 100644 index 0000000..80a7a21 --- /dev/null +++ b/source/graphiql/favicon.svg @@ -0,0 +1,15 @@ +<svg fill="#e10098" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> + <style> + svg { + fill: color(display-p3 0.8824 0 0.5961); + } + </style> + + <path clip-rule="evenodd" d="M50 6.90308L87.323 28.4515V71.5484L50 93.0968L12.677 71.5484V28.4515L50 6.90308ZM16.8647 30.8693V62.5251L44.2795 15.0414L16.8647 30.8693ZM50 13.5086L18.3975 68.2457H81.6025L50 13.5086ZM77.4148 72.4334H22.5852L50 88.2613L77.4148 72.4334ZM83.1353 62.5251L55.7205 15.0414L83.1353 30.8693V62.5251Z" fill-rule="evenodd"/> + <circle cx="50" cy="9.3209" r="8.82"/> + <circle cx="85.2292" cy="29.6605" r="8.82"/> + <circle cx="85.2292" cy="70.3396" r="8.82"/> + <circle cx="50" cy="90.6791" r="8.82"/> + <circle cx="14.7659" cy="70.3396" r="8.82"/> + <circle cx="14.7659" cy="29.6605" r="8.82"/> +</svg> diff --git a/source/graphiql/render.ts b/source/graphiql/render.ts index 7adec57..c846d34 100755 --- a/source/graphiql/render.ts +++ b/source/graphiql/render.ts @@ -4,26 +4,31 @@ /*** IMPORT ------------------------------------------- ***/ import { default as dedent } from "@netopwibby/dedent"; -import { filterXSS } from "xss"; +import { GRAPHIQL_VERSION } from "./version.ts"; /*** UTILITY ------------------------------------------ ***/ -const filter = (val: string) => filterXSS(val, { - stripIgnoreTag: true, - stripIgnoreTagBody: ["script"], - whiteList: {} -}); +const escapeHtml = (value: string) => value + .replaceAll("&", "&") + .replaceAll("<", "<") + .replaceAll(">", ">") + .replaceAll("\"", """) + .replaceAll("'", "'"); + +const toScriptString = (value: string) => JSON.stringify(value).replaceAll("<", "\\u003c"); const buildAssetUrl = ({ cdnUrl, suffix, version }: { - cdnUrl: string - suffix: string - version?: string -}) => filter(`${cdnUrl}/@eeeooolll/graphiql${version ? `@${version}` : ""}/dist/${suffix}`); + cdnUrl?: string; + suffix: string; + version: string; +}) => cdnUrl ? + `${cdnUrl}/@eeeooolll/graphiql@${version}/dist/${suffix}` : + `./_graphiql/${GRAPHIQL_VERSION}/${suffix}`; /*** EXPORT ------------------------------------------- ***/ export interface RenderPageOptions { - /** Base CDN. Defaults to jsDelivr. */ + /** Load the bundle from this CDN base (e.g. `//cdn.jsdelivr.net/npm`) instead of the copy embedded in gq. */ cdnUrl?: string; /** GraphQL endpoint the embedded fetcher posts to. */ endpoint?: string; @@ -31,7 +36,7 @@ export interface RenderPageOptions { faviconUrl?: string | null; /** Document `<title>`. */ title?: string; - /** Pin `@eeeooolll/graphiql` to a specific version on the CDN. */ + /** `@eeeooolll/graphiql` version to load from `cdnUrl`. Defaults to the embedded version; ignored when self-hosting. */ version?: string; } @@ -39,31 +44,28 @@ export interface RenderPageOptions { * Renders the GraphiQL HTML shell. * * Loads the prebuilt IIFE bundle from `@eeeooolll/graphiql` (registered as - * `window.EolGraphiQL`) and mounts it against `endpoint`. + * `window.EolGraphiQL`) and mounts it against `endpoint`. The bundle is + * embedded in gq and served by `GraphQLHTTP`; set `cdnUrl` to load it + * from a CDN instead. * * Usually called indirectly via `GraphQLHTTP({ graphiql: true })`; invoke it * directly if you need to embed GraphiQL in a custom route. */ export function renderPlaygroundPage(options: RenderPageOptions): string { const { - cdnUrl = "//cdn.jsdelivr.net/npm", + cdnUrl, endpoint = "/graphql", faviconUrl, title = "GraphiQL", - version + version = GRAPHIQL_VERSION } = options; - const safeEndpoint = filter(endpoint); - const safeTitle = filter(title); - const scriptUrl = buildAssetUrl({ cdnUrl, suffix: "standalone.js", version }); - const styleUrl = buildAssetUrl({ cdnUrl, suffix: "standalone.css", version }); + const scriptUrl = escapeHtml(buildAssetUrl({ cdnUrl, suffix: "standalone.js", version })); + const styleUrl = escapeHtml(buildAssetUrl({ cdnUrl, suffix: "standalone.css", version })); - const faviconLink = - faviconUrl === null ? - "" : - typeof faviconUrl === "string" ? - `<link rel="shortcut icon" href="${filter(faviconUrl)}"/>` : - `<link rel="shortcut icon" href="${buildAssetUrl({ cdnUrl, suffix: "favicon.svg", version })}"/>`; + const faviconLink = faviconUrl === null ? + "" : + `<link rel="shortcut icon" href="${escapeHtml(faviconUrl ?? buildAssetUrl({ cdnUrl, suffix: "favicon.svg", version }))}"/>`; return dedent` <!DOCTYPE html> @@ -71,7 +73,7 @@ export function renderPlaygroundPage(options: RenderPageOptions): string { <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> - <title>${safeTitle}</title> + <title>${escapeHtml(title)}</title> ${faviconLink} <link rel="stylesheet" href="${styleUrl}"/> @@ -106,7 +108,7 @@ export function renderPlaygroundPage(options: RenderPageOptions): string { <script> window.addEventListener("load", () => { const root = document.getElementById("root"); - const fetcher = window.EolGraphiQL.createHttpFetcher({ url: "${safeEndpoint}" }); + const fetcher = window.EolGraphiQL.createHttpFetcher({ url: ${toScriptString(endpoint)} }); window.EolGraphiQL.mount(root, { fetcher }); }); diff --git a/source/graphiql/standalone.css b/source/graphiql/standalone.css new file mode 100644 index 0000000..7417883 --- /dev/null +++ b/source/graphiql/standalone.css @@ -0,0 +1,2 @@ +:root{--uchu-blue-1-raw:89.66% .046 260.67;--uchu-blue-1:oklch(89.66% .046 260.67);--uchu-blue-2-raw:80.17% .091 258.88;--uchu-blue-2:oklch(80.17% .091 258.88);--uchu-blue-3-raw:70.94% .136 258.06;--uchu-blue-3:oklch(70.94% .136 258.06);--uchu-blue-4-raw:62.39% .181 258.33;--uchu-blue-4:oklch(62.39% .181 258.33);--uchu-blue-5-raw:54.87% .222 260.33;--uchu-blue-5:oklch(54.87% .222 260.33);--uchu-blue-6-raw:51.15% .204 260.17;--uchu-blue-6:oklch(51.15% .204 260.17);--uchu-blue-7-raw:47.36% .185 259.89;--uchu-blue-7:oklch(47.36% .185 259.89);--uchu-blue-8-raw:43.48% .17 260.2;--uchu-blue-8:oklch(43.48% .17 260.2);--uchu-blue-9-raw:39.53% .15 259.87;--uchu-blue-9:oklch(39.53% .15 259.87);--uchu-gray-1-raw:95.57% .003 286.35;--uchu-gray-1:oklch(95.57% .003 286.35);--uchu-gray-2-raw:92.04% .002 197.12;--uchu-gray-2:oklch(92.04% .002 197.12);--uchu-gray-3-raw:88.28% .003 286.34;--uchu-gray-3:oklch(88.28% .003 286.34);--uchu-gray-4-raw:84.68% .002 197.12;--uchu-gray-4:oklch(84.68% .002 197.12);--uchu-gray-5-raw:80.73% .002 247.84;--uchu-gray-5:oklch(80.73% .002 247.84);--uchu-gray-6-raw:75.03% .002 247.85;--uchu-gray-6:oklch(75.03% .002 247.85);--uchu-gray-7-raw:69.01% .003 286.32;--uchu-gray-7:oklch(69.01% .003 286.32);--uchu-gray-8-raw:63.12% .004 219.55;--uchu-gray-8:oklch(63.12% .004 219.55);--uchu-gray-9-raw:56.82% .004 247.89;--uchu-gray-9:oklch(56.82% .004 247.89);--uchu-green-1-raw:93.96% .05 148.74;--uchu-green-1:oklch(93.96% .05 148.74);--uchu-green-2-raw:88.77% .096 147.71;--uchu-green-2:oklch(88.77% .096 147.71);--uchu-green-3-raw:83.74% .139 146.57;--uchu-green-3:oklch(83.74% .139 146.57);--uchu-green-4-raw:79.33% .179 145.62;--uchu-green-4:oklch(79.33% .179 145.62);--uchu-green-5-raw:75.23% .209 144.64;--uchu-green-5:oklch(75.23% .209 144.64);--uchu-green-6-raw:70.03% .194 144.71;--uchu-green-6:oklch(70.03% .194 144.71);--uchu-green-7-raw:64.24% .175 144.92;--uchu-green-7:oklch(64.24% .175 144.92);--uchu-green-8-raw:58.83% .158 145.05;--uchu-green-8:oklch(58.83% .158 145.05);--uchu-green-9-raw:52.77% .138 145.41;--uchu-green-9:oklch(52.77% .138 145.41);--uchu-orange-1-raw:93.83% .037 56.93;--uchu-orange-1:oklch(93.83% .037 56.93);--uchu-orange-2-raw:88.37% .072 55.8;--uchu-orange-2:oklch(88.37% .072 55.8);--uchu-orange-3-raw:83.56% .107 56.49;--uchu-orange-3:oklch(83.56% .107 56.49);--uchu-orange-4-raw:78.75% .141 54.32;--uchu-orange-4:oklch(78.75% .141 54.32);--uchu-orange-5-raw:74.61% .171 51.56;--uchu-orange-5:oklch(74.61% .171 51.56);--uchu-orange-6-raw:69.33% .157 52.18;--uchu-orange-6:oklch(69.33% .157 52.18);--uchu-orange-7-raw:63.8% .142 52.1;--uchu-orange-7:oklch(63.8% .142 52.1);--uchu-orange-8-raw:58.28% .128 52.2;--uchu-orange-8:oklch(58.28% .128 52.2);--uchu-orange-9-raw:52.49% .113 51.98;--uchu-orange-9:oklch(52.49% .113 51.98);--uchu-pink-1-raw:95.8% .023 354.27;--uchu-pink-1:oklch(95.8% .023 354.27);--uchu-pink-2-raw:92.14% .046 352.31;--uchu-pink-2:oklch(92.14% .046 352.31);--uchu-pink-3-raw:88.9% .066 354.39;--uchu-pink-3:oklch(88.9% .066 354.39);--uchu-pink-4-raw:85.43% .09 354.1;--uchu-pink-4:oklch(85.43% .09 354.1);--uchu-pink-5-raw:82.23% .112 355.33;--uchu-pink-5:oklch(82.23% .112 355.33);--uchu-pink-6-raw:76.37% .101 355.37;--uchu-pink-6:oklch(76.37% .101 355.37);--uchu-pink-7-raw:70.23% .092 354.96;--uchu-pink-7:oklch(70.23% .092 354.96);--uchu-pink-8-raw:64.11% .084 353.91;--uchu-pink-8:oklch(64.11% .084 353.91);--uchu-pink-9-raw:57.68% .074 353.14;--uchu-pink-9:oklch(57.68% .074 353.14);--uchu-purple-1-raw:89.1% .046 305.24;--uchu-purple-1:oklch(89.1% .046 305.24);--uchu-purple-2-raw:78.68% .091 305;--uchu-purple-2:oklch(78.68% .091 305);--uchu-purple-3-raw:68.5% .136 303.78;--uchu-purple-3:oklch(68.5% .136 303.78);--uchu-purple-4-raw:58.47% .181 302.06;--uchu-purple-4:oklch(58.47% .181 302.06);--uchu-purple-5-raw:49.39% .215 298.31;--uchu-purple-5:oklch(49.39% .215 298.31);--uchu-purple-6-raw:46.11% .198 298.4;--uchu-purple-6:oklch(46.11% .198 298.4);--uchu-purple-7-raw:42.77% .181 298.49;--uchu-purple-7:oklch(42.77% .181 298.49);--uchu-purple-8-raw:39.46% .164 298.29;--uchu-purple-8:oklch(39.46% .164 298.29);--uchu-purple-9-raw:36.01% .145 298.35;--uchu-purple-9:oklch(36.01% .145 298.35);--uchu-red-1-raw:88.98% .052 3.28;--uchu-red-1:oklch(88.98% .052 3.28);--uchu-red-2-raw:78.78% .109 4.54;--uchu-red-2:oklch(78.78% .109 4.54);--uchu-red-3-raw:69.86% .162 7.82;--uchu-red-3:oklch(69.86% .162 7.82);--uchu-red-4-raw:62.73% .209 12.37;--uchu-red-4:oklch(62.73% .209 12.37);--uchu-red-5-raw:58.63% .231 19.6;--uchu-red-5:oklch(58.63% .231 19.6);--uchu-red-6-raw:54.41% .214 19.06;--uchu-red-6:oklch(54.41% .214 19.06);--uchu-red-7-raw:49.95% .195 18.34;--uchu-red-7:oklch(49.95% .195 18.34);--uchu-red-8-raw:45.8% .177 17.7;--uchu-red-8:oklch(45.8% .177 17.7);--uchu-red-9-raw:41.17% .157 16.58;--uchu-red-9:oklch(41.17% .157 16.58);--uchu-yellow-1-raw:97.05% .039 91.2;--uchu-yellow-1:oklch(97.05% .039 91.2);--uchu-yellow-2-raw:95% .07 92.39;--uchu-yellow-2:oklch(95% .07 92.39);--uchu-yellow-3-raw:92.76% .098 92.58;--uchu-yellow-3:oklch(92.76% .098 92.58);--uchu-yellow-4-raw:90.92% .125 92.56;--uchu-yellow-4:oklch(90.92% .125 92.56);--uchu-yellow-5-raw:89% .146 91.5;--uchu-yellow-5:oklch(89% .146 91.5);--uchu-yellow-6-raw:82.39% .133 91.5;--uchu-yellow-6:oklch(82.39% .133 91.5);--uchu-yellow-7-raw:75.84% .122 92.21;--uchu-yellow-7:oklch(75.84% .122 92.21);--uchu-yellow-8-raw:69.14% .109 91.04;--uchu-yellow-8:oklch(69.14% .109 91.04);--uchu-yellow-9-raw:62.29% .097 91.9;--uchu-yellow-9:oklch(62.29% .097 91.9);--uchu-yin-1-raw:91.87% .003 264.54;--uchu-yin-1:oklch(91.87% .003 264.54);--uchu-yin-2-raw:84.61% .004 286.31;--uchu-yin-2:oklch(84.61% .004 286.31);--uchu-yin-3-raw:76.89% .004 247.87;--uchu-yin-3:oklch(76.89% .004 247.87);--uchu-yin-4-raw:69.17% .004 247.88;--uchu-yin-4:oklch(69.17% .004 247.88);--uchu-yin-5-raw:61.01% .005 271.34;--uchu-yin-5:oklch(61.01% .005 271.34);--uchu-yin-6-raw:52.79% .005 271.32;--uchu-yin-6:oklch(52.79% .005 271.32);--uchu-yin-7-raw:43.87% .005 271.3;--uchu-yin-7:oklch(43.87% .005 271.3);--uchu-yin-8-raw:35.02% .005 236.66;--uchu-yin-8:oklch(35.02% .005 236.66);--uchu-yin-9-raw:25.11% .006 258.36;--uchu-yin-9:oklch(25.11% .006 258.36);--uchu-yang:oklch(99.4% 0 0);--uchu-yin:oklch(14.38% .007 256.88)}.link.svelte-1lzwyfl{color:var(--uchu-blue-3);cursor:pointer;font-family:inherit;font-size:inherit;background:0 0;border:none;padding:0}.link.svelte-1lzwyfl:not(:hover){text-decoration:underline}.field.svelte-1ckn7ri{gap:1.5rem;padding:.75rem 1rem;display:grid}.heading.svelte-1ckn7ri{font-size:.95rem;font-weight:600}.section-label.svelte-1ckn7ri,.description.svelte-1ckn7ri,.arg-description.svelte-1ckn7ri{color:var(--uchu-yin-6)}.section-label.svelte-1ckn7ri{letter-spacing:.05rem;text-transform:uppercase;margin-bottom:.25rem;font-size:.7rem}.description.svelte-1ckn7ri{font-size:.8rem;line-height:1.4}.args.svelte-1ckn7ri{gap:1.5rem;display:grid}.arg.svelte-1ckn7ri{font-size:.8rem}.arg-description.svelte-1ckn7ri{margin-top:.125rem;margin-left:1rem;font-size:.7rem}.type.svelte-1lfer34{gap:1.5rem;padding:.75rem 1rem;display:grid}.heading.svelte-1lfer34{font-size:.95rem;font-weight:600}.kind.svelte-1lfer34,.description.svelte-1lfer34,.entry-description.svelte-1lfer34{color:var(--uchu-yin-6)}.kind.svelte-1lfer34{margin-right:.375rem;font-weight:400}.description.svelte-1lfer34{font-size:.8rem;line-height:1.4}.description.svelte-1lfer34 a{background-color:oklch(var(--uchu-blue-1-raw)/25%);color:var(--uchu-blue-4)}.description.svelte-1lfer34 code{background-color:var(--uchu-yellow-1)}.section-label.svelte-1lfer34{letter-spacing:.05rem;text-transform:uppercase;margin-bottom:.25rem;font-size:.7rem}.list.svelte-1lfer34{gap:1.5rem;display:grid}.entry.svelte-1lfer34{font-size:.8rem}.entry-description.svelte-1lfer34{margin-top:.125rem;margin-left:1rem;font-size:.7rem}.field-button.svelte-1lfer34{cursor:pointer;font-family:inherit;font-size:inherit;background:0 0;border:none;padding:0}.field-button.svelte-1lfer34:not(:hover){text-decoration:underline}.explorer.svelte-1qhgkss{background-color:color-mix(in oklch shorter hue, var(--uchu-gray-1) 20%, var(--uchu-yang) 80%);border-left:1px solid var(--uchu-gray-2);z-index:1;grid-template-rows:auto 1fr;height:100%;min-height:0;display:grid;overflow:hidden}.breadcrumbs.svelte-1qhgkss{border-bottom:1px solid var(--uchu-gray-2);flex-wrap:wrap;align-items:center;gap:.25rem;padding:.5rem .75rem;font-size:.8125rem;display:flex}.breadcrumbs.svelte-1qhgkss .crumb:where(.svelte-1qhgkss){cursor:pointer;font-family:inherit;font-size:inherit;background:0 0;border:none;padding:0}.breadcrumbs.svelte-1qhgkss .crumb:where(.svelte-1qhgkss):not(.current){color:var(--uchu-blue-3);text-decoration:underline}.breadcrumbs.svelte-1qhgkss .crumb.current:where(.svelte-1qhgkss){color:var(--uchu-yin-4);cursor:default}.breadcrumbs.svelte-1qhgkss .crumb.current:where(.svelte-1qhgkss):hover{text-decoration:none}.separator.svelte-1qhgkss{color:var(--uchu-gray-3)}.body.svelte-1qhgkss{min-height:0;overflow-y:auto}.root.svelte-1qhgkss{gap:.75rem;padding:.75rem 1rem;display:grid}.root-list.svelte-1qhgkss{gap:.375rem;display:grid}.root-link.svelte-1qhgkss{color:var(--uchu-blue-3);cursor:pointer;text-align:left;background:0 0;border:none;padding:0;font-family:inherit;font-size:.95rem}.root-link.svelte-1qhgkss:hover{text-decoration:underline}.section-label.svelte-1qhgkss{color:var(--uchu-yin-6);letter-spacing:.05rem;text-transform:uppercase;margin-bottom:.25rem;font-size:.7rem}.empty.svelte-1qhgkss{color:var(--uchu-yin-6);padding:.75rem 1rem;font-size:.8rem}.editor.svelte-mhzyj2{width:100%;height:100%}.editor.svelte-mhzyj2 .cm-editor{height:100%}.editor.svelte-mhzyj2 .cm-scroller{font-family:inherit}.panel.svelte-1x0f4yt{background-color:var(--uchu-yin-9);color:var(--uchu-yin-1);z-index:2;grid-template-rows:auto 1fr;height:100%;min-height:0;font-size:.8rem;display:grid;overflow:hidden}.header.svelte-1x0f4yt,.notice.svelte-1x0f4yt{border-bottom:1px solid var(--uchu-yin-8);justify-content:space-between;align-items:center;gap:.5rem;padding:.5rem .75rem;display:flex}.title.svelte-1x0f4yt{font-weight:600}.actions.svelte-1x0f4yt{gap:.5rem;display:flex}.actions.svelte-1x0f4yt .action:where(.svelte-1x0f4yt){cursor:pointer;background:0 0;border:none;padding:0;font-family:inherit;font-size:.75rem}.action.svelte-1x0f4yt:not(:hover),.notice-dismiss.svelte-1x0f4yt:not(:hover),.remove.svelte-1x0f4yt:not(:hover){color:var(--uchu-yin-5)}.action.svelte-1x0f4yt:hover,.notice-dismiss.svelte-1x0f4yt:hover,.remove.svelte-1x0f4yt:hover{color:var(--uchu-yin-1)}.hidden-input.svelte-1x0f4yt{display:none}.notice-dismiss.svelte-1x0f4yt,.remove.svelte-1x0f4yt{cursor:pointer;background:0 0;border:none;padding:0 .25rem;font-size:1rem;line-height:1}.list.svelte-1x0f4yt{min-height:0;display:grid;overflow-y:auto}.entry.svelte-1x0f4yt{cursor:pointer;grid-template-columns:auto 1fr auto;align-items:flex-start;gap:.125rem;padding:.375rem .75rem;transition:opacity .1s;display:grid}.entry.svelte-1x0f4yt:not(:last-of-type){border-bottom:1px solid var(--uchu-yin)}.entry.svelte-1x0f4yt:hover{background-color:var(--uchu-yin)}.list.svelte-1x0f4yt:has(.entry:where(.svelte-1x0f4yt):hover) .entry:where(.svelte-1x0f4yt):not(:hover){opacity:.4}.entry-title.svelte-1x0f4yt{text-overflow:ellipsis;white-space:nowrap;margin-bottom:.1rem;font-size:.8rem;overflow:hidden}.entry-time.svelte-1x0f4yt{color:var(--uchu-yin-5);font-size:.7rem}.star.svelte-1x0f4yt{cursor:pointer;background:0 0;border:none;align-self:center;padding:0 .375rem 0 0;font-size:.8rem}.star.svelte-1x0f4yt:not(.active){color:var(--uchu-yin-5)}.star.active.svelte-1x0f4yt{color:var(--uchu-orange-4)}.star.active.svelte-1x0f4yt svg:where(.svelte-1x0f4yt){fill:currentColor}.star.svelte-1x0f4yt svg:where(.svelte-1x0f4yt){width:1rem}.meta.svelte-1x0f4yt{align-self:center;min-width:0}.remove.svelte-1x0f4yt{align-self:center}.empty.svelte-1x0f4yt{color:var(--uchu-yin-5);padding:.75rem;font-size:.8rem}.result.svelte-1l6l2pw{flex-direction:column;height:100%;min-height:0;display:flex;position:relative}.label.svelte-1l6l2pw,.metadata.svelte-1l6l2pw,.footer.svelte-1l6l2pw{padding:.25rem .75rem;font-size:.75rem}.label.svelte-1l6l2pw,.metadata.svelte-1l6l2pw{background-color:var(--uchu-gray-2);color:var(--uchu-yin-7)}.label.svelte-1l6l2pw{border:1px solid var(--uchu-gray-3);letter-spacing:.05rem;pointer-events:none;text-transform:uppercase;z-index:1;font-weight:600;position:absolute;top:1rem;right:1rem}.metadata.svelte-1l6l2pw,.footer.svelte-1l6l2pw{position:relative}.metadata.svelte-1l6l2pw{flex-direction:row;align-items:center;display:flex}.metadata.svelte-1l6l2pw svg:where(.svelte-1l6l2pw){width:1rem;height:1rem;margin-right:.25rem}.footer.svelte-1l6l2pw{background-color:var(--uchu-gray-3);border-top:1px solid var(--uchu-gray-4)}.splitter.svelte-1f4xp5w{touch-action:none;-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex;position:relative}.splitter.svelte-1f4xp5w:after{content:"";border-radius:25rem;transition:background .12s;position:absolute}.splitter.svelte-1f4xp5w:not(:hover):not(.dragging){background-color:#0000}.splitter.svelte-1f4xp5w:not(:hover):not(.dragging):after{background-color:inherit}.splitter.svelte-1f4xp5w:hover,.splitter.dragging.svelte-1f4xp5w{background-color:oklch(var(--uchu-gray-2-raw)/25%)}.splitter.svelte-1f4xp5w:hover:after,.splitter.svelte-1f4xp5w:hover:after,.splitter.dragging.svelte-1f4xp5w:after,.splitter.dragging.svelte-1f4xp5w:after{background-color:var(--uchu-orange-4)}.splitter.horizontal.svelte-1f4xp5w{cursor:col-resize;width:6px;height:100%}.splitter.horizontal.svelte-1f4xp5w:after{width:3px;height:60%}.splitter.vertical.svelte-1f4xp5w{cursor:row-resize;width:100%;height:6px}.splitter.vertical.svelte-1f4xp5w:after{width:60%;height:3px}.tabbar.svelte-1s5m1m3{background-color:var(--uchu-gray-2);align-items:stretch;min-height:2rem;font-size:.8rem;display:flex;overflow-x:auto}.tabbar.svelte-1s5m1m3 .tab:where(.svelte-1s5m1m3){cursor:pointer;border:none;align-items:center;gap:.5rem;padding:0 .75rem;display:flex}.tabbar.svelte-1s5m1m3 .tab:where(.svelte-1s5m1m3):not(:hover):not(.active){color:var(--uchu-yin-5)}.tabbar.svelte-1s5m1m3 .tab:where(.svelte-1s5m1m3):hover:not(.active){color:var(--uchu-yin-8)}.tabbar.svelte-1s5m1m3 .tab:where(.svelte-1s5m1m3):not(.active){background-color:#0000}.tabbar.svelte-1s5m1m3 .tab.active:where(.svelte-1s5m1m3){background-color:var(--uchu-gray-3);color:var(--uchu-yin-8)}.title.svelte-1s5m1m3{white-space:nowrap}.edit.svelte-1s5m1m3{background-color:var(--uchu-orange-5);border:1px solid var(--uchu-orange-5);color:var(--uchu-yang);font-family:inherit;font-size:inherit;outline:none;min-width:6rem;padding:.125rem .25rem}.close.svelte-1s5m1m3{color:inherit;cursor:pointer;background:0 0;border:none;padding:0;font-size:1rem;line-height:1}.close.svelte-1s5m1m3:not(:hover){opacity:.6}.close.svelte-1s5m1m3:hover{opacity:1}.add.svelte-1s5m1m3{border:none;border-left:1px solid var(--uchu-gray-3);cursor:pointer;background:0 0;padding:0 .75rem;font-size:1rem}.add.svelte-1s5m1m3:not(:hover){color:var(--uchu-yin-5)}.add.svelte-1s5m1m3:hover{color:var(--uchu-yin-8)}.toolbar.svelte-50ld1a{background-color:var(--uchu-yang);align-items:center;gap:.75rem;padding:.5rem .75rem;display:flex}.run.svelte-50ld1a,.toggle.svelte-50ld1a{border:none;flex-direction:row;align-items:center;padding:.2rem .75rem .2rem .5rem;font-size:.8rem;display:flex}.run.svelte-50ld1a:not(:disabled),.toggle.svelte-50ld1a:not(:disabled){cursor:pointer}.run.svelte-50ld1a:disabled,.toggle.svelte-50ld1a:disabled{cursor:not-allowed;opacity:.5}.run.svelte-50ld1a svg:where(.svelte-50ld1a),.toggle.svelte-50ld1a svg:where(.svelte-50ld1a){fill:currentColor;width:1rem;height:1rem;margin-right:.25rem}.run.svelte-50ld1a{background-color:var(--uchu-orange-5);color:var(--uchu-yang)}.run.svelte-50ld1a:hover:not(:disabled){color:var(--uchu-orange-1)}.hint.svelte-50ld1a{color:var(--uchu-yin-5);font-size:.75rem}.picker.svelte-50ld1a{border:none;border-radius:0;padding:.2rem .75rem .2rem .5rem;font-size:.8rem}.picker.svelte-50ld1a:not(:focus-visible){background-color:var(--uchu-gray-1);color:var(--uchu-yin-5)}.picker.svelte-50ld1a:focus-visible{background-color:var(--uchu-orange-5);color:var(--uchu-yang);outline-color:var(--uchu-orange-5);outline-offset:-1px;outline-style:solid}.spacer.svelte-50ld1a{flex:1}.toggle.svelte-50ld1a{background-color:var(--uchu-gray-1);color:var(--uchu-yin-5)}.toggle.active.svelte-50ld1a{background-color:var(--uchu-yin);color:var(--uchu-yang)}.toggle.svelte-50ld1a:not(.active):hover:not(:disabled){color:var(--uchu-yin-8)}.graphiql.svelte-pvt4yg{background-color:var(--uchu-yang);width:100%;height:100%;color:var(--uchu-yin-9);overscroll-behavior:none;font-family:Berkeley Mono,ui-monospace,SFMono-Regular,monospace;font-size:16px;overflow:hidden}@media (width>=1025px){.graphiql.svelte-pvt4yg{grid-template-rows:auto auto 1fr;display:grid}}@media (width<=1024px){.graphiql.svelte-pvt4yg{flex-direction:column;display:flex}}.panes.svelte-pvt4yg{grid-template-columns:1fr;min-height:0;display:grid}@media (width<=1024px){.panes.svelte-pvt4yg{height:-webkit-fill-available;height:-moz-available;height:stretch}}.panes.history-open.svelte-pvt4yg{grid-template-columns:var(--graphiql-history-width) 6px 1fr}.panes.docs-open.svelte-pvt4yg{grid-template-columns:1fr 6px var(--graphiql-docs-width)}.panes.history-open.docs-open.svelte-pvt4yg{grid-template-columns:var(--graphiql-history-width) 6px 1fr 6px var(--graphiql-docs-width)}.center.svelte-pvt4yg,.left.svelte-pvt4yg{min-width:0;min-height:0;margin-right:-6px}@media (width>=1025px){.center.svelte-pvt4yg{grid-template-columns:var(--graphiql-left-width) 6px calc(100% - var(--graphiql-left-width) - 6px);display:grid}}@media (width<=1024px){.center.svelte-pvt4yg{flex-direction:column;display:flex}}.center.svelte-pvt4yg .query:where(.svelte-pvt4yg){flex:2;min-height:0;margin-bottom:-6px}.center.svelte-pvt4yg .bottom:where(.svelte-pvt4yg){flex:1;min-height:0}.center.svelte-pvt4yg .left:where(.svelte-pvt4yg){flex-direction:column;display:flex;overflow-x:hidden}@media (width<=1024px){.center.svelte-pvt4yg .left:where(.svelte-pvt4yg){flex:2}}.center.svelte-pvt4yg .right:where(.svelte-pvt4yg){min-height:0}@media (width<=1024px){.center.svelte-pvt4yg .right:where(.svelte-pvt4yg){border-top:2px solid var(--uchu-gray-3);flex:1}}.switcher.svelte-pvt4yg{background-color:var(--uchu-gray-2);flex-direction:row;display:flex}.switcher.svelte-pvt4yg .switch:where(.svelte-pvt4yg){cursor:pointer;letter-spacing:.05rem;text-transform:uppercase;background:0 0;border:none;padding:.375rem .75rem;font-family:Berkeley Mono,ui-monospace,SFMono-Regular,monospace;font-size:.75rem;font-weight:600}.switcher.svelte-pvt4yg .switch:where(.svelte-pvt4yg):not(.active){color:var(--uchu-yin-5)}.switcher.svelte-pvt4yg .switch.active:where(.svelte-pvt4yg){background-color:var(--uchu-gray-3)}.status.svelte-pvt4yg{background-color:var(--uchu-yellow-2);border-top:1px solid var(--uchu-yellow-3);color:var(--uchu-yellow-9);padding:.25rem .75rem;font-size:.75rem}.status.svelte-pvt4yg span:where(.svelte-pvt4yg){text-transform:uppercase} +/*$vite$:1*/
\ No newline at end of file diff --git a/source/graphiql/standalone.js b/source/graphiql/standalone.js new file mode 100644 index 0000000..ca9e99f --- /dev/null +++ b/source/graphiql/standalone.js @@ -0,0 +1,207 @@ +var EolGraphiQL=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,t)=>()=>(e&&(t=e(e=0)),t),r=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),i=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},a=Array.isArray,o=Array.prototype.indexOf,s=Array.prototype.includes,c=Array.from,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyDescriptors,f=Object.prototype,p=Array.prototype,m=Object.getPrototypeOf,h=Object.isExtensible,g=()=>{};function _(e){for(var t=0;t<e.length;t++)e[t]()}function v(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var y=1024,b=2048,x=4096,S=8192,ee=16384,C=32768,te=1<<25,ne=65536,re=1<<19,ie=1<<20,ae=1<<25,oe=65536,se=1<<21,ce=1<<22,le=1<<23,ue=Symbol(`$state`),de=Symbol(`legacy props`),fe=Symbol(``),pe=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},me=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function he(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function ge(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function _e(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function ve(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function ye(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function be(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function xe(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Se(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Ce(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function we(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Te(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Ee(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var De={},Oe=Symbol(),ke=`http://www.w3.org/1999/xhtml`,Ae=`http://www.w3.org/2000/svg`,je=`http://www.w3.org/1998/Math/MathML`;function Me(){console.warn(`https://svelte.dev/e/derived_inert`)}function Ne(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Pe(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function Fe(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var w=!1;function Ie(e){w=e}var Le;function Re(e){if(e===null)throw Ne(),De;return Le=e}function ze(){return Re(vn(Le))}function T(e){if(w){if(vn(Le)!==null)throw Ne(),De;Le=e}}function Be(e=1){if(w){for(var t=e,n=Le;t--;)n=vn(n);Le=n}}function Ve(e=!0){for(var t=0,n=Le;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=vn(n);e&&n.remove(),n=i}}function He(e){if(!e||e.nodeType!==8)throw Ne(),De;return e.data}function Ue(e){return e===this.v}function We(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Ge(e){return!We(e,this.v)}var Ke=!1,qe=!1,Je=null;function Ye(e){Je=e}function Xe(e,t=!1,n){Je={p:Je,i:!1,c:null,e:null,s:e,x:null,r:or,l:qe&&!t?{s:null,u:null,$:[]}:null}}function Ze(e){var t=Je,n=t.e;if(n!==null){t.e=null;for(var r of n)Pn(r)}return e!==void 0&&(t.x=e),t.i=!0,Je=t.p,e??{}}function Qe(){return!qe||Je!==null&&Je.l===null}var $e=[];function et(){var e=$e;$e=[],_(e)}function tt(e){if($e.length===0&&!vt){var t=$e;queueMicrotask(()=>{t===$e&&et()})}$e.push(e)}function nt(){for(;$e.length>0;)et()}function rt(e){var t=or;if(t===null)return rr.f|=le,e;if(!(t.f&32768)&&!(t.f&4))throw e;it(e,t)}function it(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var at=~(b|x|y);function ot(e,t){e.f=e.f&at|t}function st(e){e.f&512||e.deps===null?ot(e,y):ot(e,x)}function ct(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=oe,ct(t.deps))}function lt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),ct(e.deps),ot(e,y)}var ut=!1,dt=!1;function ft(e){var t=dt;try{return dt=!1,[e(),dt]}finally{dt=t}}var pt=new Set,mt=null,ht=null,gt=null,_t=null,vt=!1,yt=!1,bt=null,xt=null,St=0,Ct=1,wt=class e{id=Ct++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=new Set;#r=new Map;#i=new Map;#a=null;#o=[];#s=[];#c=new Set;#l=new Set;#u=new Map;#d=new Set;is_fork=!1;#f=!1;#p=new Set;#m(){return this.is_fork||this.#i.size>0}#h(){for(let n of this.#p)for(let r of n.#i.keys()){for(var e=!1,t=r;t.parent!==null;){if(this.#u.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#u.has(e)||this.#u.set(e,{d:[],m:[]}),this.#d.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#u.get(e);if(n){this.#u.delete(e);for(var r of n.d)ot(r,b),t(r);for(r of n.m)ot(r,x),t(r)}this.#d.add(e)}#g(){if(St++>1e3&&(pt.delete(this),Et()),!this.#m()){for(let e of this.#c)this.#l.delete(e),ot(e,b),this.schedule(e);for(let e of this.#l)ot(e,x),this.schedule(e)}let t=this.#o;this.#o=[],this.apply();var n=bt=[],r=[],i=xt=[];for(let e of t)try{this.#_(e,n,r)}catch(t){throw Nt(e),t}if(mt=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(bt=null,xt=null,this.#m()||this.#h()){this.#v(r),this.#v(n);for(let[e,t]of this.#u)Mt(e,t)}else{this.#r.size===0&&pt.delete(this),this.#c.clear(),this.#l.clear();for(let e of this.#e)e(this);this.#e.clear(),ht=this,Ot(r),Ot(n),ht=null,this.#a?.resolve()}var o=mt;if(this.#o.length>0){let e=o??=this;e.#o.push(...this.#o.filter(t=>!e.#o.includes(t)))}o!==null&&(pt.add(o),o.#g()),Ke&&!pt.has(this)&&this.#y()}#_(e,t,n){e.f^=y;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#u.has(r))&&r.fn!==null){a?r.f^=y:i&4?t.push(r):Ke&&i&16777224?n.push(r):yr(r)&&(i&16&&this.#l.add(r),wr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#v(e){for(var t=0;t<e.length;t+=1)lt(e[t],this.#c,this.#l)}capture(e,t,n=!1){e.v!==Oe&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),gt?.set(e,t)),this.is_fork||(e.v=t)}activate(){mt=this}deactivate(){mt=null,gt=null}flush(){try{yt=!0,mt=this,this.#g()}finally{St=0,_t=null,bt=null,xt=null,yt=!1,mt=null,gt=null,Qt.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),this.#n.clear(),pt.delete(this)}register_created_effect(e){this.#s.push(e)}#y(){for(let l of pt){var e=l.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(l.current.has(r)){var n=l.current.get(r)[0];if(e&&i!==n)l.current.set(r,[i,a]);else continue}t.push(r)}var r=[...l.current.keys()].filter(e=>!this.current.has(e));if(r.length===0)e&&l.discard();else if(t.length>0){if(e)for(let e of this.#d)l.unskip_effect(e,e=>{e.f&4194320?l.schedule(e):l.#v([e])});l.activate();var i=new Set,a=new Map;for(var o of t)kt(o,r,i,a);a=new Map;var s=[...l.current.keys()].filter(e=>this.current.has(e)?this.current.get(e)[0]!==e:!0);for(let e of this.#s)!(e.f&155648)&&At(e,s,a)&&(e.f&4194320?(ot(e,b),l.schedule(e)):l.#c.add(e));if(l.#o.length>0){l.apply();for(var c of l.#o)l.#_(c,[],[]);l.#o=[]}l.deactivate()}}for(let e of pt)e.#p.has(this)&&(e.#p.delete(this),e.#p.size===0&&!e.#m()&&(e.activate(),e.#g()))}increment(e,t){let n=this.#r.get(t)??0;if(this.#r.set(t,n+1),e){let e=this.#i.get(t)??0;this.#i.set(t,e+1)}}decrement(e,t,n){let r=this.#r.get(t)??0;if(r===1?this.#r.delete(t):this.#r.set(t,r-1),e){let e=this.#i.get(t)??0;e===1?this.#i.delete(t):this.#i.set(t,e-1)}this.#f||n||(this.#f=!0,tt(()=>{this.#f=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#c.add(t);for(let e of t)this.#l.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}on_fork_commit(e){this.#n.add(e)}run_fork_commit_callbacks(){for(let e of this.#n)e(this);this.#n.clear()}settled(){return(this.#a??=v()).promise}static ensure(){if(mt===null){let t=mt=new e;yt||(pt.add(mt),vt||tt(()=>{mt===t&&t.flush()}))}return mt}apply(){if(!Ke||!this.is_fork&&pt.size===1){gt=null;return}gt=new Map;for(let[e,[t]]of this.current)gt.set(e,t);for(let n of pt)if(!(n===this||n.is_fork)){var e=!1,t=!1;if(n.id<this.id)for(let[r,[,i]]of n.current)i||(e||=this.current.has(r),t||=!this.current.has(r));if(e&&t)this.#p.add(n);else for(let[e,t]of n.previous)gt.has(e)||gt.set(e,t)}}schedule(e){if(_t=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(bt!==null&&t===or&&(Ke||(rr===null||!(rr.f&2))&&!ut))return;if(n&96){if(!(n&1024))return;t.f^=y}}this.#o.push(t)}};function Tt(e){var t=vt;vt=!0;try{var n;for(e&&(mt!==null&&!mt.is_fork&&mt.flush(),n=e());;){if(nt(),mt===null)return n;mt.flush()}}finally{vt=t}}function Et(){try{xe()}catch(e){it(e,_t)}}var Dt=null;function Ot(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&yr(r)&&(Dt=new Set,wr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&qn(r),Dt?.size>0)){Qt.clear();for(let e of Dt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Dt.has(n)&&(Dt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||wr(n)}}Dt.clear()}}Dt=null}}function kt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?kt(i,t,n,r):e&4194320&&!(e&2048)&&At(i,t,r)&&(ot(i,b),jt(i))}}function At(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(s.call(t,r))return!0;if(r.f&2&&At(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function jt(e){mt.schedule(e)}function Mt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),ot(e,y);for(var n=e.first;n!==null;)Mt(n,t),n=n.next}}function Nt(e){ot(e,y);for(var t=e.first;t!==null;)Nt(t),t=t.next}function Pt(e){let t=0,n=en(0),r;return()=>{jn()&&(k(n),Rn(()=>(t===0&&(r=Or(()=>e(()=>on(n)))),t+=1,()=>{tt(()=>{--t,t===0&&(r?.(),r=void 0,on(n))})})))}}var Ft=ne|re;function It(e,t,n,r){new Lt(e,t,n,r)}var Lt=class{parent;is_pending=!1;transform_error;#e;#t=w?Le:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Pt(()=>(this.#m=en(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=or;t.b=this,t.f|=128,n(e)},this.parent=or.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=Bn(()=>{if(w){let e=this.#t;ze();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},Ft),w&&(this.#e=Le)}#g(){try{this.#a=Vn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=Vn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Vn(()=>e(this.#e)),tt(()=>{var e=this.#c=document.createDocumentFragment(),t=gn();e.append(t),this.#a=this.#x(()=>Vn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,Jn(this.#o,()=>{this.#o=null}),this.#b(mt))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Vn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Qn(this.#a,e);let t=this.#n.pending;this.#o=Vn(()=>t(this.#e))}else this.#b(mt)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){lt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=or,n=rr,r=Je;sr(this.#i),ar(this.#i),Ye(this.#i.ctx);try{return wt.ensure(),e()}catch(e){return rt(e),null}finally{sr(t),ar(n),Ye(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&Jn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,tt(()=>{this.#d=!1,this.#m&&rn(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),k(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;mt?.is_fork?(this.#a&&mt.skip_effect(this.#a),this.#o&&mt.skip_effect(this.#o),this.#s&&mt.skip_effect(this.#s),mt.on_fork_commit(()=>{this.#C(e)})):this.#C(e)}#C(e){this.#a&&=(Gn(this.#a),null),this.#o&&=(Gn(this.#o),null),this.#s&&=(Gn(this.#s),null),w&&(Re(this.#t),Be(),Re(Ve()));var t=this.#n.onerror;let n=this.#n.failed;var r=!1,i=!1;let a=()=>{if(r){Fe();return}r=!0,i&&Ee(),this.#s!==null&&Jn(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){it(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return Vn(()=>{var t=or;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return it(e,this.#i.parent),null}}))};tt(()=>{var t;try{t=this.transform_error(e)}catch(e){it(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>it(e,this.#i&&this.#i.parent)):o(t)})}};function Rt(e,t,n,r){let i=Qe()?Ht:Gt;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=or,s=zt(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||it(e,o)}Bt()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=Vt();function d(){Promise.all(n.map(e=>Ut(e))).then(e=>l([...t.map(i),...e])).catch(e=>it(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),Bt()}):d()}function zt(){var e=or,t=rr,n=Je,r=mt;return function(i=!0){sr(e),ar(t),Ye(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Bt(e=!0){sr(null),ar(null),Ye(null),e&&mt?.deactivate()}function Vt(){var e=or,t=e.b,n=mt,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function Ht(e){var t=2|b;return or!==null&&(or.f|=re),{ctx:Je,deps:null,effects:null,equals:Ue,f:t,fn:e,reactions:null,rv:0,v:Oe,wv:0,parent:or,ac:null}}function Ut(e,t,n){let r=or;r===null&&ge();var i=void 0,a=en(Oe),o=!rr,s=new Map;return Ln(()=>{var t=or,n=v();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(Bt)}catch(e){n.reject(e),Bt()}var c=mt;if(o){if(t.f&32768)var l=Vt();if(r.b.is_rendered())s.get(c)?.reject(pe),s.delete(c);else{for(let e of s.values())e.reject(pe);s.clear()}s.set(c,n)}let u=(e,n=void 0)=>{if(l&&l(n===pe),!(n===pe||t.f&16384)){if(c.activate(),n)a.f|=le,rn(a,n);else{a.f&8388608&&(a.f^=le),rn(a,e);for(let[e,t]of s){if(s.delete(e),e===c)break;t.reject(pe)}}c.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),Mn(()=>{for(let e of s.values())e.reject(pe)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function Wt(e){let t=Ht(e);return Ke||lr(t),t}function Gt(e){let t=Ht(e);return t.equals=Ge,t}function Kt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Gn(t[n])}}function qt(e){var t,n=or,r=e.parent;if(!tr&&r!==null&&r.f&24576)return Me(),e.v;sr(r);try{e.f&=~oe,Kt(e),t=xr(e)}finally{sr(n)}return t}function Jt(e){var t=qt(e);if(!e.equals(t)&&(e.wv=vr(),(!mt?.is_fork||e.deps===null)&&(mt===null?e.v=t:mt.capture(e,t,!0),e.deps===null))){ot(e,y);return}tr||(gt===null?st(e):(jn()||mt?.is_fork)&>.set(e,t))}function Yt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(pe),t.teardown=g,t.ac=null,Cr(t,0),Un(t))}function Xt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&wr(t)}var Zt=new Set,Qt=new Map,$t=!1;function en(e,t){return{f:0,v:e,reactions:null,equals:Ue,rv:0,wv:0}}function tn(e,t){let n=en(e,t);return lr(n),n}function nn(e,t=!1,n=!0){let r=en(e);return t||(r.equals=Ge),qe&&n&&Je!==null&&Je.l!==null&&(Je.l.s??=[]).push(r),r}function E(e,t,n=!1){return rr!==null&&(!ir||rr.f&131072)&&Qe()&&rr.f&4325394&&(cr===null||!s.call(cr,e))&&Te(),rn(e,n?cn(t):t,xt)}function rn(e,t,n=null){if(!e.equals(t)){Qt.set(e,tr?t:e.v);var r=wt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&qt(t),gt===null&&st(t)}e.wv=vr(),sn(e,b,n),Qe()&&or!==null&&or.f&1024&&!(or.f&96)&&(fr===null?pr([e]):fr.push(e)),!r.is_fork&&Zt.size>0&&!$t&&an()}return t}function an(){$t=!1;for(let e of Zt)e.f&1024&&ot(e,x),yr(e)&&wr(e);Zt.clear()}function on(e){E(e,e.v+1)}function sn(e,t,n){var r=e.reactions;if(r!==null)for(var i=Qe(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===or)){var l=(c&b)===0;if(l&&ot(s,t),c&2){var u=s;gt?.delete(u),c&65536||(c&512&&(or===null||!(or.f&2097152))&&(s.f|=oe),sn(u,x,n))}else if(l){var d=s;c&16&&Dt!==null&&Dt.add(d),n===null?jt(d):n.push(d)}}}}function cn(e){if(typeof e!=`object`||!e||ue in e)return e;let t=m(e);if(t!==f&&t!==p)return e;var n=new Map,r=a(e),i=tn(0),o=null,s=gr,c=e=>{if(gr===s)return e();var t=rr,n=gr;ar(null),_r(s);var r=e();return ar(t),_r(n),r};return r&&n.set(`length`,tn(e.length,o)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&Ce();var i=n.get(t);return i===void 0?c(()=>{var e=tn(r.value,o);return n.set(t,e),e}):E(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=c(()=>tn(Oe,o));n.set(t,e),on(i)}}else E(r,Oe),on(i);return!0},get(t,r,i){if(r===ue)return e;var a=n.get(r),s=r in t;if(a===void 0&&(!s||u(t,r)?.writable)&&(a=c(()=>tn(cn(s?t[r]:Oe),o)),n.set(r,a)),a!==void 0){var l=k(a);return l===Oe?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var i=n.get(t);i&&(r.value=k(i))}else if(r===void 0){var a=n.get(t),o=a?.v;if(a!==void 0&&o!==Oe)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){if(t===ue)return!0;var r=n.get(t),i=r!==void 0&&r.v!==Oe||Reflect.has(e,t);return(r!==void 0||or!==null&&(!i||u(e,t)?.writable))&&(r===void 0&&(r=c(()=>tn(i?cn(e[t]):Oe,o)),n.set(t,r)),k(r)===Oe)?!1:i},set(e,t,a,s){var l=n.get(t),d=t in e;if(r&&t===`length`)for(var f=a;f<l.v;f+=1){var p=n.get(f+``);p===void 0?f in e&&(p=c(()=>tn(Oe,o)),n.set(f+``,p)):E(p,Oe)}if(l===void 0)(!d||u(e,t)?.writable)&&(l=c(()=>tn(void 0,o)),E(l,cn(a)),n.set(t,l));else{d=l.v!==Oe;var m=c(()=>cn(a));E(l,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,a),!d){if(r&&typeof t==`string`){var g=n.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&E(g,_+1)}on(i)}return!0},ownKeys(e){k(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==Oe});for(var[r,a]of n)a.v!==Oe&&!(r in e)&&t.push(r);return t},setPrototypeOf(){we()}})}function ln(e){try{if(typeof e==`object`&&e&&ue in e)return e[ue]}catch{}return e}function un(e,t){return Object.is(ln(e),ln(t))}var dn,fn,pn,mn;function hn(){if(dn===void 0){dn=window,fn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;pn=u(t,`firstChild`).get,mn=u(t,`nextSibling`).get,h(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),h(n)&&(n.__t=void 0)}}function gn(e=``){return document.createTextNode(e)}function _n(e){return pn.call(e)}function vn(e){return mn.call(e)}function D(e,t){if(!w)return _n(e);var n=_n(Le);if(n===null)n=Le.appendChild(gn());else if(t&&n.nodeType!==3){var r=gn();return n?.before(r),Re(r),r}return t&&Cn(n),Re(n),n}function yn(e,t=!1){if(!w){var n=_n(e);return n instanceof Comment&&n.data===``?vn(n):n}if(t){if(Le?.nodeType!==3){var r=gn();return Le?.before(r),Re(r),r}Cn(Le)}return Le}function O(e,t=1,n=!1){let r=w?Le:e;for(var i;t--;)i=r,r=vn(r);if(!w)return r;if(n){if(r?.nodeType!==3){var a=gn();return r===null?i?.after(a):r.before(a),Re(a),a}Cn(r)}return Re(r),r}function bn(e){e.textContent=``}function xn(){return!Ke||Dt!==null?!1:(or.f&C)!==0}function Sn(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function Cn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}var wn=!1;function Tn(){wn||(wn=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function En(e){var t=rr,n=or;ar(null),sr(null);try{return e()}finally{ar(t),sr(n)}}function Dn(e,t,n,r=n){e.addEventListener(t,()=>En(n));let i=e.__on_r;i?e.__on_r=()=>{i(),r(!0)}:e.__on_r=()=>r(!0),Tn()}function On(e){or===null&&(rr===null&&be(e),ye()),tr&&ve(e)}function kn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function An(e,t){var n=or;n!==null&&n.f&8192&&(e|=S);var r={ctx:Je,deps:null,nodes:null,f:e|b|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};mt?.register_created_effect(r);var i=r;if(e&4)bt===null?wt.ensure().schedule(r):bt.push(r);else if(t!==null){try{wr(r)}catch(e){throw Gn(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ne))}if(i!==null&&(i.parent=n,n!==null&&kn(i,n),rr!==null&&rr.f&2&&!(e&64))){var a=rr;(a.effects??=[]).push(i)}return r}function jn(){return rr!==null&&!ir}function Mn(e){let t=An(8,null);return ot(t,y),t.teardown=e,t}function Nn(e){On(`$effect`);var t=or.f;if(!rr&&t&32&&!(t&32768)){var n=Je;(n.e??=[]).push(e)}else return Pn(e)}function Pn(e){return An(4|ie,e)}function Fn(e){wt.ensure();let t=An(64|re,e);return(e={})=>new Promise(n=>{e.outro?Jn(t,()=>{Gn(t),n(void 0)}):(Gn(t),n(void 0))})}function In(e){return An(4,e)}function Ln(e){return An(ce|re,e)}function Rn(e,t=0){return An(8|t,e)}function zn(e,t=[],n=[],r=[]){Rt(r,t,n,t=>{An(8,()=>e(...t.map(k)))})}function Bn(e,t=0){return An(16|t,e)}function Vn(e){return An(32|re,e)}function Hn(e){var t=e.teardown;if(t!==null){let e=tr,n=rr;nr(!0),ar(null);try{t.call(null)}finally{nr(e),ar(n)}}}function Un(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&En(()=>{e.abort(pe)});var r=n.next;n.f&64?n.parent=null:Gn(n,t),n=r}}function Wn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Gn(t),t=n}}function Gn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Kn(e.nodes.start,e.nodes.end),n=!0),ot(e,te),Un(e,t&&!n),Cr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Hn(e),e.f^=te,e.f|=ee;var i=e.parent;i!==null&&i.first!==null&&qn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Kn(e,t){for(;e!==null;){var n=e===t?null:vn(e);e.remove(),e=n}}function qn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Jn(e,t,n=!0){var r=[];Yn(e,r,!0);var i=()=>{n&&Gn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Yn(e,t,n){if(!(e.f&8192)){e.f^=S;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;Yn(i,t,o?n:!1)}i=a}}}function Xn(e){Zn(e,!0)}function Zn(e,t){if(e.f&8192){e.f^=S,e.f&1024||(ot(e,b),wt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;Zn(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Qn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:vn(n);t.append(n),n=i}}var $n=null,er=!1,tr=!1;function nr(e){tr=e}var rr=null,ir=!1;function ar(e){rr=e}var or=null;function sr(e){or=e}var cr=null;function lr(e){rr!==null&&(!Ke||rr.f&2)&&(cr===null?cr=[e]:cr.push(e))}var ur=null,dr=0,fr=null;function pr(e){fr=e}var mr=1,hr=0,gr=hr;function _r(e){gr=e}function vr(){return++mr}function yr(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~oe),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(yr(a)&&Jt(a),a.wv>e.wv)return!0}t&512&>===null&&ot(e,y)}return!1}function br(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!Ke&&cr!==null&&s.call(cr,e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?br(a,t,!1):t===a&&(n?ot(a,b):a.f&1024&&ot(a,x),jt(a))}}function xr(e){var t=ur,n=dr,r=fr,i=rr,a=cr,o=Je,s=ir,c=gr,l=e.f;ur=null,dr=0,fr=null,rr=l&96?null:e,cr=null,Ye(e.ctx),ir=!1,gr=++hr,e.ac!==null&&(En(()=>{e.ac.abort(pe)}),e.ac=null);try{e.f|=se;var u=e.fn,d=u();e.f|=C;var f=e.deps,p=mt?.is_fork;if(ur!==null){var m;if(p||Cr(e,dr),f!==null&&dr>0)for(f.length=dr+ur.length,m=0;m<ur.length;m++)f[dr+m]=ur[m];else e.deps=f=ur;if(jn()&&e.f&512)for(m=dr;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&dr<f.length&&(Cr(e,dr),f.length=dr);if(Qe()&&fr!==null&&!ir&&f!==null&&!(e.f&6146))for(m=0;m<fr.length;m++)br(fr[m],e);if(i!==null&&i!==e){if(hr++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=hr;if(t!==null)for(let e of t)e.rv=hr;fr!==null&&(r===null?r=fr:r.push(...fr))}return e.f&8388608&&(e.f^=le),d}catch(e){return rt(e)}finally{e.f^=se,ur=t,dr=n,fr=r,rr=i,cr=a,Ye(o),ir=s,gr=c}}function Sr(e,t){let n=t.reactions;if(n!==null){var r=o.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(ur===null||!s.call(ur,t))){var a=t;a.f&512&&(a.f^=512,a.f&=~oe),a.v!==Oe&&st(a),Yt(a),Cr(a,0)}}function Cr(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)Sr(e,n[r])}function wr(e){var t=e.f;if(!(t&16384)){ot(e,y);var n=or,r=er;or=e,er=!0;try{t&16777232?Wn(e):Un(e),Hn(e);var i=xr(e);e.teardown=typeof i==`function`?i:null,e.wv=mr}finally{er=r,or=n}}}async function Tr(){if(Ke)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),Tt()}function k(e){var t=(e.f&2)!=0;if($n?.add(e),rr!==null&&!ir&&!(or!==null&&or.f&16384)&&(cr===null||!s.call(cr,e))){var n=rr.deps;if(rr.f&2097152)e.rv<hr&&(e.rv=hr,ur===null&&n!==null&&n[dr]===e?dr++:ur===null?ur=[e]:ur.push(e));else{(rr.deps??=[]).push(e);var r=e.reactions;r===null?e.reactions=[rr]:s.call(r,rr)||r.push(rr)}}if(tr&&Qt.has(e))return Qt.get(e);if(t){var i=e;if(tr){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||Dr(i))&&(a=qt(i)),Qt.set(i,a),a}var o=(i.f&512)==0&&!ir&&rr!==null&&(er||(rr.f&512)!=0),c=(i.f&C)===0;yr(i)&&(o&&(i.f|=512),Jt(i)),o&&!c&&(Xt(i),Er(i))}if(gt?.has(e))return gt.get(e);if(e.f&8388608)throw e.v;return e.v}function Er(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Xt(t),Er(t))}function Dr(e){if(e.v===Oe)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Qt.has(t)||t.f&2&&Dr(t))return!0;return!1}function Or(e){var t=ir;try{return ir=!0,e()}finally{ir=t}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var kr=[`touchstart`,`touchmove`];function Ar(e){return kr.includes(e)}var jr=Symbol(`events`),Mr=new Set,Nr=new Set;function Pr(e,t,n,r={}){function i(e){if(r.capture||zr.call(t,e),!e.cancelBubble)return En(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?tt(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function Fr(e,t,n,r,i){var a={capture:r,passive:i},o=Pr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Mn(()=>{t.removeEventListener(e,o,a)})}function Ir(e,t,n){(t[jr]??={})[e]=n}function Lr(e){for(var t=0;t<e.length;t++)Mr.add(e[t]);for(var n of Nr)n(e)}var Rr=null;function zr(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;Rr=e;var o=0,s=Rr===e&&e[jr];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[jr]=t;return}var u=i.indexOf(t);if(u===-1)return;c<=u&&(o=c)}if(a=i[o]||e.target,a!==t){l(e,`currentTarget`,{configurable:!0,get(){return a||n}});var d=rr,f=or;ar(null),sr(null);try{for(var p,m=[];a!==null;){var h=a.assignedSlot||a.parentNode||a.host||null;try{var g=a[jr]?.[r];g!=null&&(!a.disabled||e.target===a)&&g.call(a,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble||h===t||h===null)break;a=h}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[jr]=t,delete e.currentTarget,ar(d),sr(f)}}}var Br=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Vr(e){return Br?.createHTML(e)??e}function Hr(e){var t=Sn(`template`);return t.innerHTML=Vr(e.replaceAll(`<!>`,`<!---->`)),t.content}function Ur(e,t){var n=or;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function A(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(w)return Ur(Le,null),Le;i===void 0&&(i=Hr(a?e:`<!>`+e),n||(i=_n(i)));var t=r||fn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=_n(t),s=t.lastChild;Ur(o,s)}else Ur(t,t);return t}}function Wr(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(w)return Ur(Le,null),Le;if(!o){var e=_n(Hr(a));if(i)for(o=document.createDocumentFragment();_n(e);)o.appendChild(_n(e));else o=_n(e)}var t=o.cloneNode(!0);if(i){var n=_n(t),r=t.lastChild;Ur(n,r)}else Ur(t,t);return t}}function Gr(e,t){return Wr(e,t,`svg`)}function Kr(){if(w)return Ur(Le,null),Le;var e=document.createDocumentFragment(),t=document.createComment(``),n=gn();return e.append(t,n),Ur(t,n),e}function j(e,t){if(w){var n=or;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=Le),ze();return}e!==null&&e.before(t)}function qr(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function Jr(e,t){return Xr(e,t)}var Yr=new Map;function Xr(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){hn();var l=void 0,u=Fn(()=>{var o=n??t.appendChild(gn());It(o,{pending:()=>{}},t=>{Xe({});var n=Je;if(a&&(n.c=a),i&&(r.$$events=i),w&&Ur(t,null),l=e(t,r)||{},w&&(or.nodes.end=Le,Le===null||Le.nodeType!==8||Le.data!==`]`))throw Ne(),De;Ze()},s);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=Ar(r);for(let e of[t,document]){var a=Yr.get(e);a===void 0&&(a=new Map,Yr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,zr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(c(Mr)),Nr.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=Yr.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,zr),r.delete(e),r.size===0&&Yr.delete(n)):r.set(e,i)}Nr.delete(d),o!==n&&o.parentNode?.removeChild(o)}});return Zr.set(l,u),l}var Zr=new WeakMap;function Qr(e,t){let n=Zr.get(e);return n?(Zr.delete(e),n(t)):Promise.resolve()}var $r=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Xn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(Gn(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Qn(r,t),t.append(gn()),this.#n.set(e,{effect:r,fragment:t})}else Gn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Jn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(Gn(n.effect),this.#n.delete(e))};ensure(e,t){var n=mt,r=xn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=gn();i.append(a),this.#n.set(e,{effect:Vn(()=>t(a)),fragment:i})}else this.#t.set(e,Vn(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else w&&(this.anchor=Le),this.#a(n)}};function ei(e,t,n=!1){var r;w&&(r=Le,ze());var i=new $r(e),a=n?ne:0;function o(e,t){if(w){var n=He(r);if(e!==parseInt(n.substring(1))){var a=Ve();Re(a),i.anchor=a,Ie(!1),i.ensure(e,t),Ie(!0);return}}i.ensure(e,t)}Bn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function ti(e,t){return t}function ni(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];Jn(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;ri(e,c(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else --o},!1)}if(o===0){var l=r.length===0&&n!==null;if(l){var u=n,d=u.parentNode;bn(d),d.append(u),e.items.clear()}ri(e,t,!l)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function ri(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=ae,Qn(a,document.createDocumentFragment())):Gn(t[i],n)}}var ii;function ai(e,t,n,r,i,o=null){var s=e,l=new Map;if(t&4){var u=e;s=w?Re(_n(u)):u.appendChild(gn())}w&&ze();var d=null,f=Gt(()=>{var e=n();return a(e)?e:e==null?[]:c(e)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,si(v,p,s,t,r),d!==null&&(p.length===0?d.f&33554432?(d.f^=ae,li(d,null,s)):Xn(d):Jn(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:Bn(()=>{p=k(f);var e=p.length;let a=!1;w&&He(s)===`[!`!=(e===0)&&(s=Ve(),Re(s),Ie(!1),a=!0);for(var c=new Set,u=mt,v=xn(),y=0;y<e;y+=1){w&&Le.nodeType===8&&Le.data===`]`&&(s=Le,a=!0,Ie(!1));var b=p[y],x=r(b,y),S=h?null:l.get(x);S?(S.v&&rn(S.v,b),S.i&&rn(S.i,y),v&&u.unskip_effect(S.e)):(S=ci(l,h?s:ii??=gn(),b,x,y,i,t,n),h||(S.e.f|=ae),l.set(x,S)),c.add(x)}if(e===0&&o&&!d&&(h?d=Vn(()=>o(s)):(d=Vn(()=>o(ii??=gn())),d.f|=ae)),e>c.size&&_e(``,``,``),w&&e>0&&Re(Ve()),!h)if(m.set(u,c),v){for(let[e,t]of l)c.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);a&&Ie(!0),k(f)}),flags:t,items:l,pending:m,outrogroups:null,fallback:d};h=!1,w&&(s=Le)}function oi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function si(e,t,n,r,i){var a=(r&8)!=0,o=t.length,s=e.items,l=oi(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(a)for(v=0;v<o;v+=1)h=t[v],g=i(h,v),_=s.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<o;v+=1){if(h=t[v],g=i(h,v),_=s.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(Xn(_),a&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432)if(_.f^=ae,_===l)li(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),ui(e,d,_),ui(e,_,y),li(_,y,n),d=_,p=[],m=[],l=oi(d.next);continue}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],x;d=b.prev;var S=p[0],ee=p[p.length-1];for(x=0;x<p.length;x+=1)li(p[x],b,n);for(x=0;x<m.length;x+=1)u.delete(m[x]);ui(e,S.prev,ee.next),ui(e,d,S),ui(e,ee,b),l=b,d=ee,--v,p=[],m=[]}else u.delete(_),li(_,l,n),ui(e,_.prev,_.next),ui(e,_,d===null?e.effect.first:d.next),ui(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=oi(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=oi(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(ri(e,c(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var C=[];if(u!==void 0)for(_ of u)_.f&8192||C.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&C.push(l),l=oi(l.next);var te=C.length;if(te>0){var ne=r&4&&o===0?n:null;if(a){for(v=0;v<te;v+=1)C[v].nodes?.a?.measure();for(v=0;v<te;v+=1)C[v].nodes?.a?.fix()}ni(e,C,ne)}}a&&tt(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function ci(e,t,n,r,i,a,o,s){var c=o&1?o&16?en(n):nn(n,!1,!1):null,l=o&2?en(i):null;return{v:c,i:l,e:Vn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function li(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=vn(r);if(a.before(r),r===i)return;r=o}}function ui(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function di(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;w&&(o=Re(_n(c)))}zn(()=>{var e=or;if(s===(s=t()??``)){w&&ze();return}if(n&&!w){e.nodes=null,c.innerHTML=s,s!==``&&Ur(_n(c),c.lastChild);return}if(e.nodes!==null&&(Kn(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(w){for(var a=Le.data,l=ze(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=vn(l);if(l===null)throw Ne(),De;Ur(Le,u),o=Re(l);return}var d=Sn(r?`svg`:i?`math`:`template`,r?Ae:i?je:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(Ur(_n(f),f.lastChild),r||i)for(;_n(f);)o.before(_n(f));else o.before(f)}})}function fi(e,t,...n){var r=new $r(e);Bn(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},ne)}var pi=[...` +\r\f\xA0\v`];function mi(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||pi.includes(r[o-1]))&&(s===r.length||pi.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function hi(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function gi(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function _i(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(gi)),i&&c.push(...Object.keys(i).map(gi));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=gi(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=hi(r)),i&&(n+=hi(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function vi(e,t,n,r,i,a){var o=e.__className;if(w||o!==n||o===void 0){var s=mi(n,r,a);(!w||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function yi(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function bi(e,t,n,r){var i=e.__style;if(w||i!==t){var a=_i(t,r);(!w||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e.__style=t}else r&&(Array.isArray(r)?(yi(e,n?.[0],r[0]),yi(e,n?.[1],r[1],`important`)):yi(e,n,r));return r}function xi(e,t,n=!1){if(e.multiple){if(t==null)return;if(!a(t))return Pe();for(var r of e.options)r.selected=t.includes(Ci(r));return}for(r of e.options)if(un(Ci(r),t)){r.selected=!0;return}(!n||t!==void 0)&&(e.selectedIndex=-1)}function Si(e){var t=new MutationObserver(()=>{xi(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),Mn(()=>{t.disconnect()})}function Ci(e){return`__value`in e?e.__value:e.value}var wi=Symbol(`is custom element`),Ti=Symbol(`is html`),Ei=me?`link`:`LINK`;function Di(e){if(w){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Oi(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Oi(e,`checked`,null),e.checked=r}}};e.__on_r=n,tt(n),Tn()}}function Oi(e,t,n,r){var i=ki(e);w&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Ei)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[fe]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ji(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ki(e){return e.__attributes??={[wi]:e.nodeName.includes(`-`),[Ti]:e.namespaceURI===ke}}var Ai=new Map;function ji(e){var t=e.getAttribute(`is`)||e.nodeName,n=Ai.get(t);if(n)return n;Ai.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=d(i),r)r[o].set&&n.push(o);i=m(i)}return n}function Mi(e,t,n=t){var r=new WeakSet;Dn(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Ni(e)?Pi(a):a,n(a),mt!==null&&r.add(mt),await Tr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(w&&e.defaultValue!==e.value||Or(t)==null&&e.value)&&(n(Ni(e)?Pi(e.value):e.value),mt!==null&&r.add(mt)),Rn(()=>{var n=t();if(e===document.activeElement){var i=Ke?ht:mt;if(r.has(i))return}Ni(e)&&n===Pi(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function Ni(e){var t=e.type;return t===`number`||t===`range`}function Pi(e){return e===``?null:+e}function Fi(e,t){return e===t||e?.[ue]===t}function Ii(e={},t,n,r){var i=Je.r,a=or;return In(()=>{var o,s;return Rn(()=>{o=s,s=r?.()||[],Or(()=>{e!==n(...s)&&(t(e,...s),o&&Fi(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&Fi(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function Li(e,t,n,r){var i=!qe||(n&2)!=0,a=(n&8)!=0,o=(n&16)!=0,s=r,c=!0,l=()=>(c&&(c=!1,s=o?Or(r):r),s);let d;if(a){var f=ue in e||de in e;d=u(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=ft(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=l(),d&&(i&&Se(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?l():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?Ht:Gt)(()=>(_=!1,h()));a&&k(v);var y=or;return(function(e,t){if(arguments.length>0){let n=t?k(v):i&&a?cn(e):e;return E(v,n),_=!0,s!==void 0&&(s=n),e}return tr&&_||y.f&16384?v.v:k(v)})}function Ri(e){Je===null&&he(`onMount`),qe&&Je.l!==null?zi(Je).m.push(e):Nn(()=>{let t=Or(e);if(typeof t==`function`)return t})}function zi(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var Bi,Vi,Hi=n((()=>{Bi=`16.13.2`,Vi=Object.freeze({major:16,minor:13,patch:2,preReleaseTag:null})}));function Ui(e,t){if(!e)throw Error(t)}var Wi=n((()=>{}));function Gi(e){return typeof e?.then==`function`}var Ki=n((()=>{}));function qi(e){return typeof e==`object`&&!!e}var Ji=n((()=>{}));function Yi(e,t){if(!e)throw Error(t??`Unexpected invariant triggered.`)}var Xi=n((()=>{}));function Zi(e,t){let n=0,r=1;for(let i of e.body.matchAll(Qi)){if(typeof i.index==`number`||Yi(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}var Qi,$i=n((()=>{Xi(),Qi=/\r\n|[\n\r]/g}));function ea(e){return ta(e.source,Zi(e.source,e.start))}function ta(e,t){let n=e.locationOffset.column-1,r=``.padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=t.line===1?n:0,c=t.column+s,l=`${e.name}:${o}:${c}\n`,u=r.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){let e=Math.floor(c/80),t=c%80,n=[];for(let e=0;e<d.length;e+=80)n.push(d.slice(e,e+80));return l+na([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>[`|`,e]),[`|`,`^`.padStart(t)],[`|`,n[e+1]]])}return l+na([[`${o-1} |`,u[i-1]],[`${o} |`,d],[`|`,`^`.padStart(c)],[`${o+1} |`,u[i+1]]])}function na(e){let t=e.filter(([e,t])=>t!==void 0),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?` `+t:``)).join(` +`)}var ra=n((()=>{$i()}));function ia(e){let t=e[0];return t==null||`kind`in t||`length`in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}function aa(e){return e===void 0||e.length===0?void 0:e}function oa(e){return e.toString()}function sa(e){return e.toJSON()}var M,N=n((()=>{Ji(),$i(),ra(),M=class e extends Error{constructor(t,...n){let{nodes:r,source:i,positions:a,path:o,originalError:s,extensions:c}=ia(n);super(t),this.name=`GraphQLError`,this.path=o??void 0,this.originalError=s??void 0,this.nodes=aa(Array.isArray(r)?r:r?[r]:void 0);let l=aa(this.nodes?.map(e=>e.loc).filter(e=>e!=null));this.source=i??l?.[0]?.source,this.positions=a??l?.map(e=>e.start),this.locations=a&&i?a.map(e=>Zi(i,e)):l?.map(e=>Zi(e.source,e.start));let u=qi(s?.extensions)?s?.extensions:void 0;this.extensions=c??u??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),s!=null&&s.stack?Object.defineProperty(this,`stack`,{value:s.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,`stack`,{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return`GraphQLError`}toString(){let e=this.message;if(this.nodes)for(let t of this.nodes)t.loc&&(e+=` + +`+ea(t.loc));else if(this.source&&this.locations)for(let t of this.locations)e+=` + +`+ta(this.source,t);return e}toJSON(){let e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}}));function ca(e,t,n){return new M(`Syntax Error: ${n}`,{source:e,positions:[t]})}var la=n((()=>{N()}));function ua(e){let t=e?.kind;return typeof t==`string`&&ma.has(t)}var da,fa,pa,ma,ha,ga=n((()=>{da=class{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return`Location`}toJSON(){return{start:this.start,end:this.end}}},fa=class{constructor(e,t,n,r,i,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return`Token`}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},pa={Name:[],Document:[`definitions`],OperationDefinition:[`description`,`name`,`variableDefinitions`,`directives`,`selectionSet`],VariableDefinition:[`description`,`variable`,`type`,`defaultValue`,`directives`],Variable:[`name`],SelectionSet:[`selections`],Field:[`alias`,`name`,`arguments`,`directives`,`selectionSet`],Argument:[`name`,`value`],FragmentSpread:[`name`,`directives`],InlineFragment:[`typeCondition`,`directives`,`selectionSet`],FragmentDefinition:[`description`,`name`,`variableDefinitions`,`typeCondition`,`directives`,`selectionSet`],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:[`values`],ObjectValue:[`fields`],ObjectField:[`name`,`value`],Directive:[`name`,`arguments`],NamedType:[`name`],ListType:[`type`],NonNullType:[`type`],SchemaDefinition:[`description`,`directives`,`operationTypes`],OperationTypeDefinition:[`type`],ScalarTypeDefinition:[`description`,`name`,`directives`],ObjectTypeDefinition:[`description`,`name`,`interfaces`,`directives`,`fields`],FieldDefinition:[`description`,`name`,`arguments`,`type`,`directives`],InputValueDefinition:[`description`,`name`,`type`,`defaultValue`,`directives`],InterfaceTypeDefinition:[`description`,`name`,`interfaces`,`directives`,`fields`],UnionTypeDefinition:[`description`,`name`,`directives`,`types`],EnumTypeDefinition:[`description`,`name`,`directives`,`values`],EnumValueDefinition:[`description`,`name`,`directives`],InputObjectTypeDefinition:[`description`,`name`,`directives`,`fields`],DirectiveDefinition:[`description`,`name`,`arguments`,`locations`],SchemaExtension:[`directives`,`operationTypes`],ScalarTypeExtension:[`name`,`directives`],ObjectTypeExtension:[`name`,`interfaces`,`directives`,`fields`],InterfaceTypeExtension:[`name`,`interfaces`,`directives`,`fields`],UnionTypeExtension:[`name`,`directives`,`types`],EnumTypeExtension:[`name`,`directives`,`values`],InputObjectTypeExtension:[`name`,`directives`,`fields`],TypeCoordinate:[`name`],MemberCoordinate:[`name`,`memberName`],ArgumentCoordinate:[`name`,`fieldName`,`argumentName`],DirectiveCoordinate:[`name`],DirectiveArgumentCoordinate:[`name`,`argumentName`]},ma=new Set(Object.keys(pa)),(function(e){e.QUERY=`query`,e.MUTATION=`mutation`,e.SUBSCRIPTION=`subscription`})(ha||={})})),P,_a=n((()=>{(function(e){e.QUERY=`QUERY`,e.MUTATION=`MUTATION`,e.SUBSCRIPTION=`SUBSCRIPTION`,e.FIELD=`FIELD`,e.FRAGMENT_DEFINITION=`FRAGMENT_DEFINITION`,e.FRAGMENT_SPREAD=`FRAGMENT_SPREAD`,e.INLINE_FRAGMENT=`INLINE_FRAGMENT`,e.VARIABLE_DEFINITION=`VARIABLE_DEFINITION`,e.SCHEMA=`SCHEMA`,e.SCALAR=`SCALAR`,e.OBJECT=`OBJECT`,e.FIELD_DEFINITION=`FIELD_DEFINITION`,e.ARGUMENT_DEFINITION=`ARGUMENT_DEFINITION`,e.INTERFACE=`INTERFACE`,e.UNION=`UNION`,e.ENUM=`ENUM`,e.ENUM_VALUE=`ENUM_VALUE`,e.INPUT_OBJECT=`INPUT_OBJECT`,e.INPUT_FIELD_DEFINITION=`INPUT_FIELD_DEFINITION`})(P||={})})),F,va=n((()=>{(function(e){e.NAME=`Name`,e.DOCUMENT=`Document`,e.OPERATION_DEFINITION=`OperationDefinition`,e.VARIABLE_DEFINITION=`VariableDefinition`,e.SELECTION_SET=`SelectionSet`,e.FIELD=`Field`,e.ARGUMENT=`Argument`,e.FRAGMENT_SPREAD=`FragmentSpread`,e.INLINE_FRAGMENT=`InlineFragment`,e.FRAGMENT_DEFINITION=`FragmentDefinition`,e.VARIABLE=`Variable`,e.INT=`IntValue`,e.FLOAT=`FloatValue`,e.STRING=`StringValue`,e.BOOLEAN=`BooleanValue`,e.NULL=`NullValue`,e.ENUM=`EnumValue`,e.LIST=`ListValue`,e.OBJECT=`ObjectValue`,e.OBJECT_FIELD=`ObjectField`,e.DIRECTIVE=`Directive`,e.NAMED_TYPE=`NamedType`,e.LIST_TYPE=`ListType`,e.NON_NULL_TYPE=`NonNullType`,e.SCHEMA_DEFINITION=`SchemaDefinition`,e.OPERATION_TYPE_DEFINITION=`OperationTypeDefinition`,e.SCALAR_TYPE_DEFINITION=`ScalarTypeDefinition`,e.OBJECT_TYPE_DEFINITION=`ObjectTypeDefinition`,e.FIELD_DEFINITION=`FieldDefinition`,e.INPUT_VALUE_DEFINITION=`InputValueDefinition`,e.INTERFACE_TYPE_DEFINITION=`InterfaceTypeDefinition`,e.UNION_TYPE_DEFINITION=`UnionTypeDefinition`,e.ENUM_TYPE_DEFINITION=`EnumTypeDefinition`,e.ENUM_VALUE_DEFINITION=`EnumValueDefinition`,e.INPUT_OBJECT_TYPE_DEFINITION=`InputObjectTypeDefinition`,e.DIRECTIVE_DEFINITION=`DirectiveDefinition`,e.SCHEMA_EXTENSION=`SchemaExtension`,e.SCALAR_TYPE_EXTENSION=`ScalarTypeExtension`,e.OBJECT_TYPE_EXTENSION=`ObjectTypeExtension`,e.INTERFACE_TYPE_EXTENSION=`InterfaceTypeExtension`,e.UNION_TYPE_EXTENSION=`UnionTypeExtension`,e.ENUM_TYPE_EXTENSION=`EnumTypeExtension`,e.INPUT_OBJECT_TYPE_EXTENSION=`InputObjectTypeExtension`,e.TYPE_COORDINATE=`TypeCoordinate`,e.MEMBER_COORDINATE=`MemberCoordinate`,e.ARGUMENT_COORDINATE=`ArgumentCoordinate`,e.DIRECTIVE_COORDINATE=`DirectiveCoordinate`,e.DIRECTIVE_ARGUMENT_COORDINATE=`DirectiveArgumentCoordinate`})(F||={})}));function ya(e){return e===9||e===32}function ba(e){return e>=48&&e<=57}function xa(e){return e>=97&&e<=122||e>=65&&e<=90}function Sa(e){return xa(e)||e===95}function Ca(e){return xa(e)||ba(e)||e===95}var wa=n((()=>{}));function Ta(e){let t=2**53-1,n=null,r=-1;for(let i=0;i<e.length;++i){let a=e[i],o=Ea(a);o!==a.length&&(n??=i,r=i,i!==0&&o<t&&(t=o))}return e.map((e,n)=>n===0?e:e.slice(t)).slice(n??0,r+1)}function Ea(e){let t=0;for(;t<e.length&&ya(e.charCodeAt(t));)++t;return t}function Da(e){if(e===``)return!0;let t=!0,n=!1,r=!0,i=!1;for(let a=0;a<e.length;++a)switch(e.codePointAt(a)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(t&&!i)return!1;i=!0,t=!0,n=!1;break;case 9:case 32:n||=t;break;default:r&&=n,t=!1}return!(t||r&&i)}function Oa(e,t){let n=e.replace(/"""/g,`\\"""`),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,a=r.length>1&&r.slice(1).every(e=>e.length===0||ya(e.charCodeAt(0))),o=n.endsWith(`\\"""`),s=e.endsWith(`"`)&&!o,c=e.endsWith(`\\`),l=s||c,u=!(t!=null&&t.minimize)&&(!i||e.length>70||l||a||o),d=``,f=i&&ya(e.charCodeAt(0));return(u&&!f||a)&&(d+=` +`),d+=n,(u||l)&&(d+=` +`),`"""`+d+`"""`}var ka=n((()=>{wa()})),I,Aa=n((()=>{(function(e){e.SOF=`<SOF>`,e.EOF=`<EOF>`,e.BANG=`!`,e.DOLLAR=`$`,e.AMP=`&`,e.PAREN_L=`(`,e.PAREN_R=`)`,e.DOT=`.`,e.SPREAD=`...`,e.COLON=`:`,e.EQUALS=`=`,e.AT=`@`,e.BRACKET_L=`[`,e.BRACKET_R=`]`,e.BRACE_L=`{`,e.PIPE=`|`,e.BRACE_R=`}`,e.NAME=`Name`,e.INT=`Int`,e.FLOAT=`Float`,e.STRING=`String`,e.BLOCK_STRING=`BlockString`,e.COMMENT=`Comment`})(I||={})}));function ja(e){return e===I.BANG||e===I.DOLLAR||e===I.AMP||e===I.PAREN_L||e===I.PAREN_R||e===I.DOT||e===I.SPREAD||e===I.COLON||e===I.EQUALS||e===I.AT||e===I.BRACKET_L||e===I.BRACKET_R||e===I.BRACE_L||e===I.PIPE||e===I.BRACE_R}function Ma(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Na(e,t){return Pa(e.charCodeAt(t))&&Fa(e.charCodeAt(t+1))}function Pa(e){return e>=55296&&e<=56319}function Fa(e){return e>=56320&&e<=57343}function Ia(e,t){let n=e.source.body.codePointAt(t);if(n===void 0)return I.EOF;if(n>=32&&n<=126){let e=String.fromCodePoint(n);return e===`"`?`'"'`:`"${e}"`}return`U+`+n.toString(16).toUpperCase().padStart(4,`0`)}function La(e,t,n,r,i){let a=e.line;return new fa(t,n,r,a,1+n-e.lineStart,i)}function Ra(e,t){let n=e.source.body,r=n.length,i=t;for(;i<r;){let t=n.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return za(e,i);case 33:return La(e,I.BANG,i,i+1);case 36:return La(e,I.DOLLAR,i,i+1);case 38:return La(e,I.AMP,i,i+1);case 40:return La(e,I.PAREN_L,i,i+1);case 41:return La(e,I.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return La(e,I.SPREAD,i,i+3);break;case 58:return La(e,I.COLON,i,i+1);case 61:return La(e,I.EQUALS,i,i+1);case 64:return La(e,I.AT,i,i+1);case 91:return La(e,I.BRACKET_L,i,i+1);case 93:return La(e,I.BRACKET_R,i,i+1);case 123:return La(e,I.BRACE_L,i,i+1);case 124:return La(e,I.PIPE,i,i+1);case 125:return La(e,I.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?Ja(e,i):Ha(e,i)}if(ba(t)||t===45)return Ba(e,i,t);if(Sa(t))return Ya(e,i);throw ca(e.source,i,t===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Ma(t)||Na(n,i)?`Unexpected character: ${Ia(e,i)}.`:`Invalid character: ${Ia(e,i)}.`)}return La(e,I.EOF,r,r)}function za(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r;){let e=n.charCodeAt(i);if(e===10||e===13)break;if(Ma(e))++i;else if(Na(n,i))i+=2;else break}return La(e,I.COMMENT,t,i,n.slice(t+1,i))}function Ba(e,t,n){let r=e.source.body,i=t,a=n,o=!1;if(a===45&&(a=r.charCodeAt(++i)),a===48){if(a=r.charCodeAt(++i),ba(a))throw ca(e.source,i,`Invalid number, unexpected digit after 0: ${Ia(e,i)}.`)}else i=Va(e,i,a),a=r.charCodeAt(i);if(a===46&&(o=!0,a=r.charCodeAt(++i),i=Va(e,i,a),a=r.charCodeAt(i)),(a===69||a===101)&&(o=!0,a=r.charCodeAt(++i),(a===43||a===45)&&(a=r.charCodeAt(++i)),i=Va(e,i,a),a=r.charCodeAt(i)),a===46||Sa(a))throw ca(e.source,i,`Invalid number, expected digit but got: ${Ia(e,i)}.`);return La(e,o?I.FLOAT:I.INT,t,i,r.slice(t,i))}function Va(e,t,n){if(!ba(n))throw ca(e.source,t,`Invalid number, expected digit but got: ${Ia(e,t)}.`);let r=e.source.body,i=t+1;for(;ba(r.charCodeAt(i));)++i;return i}function Ha(e,t){let n=e.source.body,r=n.length,i=t+1,a=i,o=``;for(;i<r;){let r=n.charCodeAt(i);if(r===34)return o+=n.slice(a,i),La(e,I.STRING,t,i+1,o);if(r===92){o+=n.slice(a,i);let t=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?Ua(e,i):Wa(e,i):qa(e,i);o+=t.value,i+=t.size,a=i;continue}if(r===10||r===13)break;if(Ma(r))++i;else if(Na(n,i))i+=2;else throw ca(e.source,i,`Invalid character within String: ${Ia(e,i)}.`)}throw ca(e.source,i,`Unterminated string.`)}function Ua(e,t){let n=e.source.body,r=0,i=3;for(;i<12;){let e=n.charCodeAt(t+ i++);if(e===125){if(i<5||!Ma(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Ka(e),r<0)break}throw ca(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function Wa(e,t){let n=e.source.body,r=Ga(n,t+2);if(Ma(r))return{value:String.fromCodePoint(r),size:6};if(Pa(r)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){let e=Ga(n,t+8);if(Fa(e))return{value:String.fromCodePoint(r,e),size:12}}throw ca(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function Ga(e,t){return Ka(e.charCodeAt(t))<<12|Ka(e.charCodeAt(t+1))<<8|Ka(e.charCodeAt(t+2))<<4|Ka(e.charCodeAt(t+3))}function Ka(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function qa(e,t){let n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:`"`,size:2};case 92:return{value:`\\`,size:2};case 47:return{value:`/`,size:2};case 98:return{value:`\b`,size:2};case 102:return{value:`\f`,size:2};case 110:return{value:` +`,size:2};case 114:return{value:`\r`,size:2};case 116:return{value:` `,size:2}}throw ca(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Ja(e,t){let n=e.source.body,r=n.length,i=e.lineStart,a=t+3,o=a,s=``,c=[];for(;a<r;){let r=n.charCodeAt(a);if(r===34&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34){s+=n.slice(o,a),c.push(s);let r=La(e,I.BLOCK_STRING,t,a+3,Ta(c).join(` +`));return e.line+=c.length-1,e.lineStart=i,r}if(r===92&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34&&n.charCodeAt(a+3)===34){s+=n.slice(o,a),o=a+1,a+=4;continue}if(r===10||r===13){s+=n.slice(o,a),c.push(s),r===13&&n.charCodeAt(a+1)===10?a+=2:++a,s=``,o=a,i=a;continue}if(Ma(r))++a;else if(Na(n,a))a+=2;else throw ca(e.source,a,`Invalid character within String: ${Ia(e,a)}.`)}throw ca(e.source,a,`Unterminated string.`)}function Ya(e,t){let n=e.source.body,r=n.length,i=t+1;for(;i<r&&Ca(n.charCodeAt(i));)++i;return La(e,I.NAME,t,i,n.slice(t,i))}var Xa,Za=n((()=>{la(),ga(),ka(),wa(),Aa(),Xa=class{constructor(e){let t=new fa(I.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return`Lexer`}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==I.EOF)do if(e.next)e=e.next;else{let t=Ra(this,e.end);e.next=t,t.prev=e,e=t}while(e.kind===I.COMMENT);return e}}}));function Qa(e,t){let n=e.source.body,r=n.length,i=t;if(i<r){let t=n.charCodeAt(i);switch(t){case 46:return La(e,I.DOT,i,i+1);case 40:return La(e,I.PAREN_L,i,i+1);case 41:return La(e,I.PAREN_R,i,i+1);case 58:return La(e,I.COLON,i,i+1);case 64:return La(e,I.AT,i,i+1)}if(Sa(t))return Ya(e,i);throw ca(e.source,i,`Invalid character: ${Ia(e,i)}.`)}return La(e,I.EOF,r,r)}var $a,eo=n((()=>{la(),ga(),wa(),Za(),Aa(),$a=class{line=1;lineStart=0;constructor(e){let t=new fa(I.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t}get[Symbol.toStringTag](){return`SchemaCoordinateLexer`}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==I.EOF){let t=Qa(this,e.end);e.next=t,t.prev=e,e=t}return e}}}));function L(e){return to(e,[])}function to(e,t){switch(typeof e){case`string`:return JSON.stringify(e);case`function`:return e.name?`[function ${e.name}]`:`[function]`;case`object`:return no(e,t);default:return String(e)}}function no(e,t){if(e===null)return`null`;if(t.includes(e))return`[Circular]`;let n=[...t,e];if(ro(e)){let t=e.toJSON();if(t!==e)return typeof t==`string`?t:to(t,n)}else if(Array.isArray(e))return ao(e,n);return io(e,n)}function ro(e){return typeof e.toJSON==`function`}function io(e,t){let n=Object.entries(e);return n.length===0?`{}`:t.length>co?`[`+oo(e)+`]`:`{ `+n.map(([e,n])=>e+`: `+to(n,t)).join(`, `)+` }`}function ao(e,t){if(e.length===0)return`[]`;if(t.length>co)return`[Array]`;let n=Math.min(so,e.length),r=e.length-n,i=[];for(let r=0;r<n;++r)i.push(to(e[r],t));return r===1?i.push(`... 1 more item`):r>1&&i.push(`... ${r} more items`),`[`+i.join(`, `)+`]`}function oo(e){let t=Object.prototype.toString.call(e).replace(/^\[object /,``).replace(/]$/,``);if(t===`Object`&&typeof e.constructor==`function`){let t=e.constructor.name;if(typeof t==`string`&&t!==``)return t}return t}var so,co,lo=n((()=>{so=10,co=2})),uo,fo,po=n((()=>{lo(),uo=globalThis.process&&process.env.NODE_ENV===`production`,fo=uo?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if(typeof e==`object`&&e){let n=t.prototype[Symbol.toStringTag];if(n===(Symbol.toStringTag in e?e[Symbol.toStringTag]:e.constructor?.name)){let t=L(e);throw Error(`Cannot use ${n} "${t}" from another module or realm. + +Ensure that there is only one instance of "graphql" in the node_modules +directory. If different versions of "graphql" are the dependencies of other +relied on modules, use "resolutions" to ensure only one version is installed. + +https://yarnpkg.com/en/docs/selective-version-resolutions + +Duplicate "graphql" modules cannot be used at the same time since different +versions may have different capabilities and behavior. The data from one +version used in the function from another could produce confusing and +spurious results.`)}}return!1}}));function mo(e){return fo(e,ho)}var ho,go=n((()=>{Wi(),lo(),po(),ho=class{constructor(e,t=`GraphQL request`,n={line:1,column:1}){typeof e==`string`||Ui(!1,`Body must be a string. Received: ${L(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Ui(!1,`line in locationOffset is 1-indexed and must be positive.`),this.locationOffset.column>0||Ui(!1,`column in locationOffset is 1-indexed and must be positive.`)}get[Symbol.toStringTag](){return`Source`}}}));function _o(e,t){let n=new wo(e,t),r=n.parseDocument();return Object.defineProperty(r,`tokenCount`,{enumerable:!1,value:n.tokenCount}),r}function vo(e,t){let n=new wo(e,t);n.expectToken(I.SOF);let r=n.parseValueLiteral(!1);return n.expectToken(I.EOF),r}function yo(e,t){let n=new wo(e,t);n.expectToken(I.SOF);let r=n.parseConstValueLiteral();return n.expectToken(I.EOF),r}function bo(e,t){let n=new wo(e,t);n.expectToken(I.SOF);let r=n.parseTypeReference();return n.expectToken(I.EOF),r}function xo(e){let t=new wo(e,{lexer:new $a(mo(e)?e:new ho(e))});t.expectToken(I.SOF);let n=t.parseSchemaCoordinate();return t.expectToken(I.EOF),n}function So(e){let t=e.value;return Co(e.kind)+(t==null?``:` "${t}"`)}function Co(e){return ja(e)?`"${e}"`:e}var wo,To=n((()=>{la(),ga(),_a(),va(),Za(),eo(),go(),Aa(),wo=class{constructor(e,t={}){let{lexer:n,...r}=t;if(n)this._lexer=n;else{let t=mo(e)?e:new ho(e);this._lexer=new Xa(t)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){let e=this.expectToken(I.NAME);return this.node(e,{kind:F.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:F.DOCUMENT,definitions:this.many(I.SOF,this.parseDefinition,I.EOF)})}parseDefinition(){if(this.peek(I.BRACE_L))return this.parseOperationDefinition();let e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===I.BRACE_L)throw ca(this._lexer.source,this._lexer.token.start,`Unexpected description, descriptions are not supported on shorthand queries.`);if(t.kind===I.NAME){switch(t.value){case`schema`:return this.parseSchemaDefinition();case`scalar`:return this.parseScalarTypeDefinition();case`type`:return this.parseObjectTypeDefinition();case`interface`:return this.parseInterfaceTypeDefinition();case`union`:return this.parseUnionTypeDefinition();case`enum`:return this.parseEnumTypeDefinition();case`input`:return this.parseInputObjectTypeDefinition();case`directive`:return this.parseDirectiveDefinition()}switch(t.value){case`query`:case`mutation`:case`subscription`:return this.parseOperationDefinition();case`fragment`:return this.parseFragmentDefinition()}if(e)throw ca(this._lexer.source,this._lexer.token.start,`Unexpected description, only GraphQL definitions support descriptions.`);switch(t.value){case`extend`:return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){let e=this._lexer.token;if(this.peek(I.BRACE_L))return this.node(e,{kind:F.OPERATION_DEFINITION,operation:ha.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});let t=this.parseDescription(),n=this.parseOperationType(),r;return this.peek(I.NAME)&&(r=this.parseName()),this.node(e,{kind:F.OPERATION_DEFINITION,operation:n,description:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){let e=this.expectToken(I.NAME);switch(e.value){case`query`:return ha.QUERY;case`mutation`:return ha.MUTATION;case`subscription`:return ha.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(I.PAREN_L,this.parseVariableDefinition,I.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:F.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(I.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(I.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){let e=this._lexer.token;return this.expectToken(I.DOLLAR),this.node(e,{kind:F.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:F.SELECTION_SET,selections:this.many(I.BRACE_L,this.parseSelection,I.BRACE_R)})}parseSelection(){return this.peek(I.SPREAD)?this.parseFragment():this.parseField()}parseField(){let e=this._lexer.token,t=this.parseName(),n,r;return this.expectOptionalToken(I.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:F.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(I.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){let t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(I.PAREN_L,t,I.PAREN_R)}parseArgument(e=!1){let t=this._lexer.token,n=this.parseName();return this.expectToken(I.COLON),this.node(t,{kind:F.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){let e=this._lexer.token;this.expectToken(I.SPREAD);let t=this.expectOptionalKeyword(`on`);return!t&&this.peek(I.NAME)?this.node(e,{kind:F.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:F.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){let e=this._lexer.token,t=this.parseDescription();return this.expectKeyword(`fragment`),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:F.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword(`on`),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:F.FRAGMENT_DEFINITION,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword(`on`),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value===`on`)throw this.unexpected();return this.parseName()}parseValueLiteral(e){let t=this._lexer.token;switch(t.kind){case I.BRACKET_L:return this.parseList(e);case I.BRACE_L:return this.parseObject(e);case I.INT:return this.advanceLexer(),this.node(t,{kind:F.INT,value:t.value});case I.FLOAT:return this.advanceLexer(),this.node(t,{kind:F.FLOAT,value:t.value});case I.STRING:case I.BLOCK_STRING:return this.parseStringLiteral();case I.NAME:switch(this.advanceLexer(),t.value){case`true`:return this.node(t,{kind:F.BOOLEAN,value:!0});case`false`:return this.node(t,{kind:F.BOOLEAN,value:!1});case`null`:return this.node(t,{kind:F.NULL});default:return this.node(t,{kind:F.ENUM,value:t.value})}case I.DOLLAR:if(e)if(this.expectToken(I.DOLLAR),this._lexer.token.kind===I.NAME){let e=this._lexer.token.value;throw ca(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}else throw this.unexpected(t);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){let e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:F.STRING,value:e.value,block:e.kind===I.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:F.LIST,values:this.any(I.BRACKET_L,()=>this.parseValueLiteral(e),I.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:F.OBJECT,fields:this.any(I.BRACE_L,()=>this.parseObjectField(e),I.BRACE_R)})}parseObjectField(e){let t=this._lexer.token,n=this.parseName();return this.expectToken(I.COLON),this.node(t,{kind:F.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){let t=[];for(;this.peek(I.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){let t=this._lexer.token;return this.expectToken(I.AT),this.node(t,{kind:F.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){let e=this._lexer.token,t;if(this.expectOptionalToken(I.BRACKET_L)){let n=this.parseTypeReference();this.expectToken(I.BRACKET_R),t=this.node(e,{kind:F.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(I.BANG)?this.node(e,{kind:F.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:F.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(I.STRING)||this.peek(I.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`schema`);let n=this.parseConstDirectives(),r=this.many(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);return this.node(e,{kind:F.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){let e=this._lexer.token,t=this.parseOperationType();this.expectToken(I.COLON);let n=this.parseNamedType();return this.node(e,{kind:F.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`scalar`);let n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:F.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`type`);let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:F.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword(`implements`)?this.delimitedMany(I.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(I.BRACE_L,this.parseFieldDefinition,I.BRACE_R)}parseFieldDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(I.COLON);let i=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:F.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:a})}parseArgumentDefs(){return this.optionalMany(I.PAREN_L,this.parseInputValueDef,I.PAREN_R)}parseInputValueDef(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(I.COLON);let r=this.parseTypeReference(),i;this.expectOptionalToken(I.EQUALS)&&(i=this.parseConstValueLiteral());let a=this.parseConstDirectives();return this.node(e,{kind:F.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:a})}parseInterfaceTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`interface`);let n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:F.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:a})}parseUnionTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`union`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:F.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(I.EQUALS)?this.delimitedMany(I.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`enum`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:F.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(I.BRACE_L,this.parseEnumValueDefinition,I.BRACE_R)}parseEnumValueDefinition(){let e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:F.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if(this._lexer.token.value===`true`||this._lexer.token.value===`false`||this._lexer.token.value===`null`)throw ca(this._lexer.source,this._lexer.token.start,`${So(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`input`);let n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:F.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(I.BRACE_L,this.parseInputValueDef,I.BRACE_R)}parseTypeSystemExtension(){let e=this._lexer.lookahead();if(e.kind===I.NAME)switch(e.value){case`schema`:return this.parseSchemaExtension();case`scalar`:return this.parseScalarTypeExtension();case`type`:return this.parseObjectTypeExtension();case`interface`:return this.parseInterfaceTypeExtension();case`union`:return this.parseUnionTypeExtension();case`enum`:return this.parseEnumTypeExtension();case`input`:return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`schema`);let t=this.parseConstDirectives(),n=this.optionalMany(I.BRACE_L,this.parseOperationTypeDefinition,I.BRACE_R);if(t.length===0&&n.length===0)throw this.unexpected();return this.node(e,{kind:F.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`scalar`);let t=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(e,{kind:F.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`type`);let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n.length===0&&r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:F.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`interface`);let t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(n.length===0&&r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:F.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`union`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:F.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`enum`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:F.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){let e=this._lexer.token;this.expectKeyword(`extend`),this.expectKeyword(`input`);let t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:F.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){let e=this._lexer.token,t=this.parseDescription();this.expectKeyword(`directive`),this.expectToken(I.AT);let n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword(`repeatable`);this.expectKeyword(`on`);let a=this.parseDirectiveLocations();return this.node(e,{kind:F.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:a})}parseDirectiveLocations(){return this.delimitedMany(I.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){let e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(P,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){let e=this._lexer.token,t=this.expectOptionalToken(I.AT),n=this.parseName(),r;!t&&this.expectOptionalToken(I.DOT)&&(r=this.parseName());let i;return(t||r)&&this.expectOptionalToken(I.PAREN_L)&&(i=this.parseName(),this.expectToken(I.COLON),this.expectToken(I.PAREN_R)),t?i?this.node(e,{kind:F.DIRECTIVE_ARGUMENT_COORDINATE,name:n,argumentName:i}):this.node(e,{kind:F.DIRECTIVE_COORDINATE,name:n}):r?i?this.node(e,{kind:F.ARGUMENT_COORDINATE,name:n,fieldName:r,argumentName:i}):this.node(e,{kind:F.MEMBER_COORDINATE,name:n,memberName:r}):this.node(e,{kind:F.TYPE_COORDINATE,name:n})}node(e,t){return this._options.noLocation!==!0&&(t.loc=new da(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){let t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw ca(this._lexer.source,t.start,`Expected ${Co(e)}, found ${So(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){let t=this._lexer.token;if(t.kind===I.NAME&&t.value===e)this.advanceLexer();else throw ca(this._lexer.source,t.start,`Expected "${e}", found ${So(t)}.`)}expectOptionalKeyword(e){let t=this._lexer.token;return t.kind===I.NAME&&t.value===e?(this.advanceLexer(),!0):!1}unexpected(e){let t=e??this._lexer.token;return ca(this._lexer.source,t.start,`Unexpected ${So(t)}.`)}any(e,t,n){this.expectToken(e);let r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){let e=[];do e.push(t.call(this));while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);let r=[];do r.push(t.call(this));while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);let n=[];do n.push(t.call(this));while(this.expectOptionalToken(e));return n}advanceLexer(){let{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==I.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw ca(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}}));function Eo(e,t){let[n,r]=t?[e,t]:[void 0,e],i=` Did you mean `;n&&(i+=n+` `);let a=r.map(e=>`"${e}"`);switch(a.length){case 0:return``;case 1:return i+a[0]+`?`;case 2:return i+a[0]+` or `+a[1]+`?`}let o=a.slice(0,Do),s=o.pop();return i+o.join(`, `)+`, or `+s+`?`}var Do,Oo=n((()=>{Do=5}));function ko(e){return e}var Ao=n((()=>{}));function jo(e,t){let n=Object.create(null);for(let r of e)n[t(r)]=r;return n}var Mo=n((()=>{}));function No(e,t,n){let r=Object.create(null);for(let i of e)r[t(i)]=n(i);return r}var Po=n((()=>{}));function Fo(e,t){let n=Object.create(null);for(let r of Object.keys(e))n[r]=t(e[r],r);return n}var Io=n((()=>{}));function Lo(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){let i=e.charCodeAt(n),a=t.charCodeAt(r);if(Ro(i)&&Ro(a)){let o=0;do++n,o=o*10+i-zo,i=e.charCodeAt(n);while(Ro(i)&&o>0);let s=0;do++r,s=s*10+a-zo,a=t.charCodeAt(r);while(Ro(a)&&s>0);if(o<s)return-1;if(o>s)return 1}else{if(i<a)return-1;if(i>a)return 1;++n,++r}}return e.length-t.length}function Ro(e){return!isNaN(e)&&zo<=e&&e<=Bo}var zo,Bo,Vo=n((()=>{zo=48,Bo=57}));function Ho(e,t){let n=Object.create(null),r=new Wo(e),i=Math.floor(e.length*.4)+1;for(let e of t){let t=r.measure(e,i);t!==void 0&&(n[e]=t)}return Object.keys(n).sort((e,t)=>{let r=n[e]-n[t];return r===0?Lo(e,t):r})}function Uo(e){let t=e.length,n=Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r);return n}var Wo,Go=n((()=>{Vo(),Wo=class{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=Uo(this._inputLowerCase),this._rows=[Array(e.length+1).fill(0),Array(e.length+1).fill(0),Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;let n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=Uo(n),i=this._inputArray;if(r.length<i.length){let e=r;r=i,i=e}let a=r.length,o=i.length;if(a-o>t)return;let s=this._rows;for(let e=0;e<=o;e++)s[0][e]=e;for(let e=1;e<=a;e++){let n=s[(e-1)%3],a=s[e%3],c=a[0]=e;for(let t=1;t<=o;t++){let o=r[e-1]===i[t-1]?0:1,l=Math.min(n[t]+1,a[t-1]+1,n[t-1]+o);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){let n=s[(e-2)%3][t-2];l=Math.min(l,n+1)}l<c&&(c=l),a[t]=l}if(c>t)return}let c=s[a%3][o];return c<=t?c:void 0}}}));function Ko(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;let t=Object.create(null);for(let[n,r]of Object.entries(e))t[n]=r;return t}var qo=n((()=>{}));function Jo(e){return`"${e.replace(Xo,Yo)}"`}function Yo(e){return Zo[e.charCodeAt(0)]}var Xo,Zo,Qo=n((()=>{Xo=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g,Zo=`\\u0000.\\u0001.\\u0002.\\u0003.\\u0004.\\u0005.\\u0006.\\u0007.\\b.\\t.\\n.\\u000B.\\f.\\r.\\u000E.\\u000F.\\u0010.\\u0011.\\u0012.\\u0013.\\u0014.\\u0015.\\u0016.\\u0017.\\u0018.\\u0019.\\u001A.\\u001B.\\u001C.\\u001D.\\u001E.\\u001F...\\"..........................................................\\\\...................................\\u007F.\\u0080.\\u0081.\\u0082.\\u0083.\\u0084.\\u0085.\\u0086.\\u0087.\\u0088.\\u0089.\\u008A.\\u008B.\\u008C.\\u008D.\\u008E.\\u008F.\\u0090.\\u0091.\\u0092.\\u0093.\\u0094.\\u0095.\\u0096.\\u0097.\\u0098.\\u0099.\\u009A.\\u009B.\\u009C.\\u009D.\\u009E.\\u009F`.split(`.`)}));function $o(e,t,n=pa){let r=new Map;for(let e of Object.values(F))r.set(e,ts(t,e));let i,a=Array.isArray(e),o=[e],s=-1,c=[],l=e,u,d,f=[],p=[];do{s++;let e=s===o.length,m=e&&c.length!==0;if(e){if(u=p.length===0?void 0:f[f.length-1],l=d,d=p.pop(),m)if(a){l=l.slice();let e=0;for(let[t,n]of c){let r=t-e;n===null?(l.splice(r,1),e++):l[r]=n}}else{l={...l};for(let[e,t]of c)l[e]=t}s=i.index,o=i.keys,c=i.edits,a=i.inArray,i=i.prev}else if(d){if(u=a?s:o[s],l=d[u],l==null)continue;f.push(u)}let h;if(!Array.isArray(l)){if(ua(l)||Ui(!1,`Invalid AST Node: ${L(l)}.`),h=(e?r.get(l.kind)?.leave:r.get(l.kind)?.enter)?.call(t,l,u,d,f,p),h===rs)break;if(h===!1){if(!e){f.pop();continue}}else if(h!==void 0&&(c.push([u,h]),!e))if(ua(h))l=h;else{f.pop();continue}}h===void 0&&m&&c.push([u,l]),e?f.pop():(i={inArray:a,index:s,keys:o,edits:c,prev:i},a=Array.isArray(l),o=a?l:n[l.kind]??[],s=-1,c=[],d&&p.push(d),d=l)}while(i!==void 0);return c.length===0?e:c[c.length-1][1]}function es(e){let t=Array(e.length).fill(null),n=Object.create(null);for(let r of Object.values(F)){let i=!1,a=Array(e.length).fill(void 0),o=Array(e.length).fill(void 0);for(let t=0;t<e.length;++t){let{enter:n,leave:s}=ts(e[t],r);i||=n!=null||s!=null,a[t]=n,o[t]=s}i&&(n[r]={enter(...n){let r=n[0];for(let i=0;i<e.length;i++)if(t[i]===null){let o=a[i]?.apply(e[i],n);if(o===!1)t[i]=r;else if(o===rs)t[i]=rs;else if(o!==void 0)return o}},leave(...n){let r=n[0];for(let i=0;i<e.length;i++)if(t[i]===null){let r=o[i]?.apply(e[i],n);if(r===rs)t[i]=rs;else if(r!==void 0&&r!==!1)return r}else t[i]===r&&(t[i]=null)}})}return n}function ts(e,t){let n=e[t];return typeof n==`object`?n:typeof n==`function`?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function ns(e,t,n){let{enter:r,leave:i}=ts(e,t);return n?i:r}var rs,is=n((()=>{Wi(),lo(),ga(),va(),rs=Object.freeze({})}));function as(e){return $o(e,us)}function R(e,t=``){return e?.filter(e=>e).join(t)??``}function os(e){return z(`{ +`,ss(R(e,` +`)),` +}`)}function z(e,t,n=``){return t!=null&&t!==``?e+t+n:``}function ss(e){return z(` `,e.replace(/\n/g,` + `))}function cs(e){return e?.some(e=>e.includes(` +`))??!1}var ls,us,ds=n((()=>{ka(),Qo(),is(),ls=80,us={Name:{leave:e=>e.value},Variable:{leave:e=>`$`+e.name},Document:{leave:e=>R(e.definitions,` + +`)},OperationDefinition:{leave(e){let t=cs(e.variableDefinitions)?z(`( +`,R(e.variableDefinitions,` +`),` +)`):z(`(`,R(e.variableDefinitions,`, `),`)`),n=z(``,e.description,` +`)+R([e.operation,R([e.name,t]),R(e.directives,` `)],` `);return(n===`query`?``:n+` `)+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>z(``,i,` +`)+e+`: `+t+z(` = `,n)+z(` `,R(r,` `))},SelectionSet:{leave:({selections:e})=>os(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){let a=z(``,e,`: `)+t,o=a+z(`(`,R(n,`, `),`)`);return o.length>ls&&(o=a+z(`( +`,ss(R(n,` +`)),` +)`)),R([o,R(r,` `),i],` `)}},Argument:{leave:({name:e,value:t})=>e+`: `+t},FragmentSpread:{leave:({name:e,directives:t})=>`...`+e+z(` `,R(t,` `))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>R([`...`,z(`on `,e),R(t,` `),n],` `)},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:a})=>z(``,a,` +`)+`fragment ${e}${z(`(`,R(n,`, `),`)`)} on ${t} ${z(``,R(r,` `),` `)}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Oa(e):Jo(e)},BooleanValue:{leave:({value:e})=>e?`true`:`false`},NullValue:{leave:()=>`null`},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>`[`+R(e,`, `)+`]`},ObjectValue:{leave:({fields:e})=>`{`+R(e,`, `)+`}`},ObjectField:{leave:({name:e,value:t})=>e+`: `+t},Directive:{leave:({name:e,arguments:t})=>`@`+e+z(`(`,R(t,`, `),`)`)},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>`[`+e+`]`},NonNullType:{leave:({type:e})=>e+`!`},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>z(``,e,` +`)+R([`schema`,R(t,` `),os(n)],` `)},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+`: `+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>z(``,e,` +`)+R([`scalar`,t,R(n,` `)],` `)},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>z(``,e,` +`)+R([`type`,t,z(`implements `,R(n,` & `)),R(r,` `),os(i)],` `)},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>z(``,e,` +`)+t+(cs(n)?z(`( +`,ss(R(n,` +`)),` +)`):z(`(`,R(n,`, `),`)`))+`: `+r+z(` `,R(i,` `))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>z(``,e,` +`)+R([t+`: `+n,z(`= `,r),R(i,` `)],` `)},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>z(``,e,` +`)+R([`interface`,t,z(`implements `,R(n,` & `)),R(r,` `),os(i)],` `)},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>z(``,e,` +`)+R([`union`,t,R(n,` `),z(`= `,R(r,` | `))],` `)},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>z(``,e,` +`)+R([`enum`,t,R(n,` `),os(r)],` `)},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>z(``,e,` +`)+R([t,R(n,` `)],` `)},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>z(``,e,` +`)+R([`input`,t,R(n,` `),os(r)],` `)},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>z(``,e,` +`)+`directive @`+t+(cs(n)?z(`( +`,ss(R(n,` +`)),` +)`):z(`(`,R(n,`, `),`)`))+(r?` repeatable`:``)+` on `+R(i,` | `)},SchemaExtension:{leave:({directives:e,operationTypes:t})=>R([`extend schema`,R(e,` `),os(t)],` `)},ScalarTypeExtension:{leave:({name:e,directives:t})=>R([`extend scalar`,e,R(t,` `)],` `)},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>R([`extend type`,e,z(`implements `,R(t,` & `)),R(n,` `),os(r)],` `)},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>R([`extend interface`,e,z(`implements `,R(t,` & `)),R(n,` `),os(r)],` `)},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>R([`extend union`,e,R(t,` `),z(`= `,R(n,` | `))],` `)},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>R([`extend enum`,e,R(t,` `),os(n)],` `)},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>R([`extend input`,e,R(t,` `),os(n)],` `)},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>R([e,z(`.`,t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>R([e,z(`.`,t),z(`(`,n,`:)`)])},DirectiveCoordinate:{leave:({name:e})=>R([`@`,e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>R([`@`,e,z(`(`,t,`:)`)])}}}));function fs(e,t){switch(e.kind){case F.NULL:return null;case F.INT:return parseInt(e.value,10);case F.FLOAT:return parseFloat(e.value);case F.STRING:case F.ENUM:case F.BOOLEAN:return e.value;case F.LIST:return e.values.map(e=>fs(e,t));case F.OBJECT:return No(e.fields,e=>e.name.value,e=>fs(e.value,t));case F.VARIABLE:return t?.[e.name.value]}}var ps=n((()=>{Po(),va()}));function ms(e){if(e??Ui(!1,`Must provide name.`),typeof e==`string`||Ui(!1,`Expected name to be a string.`),e.length===0)throw new M(`Expected name to be a non-empty string.`);for(let t=1;t<e.length;++t)if(!Ca(e.charCodeAt(t)))throw new M(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!Sa(e.charCodeAt(0)))throw new M(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function hs(e){if(e===`true`||e===`false`||e===`null`)throw new M(`Enum values cannot be named: ${e}`);return ms(e)}var gs=n((()=>{Wi(),N(),wa()}));function _s(e){return ys(e)||B(e)||Ss(e)||ws(e)||Es(e)||Os(e)||As(e)||V(e)}function vs(e){if(!_s(e))throw Error(`Expected ${L(e)} to be a GraphQL type.`);return e}function ys(e){return fo(e,pc)}function bs(e){if(!ys(e))throw Error(`Expected ${L(e)} to be a GraphQL Scalar type.`);return e}function B(e){return fo(e,mc)}function xs(e){if(!B(e))throw Error(`Expected ${L(e)} to be a GraphQL Object type.`);return e}function Ss(e){return fo(e,hc)}function Cs(e){if(!Ss(e))throw Error(`Expected ${L(e)} to be a GraphQL Interface type.`);return e}function ws(e){return fo(e,gc)}function Ts(e){if(!ws(e))throw Error(`Expected ${L(e)} to be a GraphQL Union type.`);return e}function Es(e){return fo(e,_c)}function Ds(e){if(!Es(e))throw Error(`Expected ${L(e)} to be a GraphQL Enum type.`);return e}function Os(e){return fo(e,vc)}function ks(e){if(!Os(e))throw Error(`Expected ${L(e)} to be a GraphQL Input Object type.`);return e}function As(e){return fo(e,dc)}function js(e){if(!As(e))throw Error(`Expected ${L(e)} to be a GraphQL List type.`);return e}function V(e){return fo(e,fc)}function Ms(e){if(!V(e))throw Error(`Expected ${L(e)} to be a GraphQL Non-Null type.`);return e}function Ns(e){return ys(e)||Es(e)||Os(e)||Us(e)&&Ns(e.ofType)}function Ps(e){if(!Ns(e))throw Error(`Expected ${L(e)} to be a GraphQL input type.`);return e}function Fs(e){return ys(e)||B(e)||Ss(e)||ws(e)||Es(e)||Us(e)&&Fs(e.ofType)}function Is(e){if(!Fs(e))throw Error(`Expected ${L(e)} to be a GraphQL output type.`);return e}function Ls(e){return ys(e)||Es(e)}function Rs(e){if(!Ls(e))throw Error(`Expected ${L(e)} to be a GraphQL leaf type.`);return e}function zs(e){return B(e)||Ss(e)||ws(e)}function Bs(e){if(!zs(e))throw Error(`Expected ${L(e)} to be a GraphQL composite type.`);return e}function Vs(e){return Ss(e)||ws(e)}function Hs(e){if(!Vs(e))throw Error(`Expected ${L(e)} to be a GraphQL abstract type.`);return e}function Us(e){return As(e)||V(e)}function Ws(e){if(!Us(e))throw Error(`Expected ${L(e)} to be a GraphQL wrapping type.`);return e}function Gs(e){return _s(e)&&!V(e)}function Ks(e){if(!Gs(e))throw Error(`Expected ${L(e)} to be a GraphQL nullable type.`);return e}function qs(e){if(e)return V(e)?e.ofType:e}function Js(e){return ys(e)||B(e)||Ss(e)||ws(e)||Es(e)||Os(e)}function Ys(e){if(!Js(e))throw Error(`Expected ${L(e)} to be a GraphQL named type.`);return e}function Xs(e){if(e){let t=e;for(;Us(t);)t=t.ofType;return t}}function Zs(e){return typeof e==`function`?e():e}function Qs(e){return typeof e==`function`?e():e}function $s(e){let t=Zs(e.interfaces??[]);return Array.isArray(t)||Ui(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),t}function ec(e){let t=Qs(e.fields);return nc(t)||Ui(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Fo(t,(t,n)=>{nc(t)||Ui(!1,`${e.name}.${n} field config must be an object.`),t.resolve==null||typeof t.resolve==`function`||Ui(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${L(t.resolve)}.`);let r=t.args??{};return nc(r)||Ui(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:ms(n),description:t.description,type:t.type,args:tc(r),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:Ko(t.extensions),astNode:t.astNode}})}function tc(e){return Object.entries(e).map(([e,t])=>({name:ms(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:Ko(t.extensions),astNode:t.astNode}))}function nc(e){return qi(e)&&!Array.isArray(e)}function rc(e){return Fo(e,e=>({description:e.description,type:e.type,args:ic(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function ic(e){return No(e,e=>e.name,e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}))}function ac(e){return V(e.type)&&e.defaultValue===void 0}function oc(e){let t=Zs(e.types);return Array.isArray(t)||Ui(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}function sc(e,t){return Eo(`the enum value`,Ho(t,e.getValues().map(e=>e.name)))}function cc(e,t){return nc(t)||Ui(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([t,n])=>(nc(n)||Ui(!1,`${e}.${t} must refer to an object with a "value" key representing an internal value but got: ${L(n)}.`),{name:hs(t),description:n.description,value:n.value===void 0?t:n.value,deprecationReason:n.deprecationReason,extensions:Ko(n.extensions),astNode:n.astNode}))}function lc(e){let t=Qs(e.fields);return nc(t)||Ui(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),Fo(t,(t,n)=>(!(`resolve`in t)||Ui(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:ms(n),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:Ko(t.extensions),astNode:t.astNode}))}function uc(e){return V(e.type)&&e.defaultValue===void 0}var dc,fc,pc,mc,hc,gc,_c,vc,yc=n((()=>{Wi(),Oo(),Ao(),lo(),po(),Ji(),Mo(),Po(),Io(),Go(),qo(),N(),va(),ds(),ps(),gs(),dc=class{constructor(e){_s(e)||Ui(!1,`Expected ${L(e)} to be a GraphQL type.`),this.ofType=e}get[Symbol.toStringTag](){return`GraphQLList`}toString(){return`[`+String(this.ofType)+`]`}toJSON(){return this.toString()}},fc=class{constructor(e){Gs(e)||Ui(!1,`Expected ${L(e)} to be a GraphQL nullable type.`),this.ofType=e}get[Symbol.toStringTag](){return`GraphQLNonNull`}toString(){return String(this.ofType)+`!`}toJSON(){return this.toString()}},pc=class{constructor(e){let t=e.parseValue??ko;this.name=ms(e.name),this.description=e.description,this.specifiedByURL=e.specifiedByURL,this.serialize=e.serialize??ko,this.parseValue=t,this.parseLiteral=e.parseLiteral??((e,n)=>t(fs(e,n))),this.extensions=Ko(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],e.specifiedByURL==null||typeof e.specifiedByURL==`string`||Ui(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${L(e.specifiedByURL)}.`),e.serialize==null||typeof e.serialize==`function`||Ui(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&(typeof e.parseValue==`function`&&typeof e.parseLiteral==`function`||Ui(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return`GraphQLScalarType`}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},mc=class{constructor(e){this.name=ms(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=Ko(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=()=>ec(e),this._interfaces=()=>$s(e),e.isTypeOf==null||typeof e.isTypeOf==`function`||Ui(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${L(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return`GraphQLObjectType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces==`function`&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:rc(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},hc=class{constructor(e){this.name=ms(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Ko(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._fields=ec.bind(void 0,e),this._interfaces=$s.bind(void 0,e),e.resolveType==null||typeof e.resolveType==`function`||Ui(!1,`${this.name} must provide "resolveType" as a function, but got: ${L(e.resolveType)}.`)}get[Symbol.toStringTag](){return`GraphQLInterfaceType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces==`function`&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:rc(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},gc=class{constructor(e){this.name=ms(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=Ko(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._types=oc.bind(void 0,e),e.resolveType==null||typeof e.resolveType==`function`||Ui(!1,`${this.name} must provide "resolveType" as a function, but got: ${L(e.resolveType)}.`)}get[Symbol.toStringTag](){return`GraphQLUnionType`}getTypes(){return typeof this._types==`function`&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},_c=class{constructor(e){this.name=ms(e.name),this.description=e.description,this.extensions=Ko(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._values=typeof e.values==`function`?e.values:cc(this.name,e.values),this._valueLookup=null,this._nameLookup=null}get[Symbol.toStringTag](){return`GraphQLEnumType`}getValues(){return typeof this._values==`function`&&(this._values=cc(this.name,this._values())),this._values}getValue(e){return this._nameLookup===null&&(this._nameLookup=jo(this.getValues(),e=>e.name)),this._nameLookup[e]}serialize(e){this._valueLookup===null&&(this._valueLookup=new Map(this.getValues().map(e=>[e.value,e])));let t=this._valueLookup.get(e);if(t===void 0)throw new M(`Enum "${this.name}" cannot represent value: ${L(e)}`);return t.name}parseValue(e){if(typeof e!=`string`){let t=L(e);throw new M(`Enum "${this.name}" cannot represent non-string value: ${t}.`+sc(this,t))}let t=this.getValue(e);if(t==null)throw new M(`Value "${e}" does not exist in "${this.name}" enum.`+sc(this,e));return t.value}parseLiteral(e,t){if(e.kind!==F.ENUM){let t=as(e);throw new M(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+sc(this,t),{nodes:e})}let n=this.getValue(e.value);if(n==null){let t=as(e);throw new M(`Value "${t}" does not exist in "${this.name}" enum.`+sc(this,t),{nodes:e})}return n.value}toConfig(){let e=No(this.getValues(),e=>e.name,e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}},vc=class{constructor(e){this.name=ms(e.name),this.description=e.description,this.extensions=Ko(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this.isOneOf=e.isOneOf??!1,this._fields=lc.bind(void 0,e)}get[Symbol.toStringTag](){return`GraphQLInputObjectType`}getFields(){return typeof this._fields==`function`&&(this._fields=this._fields()),this._fields}toConfig(){let e=Fo(this.getFields(),e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode}));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,isOneOf:this.isOneOf}}toString(){return this.name}toJSON(){return this.toString()}}}));function bc(e,t){return e===t?!0:V(e)&&V(t)||As(e)&&As(t)?bc(e.ofType,t.ofType):!1}function xc(e,t,n){return t===n?!0:V(n)?V(t)?xc(e,t.ofType,n.ofType):!1:V(t)?xc(e,t.ofType,n):As(n)?As(t)?xc(e,t.ofType,n.ofType):!1:As(t)?!1:Vs(n)&&(Ss(t)||B(t))&&e.isSubType(n,t)}function Sc(e,t,n){return t===n?!0:Vs(t)?Vs(n)?e.getPossibleTypes(t).some(t=>e.isSubType(n,t)):e.isSubType(t,n):Vs(n)?e.isSubType(n,t):!1}var Cc=n((()=>{yc()}));function wc(e){return Nc.some(({name:t})=>e.name===t)}function Tc(e){if(qi(e)){if(typeof e.valueOf==`function`){let t=e.valueOf();if(!qi(t))return t}if(typeof e.toJSON==`function`)return e.toJSON()}return e}var Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc=n((()=>{lo(),Ji(),N(),va(),ds(),yc(),Ec=2147483647,Dc=-2147483648,Oc=new pc({name:`Int`,description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){let t=Tc(e);if(typeof t==`boolean`)return+!!t;let n=t;if(typeof t==`string`&&t!==``&&(n=Number(t)),typeof n!=`number`||!Number.isInteger(n))throw new M(`Int cannot represent non-integer value: ${L(t)}`);if(n>2147483647||n<-2147483648)throw new M(`Int cannot represent non 32-bit signed integer value: `+L(t));return n},parseValue(e){if(typeof e!=`number`||!Number.isInteger(e))throw new M(`Int cannot represent non-integer value: ${L(e)}`);if(e>2147483647||e<-2147483648)throw new M(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==F.INT)throw new M(`Int cannot represent non-integer value: ${as(e)}`,{nodes:e});let t=parseInt(e.value,10);if(t>2147483647||t<-2147483648)throw new M(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),kc=new pc({name:`Float`,description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(e){let t=Tc(e);if(typeof t==`boolean`)return+!!t;let n=t;if(typeof t==`string`&&t!==``&&(n=Number(t)),typeof n!=`number`||!Number.isFinite(n))throw new M(`Float cannot represent non numeric value: ${L(t)}`);return n},parseValue(e){if(typeof e!=`number`||!Number.isFinite(e))throw new M(`Float cannot represent non numeric value: ${L(e)}`);return e},parseLiteral(e){if(e.kind!==F.FLOAT&&e.kind!==F.INT)throw new M(`Float cannot represent non numeric value: ${as(e)}`,e);return parseFloat(e.value)}}),Ac=new pc({name:`String`,description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(e){let t=Tc(e);if(typeof t==`string`)return t;if(typeof t==`boolean`)return t?`true`:`false`;if(typeof t==`number`&&Number.isFinite(t))return t.toString();throw new M(`String cannot represent value: ${L(e)}`)},parseValue(e){if(typeof e!=`string`)throw new M(`String cannot represent a non string value: ${L(e)}`);return e},parseLiteral(e){if(e.kind!==F.STRING)throw new M(`String cannot represent a non string value: ${as(e)}`,{nodes:e});return e.value}}),jc=new pc({name:`Boolean`,description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){let t=Tc(e);if(typeof t==`boolean`)return t;if(Number.isFinite(t))return t!==0;throw new M(`Boolean cannot represent a non boolean value: ${L(t)}`)},parseValue(e){if(typeof e!=`boolean`)throw new M(`Boolean cannot represent a non boolean value: ${L(e)}`);return e},parseLiteral(e){if(e.kind!==F.BOOLEAN)throw new M(`Boolean cannot represent a non boolean value: ${as(e)}`,{nodes:e});return e.value}}),Mc=new pc({name:`ID`,description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(e){let t=Tc(e);if(typeof t==`string`)return t;if(Number.isInteger(t))return String(t);throw new M(`ID cannot represent value: ${L(e)}`)},parseValue(e){if(typeof e==`string`)return e;if(typeof e==`number`&&Number.isInteger(e))return e.toString();throw new M(`ID cannot represent value: ${L(e)}`)},parseLiteral(e){if(e.kind!==F.STRING&&e.kind!==F.INT)throw new M(`ID cannot represent a non-string and non-integer value: `+as(e),{nodes:e});return e.value}}),Nc=Object.freeze([Ac,Oc,kc,jc,Mc])}));function Fc(e){return fo(e,Rc)}function Ic(e){if(!Fc(e))throw Error(`Expected ${L(e)} to be a GraphQL directive.`);return e}function Lc(e){return Gc.some(({name:t})=>t===e.name)}var Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc=n((()=>{Wi(),lo(),po(),Ji(),qo(),_a(),gs(),yc(),Pc(),Rc=class{constructor(e){this.name=ms(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=e.isRepeatable??!1,this.extensions=Ko(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||Ui(!1,`@${e.name} locations must be an Array.`);let t=e.args??{};qi(t)&&!Array.isArray(t)||Ui(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=tc(t)}get[Symbol.toStringTag](){return`GraphQLDirective`}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:ic(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return`@`+this.name}toJSON(){return this.toString()}},zc=new Rc({name:`include`,description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[P.FIELD,P.FRAGMENT_SPREAD,P.INLINE_FRAGMENT],args:{if:{type:new fc(jc),description:`Included when true.`}}}),Bc=new Rc({name:`skip`,description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[P.FIELD,P.FRAGMENT_SPREAD,P.INLINE_FRAGMENT],args:{if:{type:new fc(jc),description:`Skipped when true.`}}}),Vc=`No longer supported`,Hc=new Rc({name:`deprecated`,description:`Marks an element of a GraphQL schema as no longer supported.`,locations:[P.FIELD_DEFINITION,P.ARGUMENT_DEFINITION,P.INPUT_FIELD_DEFINITION,P.ENUM_VALUE],args:{reason:{type:Ac,description:`Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).`,defaultValue:Vc}}}),Uc=new Rc({name:`specifiedBy`,description:`Exposes a URL that specifies the behavior of this scalar.`,locations:[P.SCALAR],args:{url:{type:new fc(Ac),description:`The URL that specifies the behavior of this scalar.`}}}),Wc=new Rc({name:`oneOf`,description:"Indicates exactly one field must be supplied and this field must not be `null`.",locations:[P.INPUT_OBJECT],args:{}}),Gc=Object.freeze([zc,Bc,Hc,Uc,Wc])}));function qc(e){return typeof e==`object`&&typeof e?.[Symbol.iterator]==`function`}var Jc=n((()=>{}));function Yc(e,t){if(V(t)){let n=Yc(e,t.ofType);return n?.kind===F.NULL?null:n}if(e===null)return{kind:F.NULL};if(e===void 0)return null;if(As(t)){let n=t.ofType;if(qc(e)){let t=[];for(let r of e){let e=Yc(r,n);e!=null&&t.push(e)}return{kind:F.LIST,values:t}}return Yc(e,n)}if(Os(t)){if(!qi(e))return null;let n=[];for(let r of Object.values(t.getFields())){let t=Yc(e[r.name],r.type);t&&n.push({kind:F.OBJECT_FIELD,name:{kind:F.NAME,value:r.name},value:t})}return{kind:F.OBJECT,fields:n}}if(Ls(t)){let n=t.serialize(e);if(n==null)return null;if(typeof n==`boolean`)return{kind:F.BOOLEAN,value:n};if(typeof n==`number`&&Number.isFinite(n)){let e=String(n);return Xc.test(e)?{kind:F.INT,value:e}:{kind:F.FLOAT,value:e}}if(typeof n==`string`)return Es(t)?{kind:F.ENUM,value:n}:t===Mc&&Xc.test(n)?{kind:F.INT,value:n}:{kind:F.STRING,value:n};throw TypeError(`Cannot convert value to AST: ${L(n)}.`)}Yi(!1,`Unexpected input type: `+L(t))}var Xc,Zc=n((()=>{lo(),Xi(),Jc(),Ji(),va(),yc(),Pc(),Xc=/^-?(?:0|[1-9][0-9]*)$/}));function Qc(e){return dl.some(({name:t})=>e.name===t)}var $c,el,tl,nl,rl,il,al,ol,sl,cl,ll,ul,dl,fl=n((()=>{lo(),Xi(),_a(),ds(),Zc(),yc(),Pc(),$c=new mc({name:`__Schema`,description:`A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.`,fields:()=>({description:{type:Ac,resolve:e=>e.description},types:{description:`A list of all types supported by this server.`,type:new fc(new dc(new fc(nl))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:`The type that query operations will be rooted at.`,type:new fc(nl),resolve:e=>e.getQueryType()},mutationType:{description:`If this server supports mutation, the type that mutation operations will be rooted at.`,type:nl,resolve:e=>e.getMutationType()},subscriptionType:{description:`If this server support subscription, the type that subscription operations will be rooted at.`,type:nl,resolve:e=>e.getSubscriptionType()},directives:{description:`A list of all directives supported by this server.`,type:new fc(new dc(new fc(el))),resolve:e=>e.getDirectives()}})}),el=new mc({name:`__Directive`,description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document. + +In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new fc(Ac),resolve:e=>e.name},description:{type:Ac,resolve:e=>e.description},isRepeatable:{type:new fc(jc),resolve:e=>e.isRepeatable},locations:{type:new fc(new dc(new fc(tl))),resolve:e=>e.locations},args:{type:new fc(new dc(new fc(il))),args:{includeDeprecated:{type:jc,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(e=>e.deprecationReason==null)}}})}),tl=new _c({name:`__DirectiveLocation`,description:`A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.`,values:{QUERY:{value:P.QUERY,description:`Location adjacent to a query operation.`},MUTATION:{value:P.MUTATION,description:`Location adjacent to a mutation operation.`},SUBSCRIPTION:{value:P.SUBSCRIPTION,description:`Location adjacent to a subscription operation.`},FIELD:{value:P.FIELD,description:`Location adjacent to a field.`},FRAGMENT_DEFINITION:{value:P.FRAGMENT_DEFINITION,description:`Location adjacent to a fragment definition.`},FRAGMENT_SPREAD:{value:P.FRAGMENT_SPREAD,description:`Location adjacent to a fragment spread.`},INLINE_FRAGMENT:{value:P.INLINE_FRAGMENT,description:`Location adjacent to an inline fragment.`},VARIABLE_DEFINITION:{value:P.VARIABLE_DEFINITION,description:`Location adjacent to a variable definition.`},SCHEMA:{value:P.SCHEMA,description:`Location adjacent to a schema definition.`},SCALAR:{value:P.SCALAR,description:`Location adjacent to a scalar definition.`},OBJECT:{value:P.OBJECT,description:`Location adjacent to an object type definition.`},FIELD_DEFINITION:{value:P.FIELD_DEFINITION,description:`Location adjacent to a field definition.`},ARGUMENT_DEFINITION:{value:P.ARGUMENT_DEFINITION,description:`Location adjacent to an argument definition.`},INTERFACE:{value:P.INTERFACE,description:`Location adjacent to an interface definition.`},UNION:{value:P.UNION,description:`Location adjacent to a union definition.`},ENUM:{value:P.ENUM,description:`Location adjacent to an enum definition.`},ENUM_VALUE:{value:P.ENUM_VALUE,description:`Location adjacent to an enum value definition.`},INPUT_OBJECT:{value:P.INPUT_OBJECT,description:`Location adjacent to an input object type definition.`},INPUT_FIELD_DEFINITION:{value:P.INPUT_FIELD_DEFINITION,description:`Location adjacent to an input object field definition.`}}}),nl=new mc({name:`__Type`,description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new fc(sl),resolve(e){if(ys(e))return ol.SCALAR;if(B(e))return ol.OBJECT;if(Ss(e))return ol.INTERFACE;if(ws(e))return ol.UNION;if(Es(e))return ol.ENUM;if(Os(e))return ol.INPUT_OBJECT;if(As(e))return ol.LIST;if(V(e))return ol.NON_NULL;Yi(!1,`Unexpected type: "${L(e)}".`)}},name:{type:Ac,resolve:e=>`name`in e?e.name:void 0},description:{type:Ac,resolve:e=>`description`in e?e.description:void 0},specifiedByURL:{type:Ac,resolve:e=>`specifiedByURL`in e?e.specifiedByURL:void 0},fields:{type:new dc(new fc(rl)),args:{includeDeprecated:{type:jc,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(B(e)||Ss(e)){let n=Object.values(e.getFields());return t?n:n.filter(e=>e.deprecationReason==null)}}},interfaces:{type:new dc(new fc(nl)),resolve(e){if(B(e)||Ss(e))return e.getInterfaces()}},possibleTypes:{type:new dc(new fc(nl)),resolve(e,t,n,{schema:r}){if(Vs(e))return r.getPossibleTypes(e)}},enumValues:{type:new dc(new fc(al)),args:{includeDeprecated:{type:jc,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Es(e)){let n=e.getValues();return t?n:n.filter(e=>e.deprecationReason==null)}}},inputFields:{type:new dc(new fc(il)),args:{includeDeprecated:{type:jc,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(Os(e)){let n=Object.values(e.getFields());return t?n:n.filter(e=>e.deprecationReason==null)}}},ofType:{type:nl,resolve:e=>`ofType`in e?e.ofType:void 0},isOneOf:{type:jc,resolve:e=>{if(Os(e))return e.isOneOf}}})}),rl=new mc({name:`__Field`,description:`Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.`,fields:()=>({name:{type:new fc(Ac),resolve:e=>e.name},description:{type:Ac,resolve:e=>e.description},args:{type:new fc(new dc(new fc(il))),args:{includeDeprecated:{type:jc,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(e=>e.deprecationReason==null)}},type:{type:new fc(nl),resolve:e=>e.type},isDeprecated:{type:new fc(jc),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Ac,resolve:e=>e.deprecationReason}})}),il=new mc({name:`__InputValue`,description:`Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.`,fields:()=>({name:{type:new fc(Ac),resolve:e=>e.name},description:{type:Ac,resolve:e=>e.description},type:{type:new fc(nl),resolve:e=>e.type},defaultValue:{type:Ac,description:`A GraphQL-formatted string representing the default value for this input value.`,resolve(e){let{type:t,defaultValue:n}=e,r=Yc(n,t);return r?as(r):null}},isDeprecated:{type:new fc(jc),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Ac,resolve:e=>e.deprecationReason}})}),al=new mc({name:`__EnumValue`,description:`One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.`,fields:()=>({name:{type:new fc(Ac),resolve:e=>e.name},description:{type:Ac,resolve:e=>e.description},isDeprecated:{type:new fc(jc),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:Ac,resolve:e=>e.deprecationReason}})}),(function(e){e.SCALAR=`SCALAR`,e.OBJECT=`OBJECT`,e.INTERFACE=`INTERFACE`,e.UNION=`UNION`,e.ENUM=`ENUM`,e.INPUT_OBJECT=`INPUT_OBJECT`,e.LIST=`LIST`,e.NON_NULL=`NON_NULL`})(ol||={}),sl=new _c({name:`__TypeKind`,description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:ol.SCALAR,description:`Indicates this type is a scalar.`},OBJECT:{value:ol.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:ol.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:ol.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:ol.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:ol.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:ol.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:ol.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),cl={name:`__schema`,type:new fc($c),description:`Access the current type schema of this server.`,args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},ll={name:`__type`,type:nl,description:`Request the type information of a single type.`,args:[{name:`name`,description:void 0,type:new fc(Ac),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},ul={name:`__typename`,type:new fc(Ac),description:`The name of the current Object type at runtime.`,args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},dl=Object.freeze([$c,el,tl,nl,rl,il,al,sl])}));function pl(e){return fo(e,gl)}function ml(e){if(!pl(e))throw Error(`Expected ${L(e)} to be a GraphQL schema.`);return e}function hl(e,t){let n=Xs(e);if(!t.has(n)){if(t.add(n),ws(n))for(let e of n.getTypes())hl(e,t);else if(B(n)||Ss(n)){for(let e of n.getInterfaces())hl(e,t);for(let e of Object.values(n.getFields())){hl(e.type,t);for(let n of e.args)hl(n.type,t)}}else if(Os(n))for(let e of Object.values(n.getFields()))hl(e.type,t)}return t}var gl,_l=n((()=>{Wi(),lo(),po(),Ji(),qo(),ga(),yc(),Kc(),fl(),gl=class{constructor(e){this.__validationErrors=e.assumeValid===!0?[]:void 0,qi(e)||Ui(!1,`Must provide configuration object.`),!e.types||Array.isArray(e.types)||Ui(!1,`"types" must be Array if provided but got: ${L(e.types)}.`),!e.directives||Array.isArray(e.directives)||Ui(!1,`"directives" must be Array if provided but got: ${L(e.directives)}.`),this.description=e.description,this.extensions=Ko(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=e.extensionASTNodes??[],this._queryType=e.query,this._mutationType=e.mutation,this._subscriptionType=e.subscription,this._directives=e.directives??Gc;let t=new Set(e.types);if(e.types!=null)for(let n of e.types)t.delete(n),hl(n,t);this._queryType!=null&&hl(this._queryType,t),this._mutationType!=null&&hl(this._mutationType,t),this._subscriptionType!=null&&hl(this._subscriptionType,t);for(let e of this._directives)if(Fc(e))for(let n of e.args)hl(n.type,t);hl($c,t),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(let e of t){if(e==null)continue;let t=e.name;if(t||Ui(!1,`One of the provided types for building the Schema is missing a name.`),this._typeMap[t]!==void 0)throw Error(`Schema must contain uniquely named types but contains multiple types named "${t}".`);if(this._typeMap[t]=e,Ss(e)){for(let t of e.getInterfaces())if(Ss(t)){let n=this._implementationsMap[t.name];n===void 0&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.interfaces.push(e)}}else if(B(e)){for(let t of e.getInterfaces())if(Ss(t)){let n=this._implementationsMap[t.name];n===void 0&&(n=this._implementationsMap[t.name]={objects:[],interfaces:[]}),n.objects.push(e)}}}}get[Symbol.toStringTag](){return`GraphQLSchema`}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(e){switch(e){case ha.QUERY:return this.getQueryType();case ha.MUTATION:return this.getMutationType();case ha.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(e){return this.getTypeMap()[e]}getPossibleTypes(e){return ws(e)?e.getTypes():this.getImplementations(e).objects}getImplementations(e){return this._implementationsMap[e.name]??{objects:[],interfaces:[]}}isSubType(e,t){let n=this._subTypeMap[e.name];if(n===void 0){if(n=Object.create(null),ws(e))for(let t of e.getTypes())n[t.name]=!0;else{let t=this.getImplementations(e);for(let e of t.objects)n[e.name]=!0;for(let e of t.interfaces)n[e.name]=!0}this._subTypeMap[e.name]=n}return n[t.name]!==void 0}getDirectives(){return this._directives}getDirective(e){return this.getDirectives().find(t=>t.name===e)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}}));function vl(e){if(ml(e),e.__validationErrors)return e.__validationErrors;let t=new Ll(e);bl(t),Sl(t),wl(t);let n=t.getErrors();return e.__validationErrors=n,n}function yl(e){let t=vl(e);if(t.length!==0)throw Error(t.map(e=>e.message).join(` + +`))}function bl(e){let t=e.schema,n=t.getQueryType();n?B(n)||e.reportError(`Query root type must be Object type, it cannot be ${L(n)}.`,xl(t,ha.QUERY)??n.astNode):e.reportError(`Query root type must be provided.`,t.astNode);let r=t.getMutationType();r&&!B(r)&&e.reportError(`Mutation root type must be Object type if provided, it cannot be ${L(r)}.`,xl(t,ha.MUTATION)??r.astNode);let i=t.getSubscriptionType();i&&!B(i)&&e.reportError(`Subscription root type must be Object type if provided, it cannot be ${L(i)}.`,xl(t,ha.SUBSCRIPTION)??i.astNode)}function xl(e,t){return[e.astNode,...e.extensionASTNodes].flatMap(e=>e?.operationTypes??[]).find(e=>e.operation===t)?.type}function Sl(e){for(let t of e.schema.getDirectives()){if(!Fc(t)){e.reportError(`Expected directive but got: ${L(t)}.`,t?.astNode);continue}Cl(e,t),t.locations.length===0&&e.reportError(`Directive @${t.name} must include 1 or more locations.`,t.astNode);for(let n of t.args)Cl(e,n),Ns(n.type)||e.reportError(`The type of @${t.name}(${n.name}:) must be Input Type but got: ${L(n.type)}.`,n.astNode),ac(n)&&n.deprecationReason!=null&&e.reportError(`Required argument @${t.name}(${n.name}:) cannot be deprecated.`,[Il(n.astNode),n.astNode?.type])}}function Cl(e,t){t.name.startsWith(`__`)&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function wl(e){let t=Nl(e),n=e.schema.getTypeMap();for(let r of Object.values(n)){if(!Js(r)){e.reportError(`Expected GraphQL named type but got: ${L(r)}.`,r.astNode);continue}Qc(r)||Cl(e,r),B(r)||Ss(r)?(Tl(e,r),El(e,r)):ws(r)?kl(e,r):Es(r)?Al(e,r):Os(r)&&(jl(e,r),t(r))}}function Tl(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let r of n){Cl(e,r),!Fs(r.type)&&e.reportError(`The type of ${t.name}.${r.name} must be Output Type but got: ${L(r.type)}.`,r.astNode?.type);for(let n of r.args){let i=n.name;Cl(e,n),!Ns(n.type)&&e.reportError(`The type of ${t.name}.${r.name}(${i}:) must be Input Type but got: ${L(n.type)}.`,n.astNode?.type),ac(n)&&n.deprecationReason!=null&&e.reportError(`Required argument ${t.name}.${r.name}(${i}:) cannot be deprecated.`,[Il(n.astNode),n.astNode?.type])}}}function El(e,t){let n=Object.create(null);for(let r of t.getInterfaces()){if(!Ss(r)){e.reportError(`Type ${L(t)} must only implement Interface types, it cannot implement ${L(r)}.`,Pl(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,Pl(t,r));continue}if(n[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,Pl(t,r));continue}n[r.name]=!0,Ol(e,t,r),Dl(e,t,r)}}function Dl(e,t,n){let r=t.getFields();for(let i of Object.values(n.getFields())){let a=i.name,o=r[a];if(!o){e.reportError(`Interface field ${n.name}.${a} expected but ${t.name} does not provide it.`,[i.astNode,t.astNode,...t.extensionASTNodes]);continue}xc(e.schema,o.type,i.type)||e.reportError(`Interface field ${n.name}.${a} expects type ${L(i.type)} but ${t.name}.${a} is type ${L(o.type)}.`,[i.astNode?.type,o.astNode?.type]);for(let r of i.args){let i=r.name,s=o.args.find(e=>e.name===i);if(!s){e.reportError(`Interface field argument ${n.name}.${a}(${i}:) expected but ${t.name}.${a} does not provide it.`,[r.astNode,o.astNode]);continue}bc(r.type,s.type)||e.reportError(`Interface field argument ${n.name}.${a}(${i}:) expects type ${L(r.type)} but ${t.name}.${a}(${i}:) is type ${L(s.type)}.`,[r.astNode?.type,s.astNode?.type])}for(let r of o.args){let o=r.name;!i.args.find(e=>e.name===o)&&ac(r)&&e.reportError(`Object field ${t.name}.${a} includes required argument ${o} that is missing from the Interface field ${n.name}.${a}.`,[r.astNode,i.astNode])}}}function Ol(e,t,n){let r=t.getInterfaces();for(let i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...Pl(n,i),...Pl(t,n)])}function kl(e,t){let n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);let r=Object.create(null);for(let i of n){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,Fl(t,i.name));continue}r[i.name]=!0,B(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${L(i)}.`,Fl(t,String(i)))}}function Al(e,t){let n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(let t of n)Cl(e,t)}function jl(e,t){let n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(let r of n)Cl(e,r),!Ns(r.type)&&e.reportError(`The type of ${t.name}.${r.name} must be Input Type but got: ${L(r.type)}.`,r.astNode?.type),uc(r)&&r.deprecationReason!=null&&e.reportError(`Required input field ${t.name}.${r.name} cannot be deprecated.`,[Il(r.astNode),r.astNode?.type]),t.isOneOf&&Ml(t,r,e)}function Ml(e,t,n){V(t.type)&&n.reportError(`OneOf input field ${e.name}.${t.name} must be nullable.`,t.astNode?.type),t.defaultValue!==void 0&&n.reportError(`OneOf input field ${e.name}.${t.name} cannot have a default value.`,t.astNode)}function Nl(e){let t=Object.create(null),n=[],r=Object.create(null);return i;function i(a){if(t[a.name])return;t[a.name]=!0,r[a.name]=n.length;let o=Object.values(a.getFields());for(let t of o)if(V(t.type)&&Os(t.type.ofType)){let a=t.type.ofType,o=r[a.name];if(n.push(t),o===void 0)i(a);else{let t=n.slice(o),r=t.map(e=>e.name).join(`.`);e.reportError(`Cannot reference Input Object "${a.name}" within itself through a series of non-null fields: "${r}".`,t.map(e=>e.astNode))}n.pop()}r[a.name]=void 0}}function Pl(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n==null?r:[n,...r]).flatMap(e=>e.interfaces??[]).filter(e=>e.name.value===t.name)}function Fl(e,t){let{astNode:n,extensionASTNodes:r}=e;return(n==null?r:[n,...r]).flatMap(e=>e.types??[]).filter(e=>e.name.value===t)}function Il(e){return e?.directives?.find(e=>e.name.value===Hc.name)}var Ll,Rl=n((()=>{lo(),N(),ga(),Cc(),yc(),Kc(),fl(),_l(),Ll=class{constructor(e){this._errors=[],this.schema=e}reportError(e,t){let n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new M(e,{nodes:n}))}getErrors(){return this._errors}}}));function zl(e,t){switch(t.kind){case F.LIST_TYPE:{let n=zl(e,t.type);return n&&new dc(n)}case F.NON_NULL_TYPE:{let n=zl(e,t.type);return n&&new fc(n)}case F.NAMED_TYPE:return e.getType(t.name.value)}}var Bl=n((()=>{va(),yc()}));function Vl(e,t,n){let r=n.name.value;if(r===cl.name&&e.getQueryType()===t)return cl;if(r===ll.name&&e.getQueryType()===t)return ll;if(r===ul.name&&zs(t))return ul;if(B(t)||Ss(t))return t.getFields()[r]}function Hl(e,t){return{enter(...n){let r=n[0];e.enter(r);let i=ts(t,r.kind).enter;if(i){let a=i.apply(t,n);return a!==void 0&&(e.leave(r),ua(a)&&e.enter(a)),a}},leave(...n){let r=n[0],i=ts(t,r.kind).leave,a;return i&&(a=i.apply(t,n)),e.leave(r),a}}}var Ul,Wl=n((()=>{ga(),va(),is(),yc(),fl(),Bl(),Ul=class{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??Vl,t&&(Ns(t)&&this._inputTypeStack.push(t),zs(t)&&this._parentTypeStack.push(t),Fs(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return`TypeInfo`}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){let t=this._schema;switch(e.kind){case F.SELECTION_SET:{let e=Xs(this.getType());this._parentTypeStack.push(zs(e)?e:void 0);break}case F.FIELD:{let n=this.getParentType(),r,i;n&&(r=this._getFieldDef(t,n,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push(Fs(i)?i:void 0);break}case F.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case F.OPERATION_DEFINITION:{let n=t.getRootType(e.operation);this._typeStack.push(B(n)?n:void 0);break}case F.INLINE_FRAGMENT:case F.FRAGMENT_DEFINITION:{let n=e.typeCondition,r=n?zl(t,n):Xs(this.getType());this._typeStack.push(Fs(r)?r:void 0);break}case F.VARIABLE_DEFINITION:{let n=zl(t,e.type);this._inputTypeStack.push(Ns(n)?n:void 0);break}case F.ARGUMENT:{let t,n,r=this.getDirective()??this.getFieldDef();r&&(t=r.args.find(t=>t.name===e.name.value),t&&(n=t.type)),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push(Ns(n)?n:void 0);break}case F.LIST:{let e=qs(this.getInputType()),t=As(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Ns(t)?t:void 0);break}case F.OBJECT_FIELD:{let t=Xs(this.getInputType()),n,r;Os(t)&&(r=t.getFields()[e.name.value],r&&(n=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push(Ns(n)?n:void 0);break}case F.ENUM:{let t=Xs(this.getInputType()),n;Es(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}default:}}leave(e){switch(e.kind){case F.SELECTION_SET:this._parentTypeStack.pop();break;case F.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case F.DIRECTIVE:this._directive=null;break;case F.OPERATION_DEFINITION:case F.INLINE_FRAGMENT:case F.FRAGMENT_DEFINITION:this._typeStack.pop();break;case F.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case F.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case F.LIST:case F.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case F.ENUM:this._enumValue=null;break;default:}}}}));function Gl(e){return Kl(e)||Zl(e)||$l(e)}function Kl(e){return e.kind===F.OPERATION_DEFINITION||e.kind===F.FRAGMENT_DEFINITION}function ql(e){return e.kind===F.FIELD||e.kind===F.FRAGMENT_SPREAD||e.kind===F.INLINE_FRAGMENT}function Jl(e){return e.kind===F.VARIABLE||e.kind===F.INT||e.kind===F.FLOAT||e.kind===F.STRING||e.kind===F.BOOLEAN||e.kind===F.NULL||e.kind===F.ENUM||e.kind===F.LIST||e.kind===F.OBJECT}function Yl(e){return Jl(e)&&(e.kind===F.LIST?e.values.some(Yl):e.kind===F.OBJECT?e.fields.some(e=>Yl(e.value)):e.kind!==F.VARIABLE)}function Xl(e){return e.kind===F.NAMED_TYPE||e.kind===F.LIST_TYPE||e.kind===F.NON_NULL_TYPE}function Zl(e){return e.kind===F.SCHEMA_DEFINITION||Ql(e)||e.kind===F.DIRECTIVE_DEFINITION}function Ql(e){return e.kind===F.SCALAR_TYPE_DEFINITION||e.kind===F.OBJECT_TYPE_DEFINITION||e.kind===F.INTERFACE_TYPE_DEFINITION||e.kind===F.UNION_TYPE_DEFINITION||e.kind===F.ENUM_TYPE_DEFINITION||e.kind===F.INPUT_OBJECT_TYPE_DEFINITION}function $l(e){return e.kind===F.SCHEMA_EXTENSION||eu(e)}function eu(e){return e.kind===F.SCALAR_TYPE_EXTENSION||e.kind===F.OBJECT_TYPE_EXTENSION||e.kind===F.INTERFACE_TYPE_EXTENSION||e.kind===F.UNION_TYPE_EXTENSION||e.kind===F.ENUM_TYPE_EXTENSION||e.kind===F.INPUT_OBJECT_TYPE_EXTENSION}function tu(e){return e.kind===F.TYPE_COORDINATE||e.kind===F.MEMBER_COORDINATE||e.kind===F.ARGUMENT_COORDINATE||e.kind===F.DIRECTIVE_COORDINATE||e.kind===F.DIRECTIVE_ARGUMENT_COORDINATE}var nu=n((()=>{va()}));function ru(e){return{Document(t){for(let n of t.definitions)if(!Kl(n)){let t=n.kind===F.SCHEMA_DEFINITION||n.kind===F.SCHEMA_EXTENSION?`schema`:`"`+n.name.value+`"`;e.reportError(new M(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}}var iu=n((()=>{N(),va(),nu()}));function au(e){return{Field(t){let n=e.getParentType();if(n&&!e.getFieldDef()){let r=e.getSchema(),i=t.name.value,a=Eo(`to use an inline fragment on`,ou(r,n,i));a===``&&(a=Eo(su(n,i))),e.reportError(new M(`Cannot query field "${i}" on type "${n.name}".`+a,{nodes:t}))}}}}function ou(e,t,n){if(!Vs(t))return[];let r=new Set,i=Object.create(null);for(let a of e.getPossibleTypes(t))if(a.getFields()[n]){r.add(a),i[a.name]=1;for(let e of a.getInterfaces())e.getFields()[n]&&(r.add(e),i[e.name]=(i[e.name]??0)+1)}return[...r].sort((t,n)=>{let r=i[n.name]-i[t.name];return r===0?Ss(t)&&e.isSubType(t,n)?-1:Ss(n)&&e.isSubType(n,t)?1:Lo(t.name,n.name):r}).map(e=>e.name)}function su(e,t){return B(e)||Ss(e)?Ho(t,Object.keys(e.getFields())):[]}var cu=n((()=>{Oo(),Vo(),Go(),N(),yc()}));function lu(e){return{InlineFragment(t){let n=t.typeCondition;if(n){let t=zl(e.getSchema(),n);if(t&&!zs(t)){let t=as(n);e.reportError(new M(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){let n=zl(e.getSchema(),t.typeCondition);if(n&&!zs(n)){let n=as(t.typeCondition);e.reportError(new M(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}}var uu=n((()=>{N(),ds(),yc(),Bl()}));function du(e){return{...fu(e),Argument(t){let n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){let n=t.name.value,a=Ho(n,r.args.map(e=>e.name));e.reportError(new M(`Unknown argument "${n}" on field "${i.name}.${r.name}".`+Eo(a),{nodes:t}))}}}}function fu(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Gc;for(let e of r)t[e.name]=e.args.map(e=>e.name);let i=e.getDocument().definitions;for(let e of i)if(e.kind===F.DIRECTIVE_DEFINITION){let n=e.arguments??[];t[e.name.value]=n.map(e=>e.name.value)}return{Directive(n){let r=n.name.value,i=t[r];if(n.arguments&&i)for(let t of n.arguments){let n=t.name.value;if(!i.includes(n)){let a=Ho(n,i);e.reportError(new M(`Unknown argument "${n}" on directive "@${r}".`+Eo(a),{nodes:t}))}}return!1}}}var pu=n((()=>{Oo(),Go(),N(),va(),Kc()}));function mu(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Gc;for(let e of r)t[e.name]=e.locations;let i=e.getDocument().definitions;for(let e of i)e.kind===F.DIRECTIVE_DEFINITION&&(t[e.name.value]=e.locations.map(e=>e.value));return{Directive(n,r,i,a,o){let s=n.name.value,c=t[s];if(!c){e.reportError(new M(`Unknown directive "@${s}".`,{nodes:n}));return}let l=hu(o);l&&!c.includes(l)&&e.reportError(new M(`Directive "@${s}" may not be used on ${l}.`,{nodes:n}))}}}function hu(e){let t=e[e.length-1];switch(`kind`in t||Yi(!1),t.kind){case F.OPERATION_DEFINITION:return gu(t.operation);case F.FIELD:return P.FIELD;case F.FRAGMENT_SPREAD:return P.FRAGMENT_SPREAD;case F.INLINE_FRAGMENT:return P.INLINE_FRAGMENT;case F.FRAGMENT_DEFINITION:return P.FRAGMENT_DEFINITION;case F.VARIABLE_DEFINITION:return P.VARIABLE_DEFINITION;case F.SCHEMA_DEFINITION:case F.SCHEMA_EXTENSION:return P.SCHEMA;case F.SCALAR_TYPE_DEFINITION:case F.SCALAR_TYPE_EXTENSION:return P.SCALAR;case F.OBJECT_TYPE_DEFINITION:case F.OBJECT_TYPE_EXTENSION:return P.OBJECT;case F.FIELD_DEFINITION:return P.FIELD_DEFINITION;case F.INTERFACE_TYPE_DEFINITION:case F.INTERFACE_TYPE_EXTENSION:return P.INTERFACE;case F.UNION_TYPE_DEFINITION:case F.UNION_TYPE_EXTENSION:return P.UNION;case F.ENUM_TYPE_DEFINITION:case F.ENUM_TYPE_EXTENSION:return P.ENUM;case F.ENUM_VALUE_DEFINITION:return P.ENUM_VALUE;case F.INPUT_OBJECT_TYPE_DEFINITION:case F.INPUT_OBJECT_TYPE_EXTENSION:return P.INPUT_OBJECT;case F.INPUT_VALUE_DEFINITION:{let t=e[e.length-3];return`kind`in t||Yi(!1),t.kind===F.INPUT_OBJECT_TYPE_DEFINITION?P.INPUT_FIELD_DEFINITION:P.ARGUMENT_DEFINITION}default:Yi(!1,`Unexpected kind: `+L(t.kind))}}function gu(e){switch(e){case ha.QUERY:return P.QUERY;case ha.MUTATION:return P.MUTATION;case ha.SUBSCRIPTION:return P.SUBSCRIPTION}}var _u=n((()=>{lo(),Xi(),N(),ga(),_a(),va(),Kc()}));function vu(e){return{FragmentSpread(t){let n=t.name.value;e.getFragment(n)||e.reportError(new M(`Unknown fragment "${n}".`,{nodes:t.name}))}}}var yu=n((()=>{N()}));function bu(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(let t of e.getDocument().definitions)Ql(t)&&(r[t.name.value]=!0);let i=[...Object.keys(n),...Object.keys(r)];return{NamedType(t,a,o,s,c){let l=t.name.value;if(!n[l]&&!r[l]){let n=c[2]??o,r=n!=null&&xu(n);if(r&&Su.includes(l))return;let a=Ho(l,r?Su.concat(i):i);e.reportError(new M(`Unknown type "${l}".`+Eo(a),{nodes:t}))}}}}function xu(e){return`kind`in e&&(Zl(e)||$l(e))}var Su,Cu=n((()=>{Oo(),Go(),N(),nu(),fl(),Pc(),Su=[...Nc,...dl].map(e=>e.name)}));function wu(e){let t=0;return{Document(e){t=e.definitions.filter(e=>e.kind===F.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new M(`This anonymous operation must be the only defined operation.`,{nodes:n}))}}}var Tu=n((()=>{N(),va()}));function Eu(e){let t=e.getSchema(),n=t?.astNode??t?.getQueryType()??t?.getMutationType()??t?.getSubscriptionType(),r=0;return{SchemaDefinition(t){if(n){e.reportError(new M(`Cannot define a new schema within a schema extension.`,{nodes:t}));return}r>0&&e.reportError(new M(`Must provide only one schema definition.`,{nodes:t})),++r}}}var Du=n((()=>{N()}));function Ou(e){function t(n,r=Object.create(null),i=0){if(n.kind===F.FRAGMENT_SPREAD){let a=n.name.value;if(r[a]===!0)return!1;let o=e.getFragment(a);if(!o)return!1;try{return r[a]=!0,t(o,r,i)}finally{r[a]=void 0}}if(n.kind===F.FIELD&&(n.name.value===`fields`||n.name.value===`interfaces`||n.name.value===`possibleTypes`||n.name.value===`inputFields`)&&(i++,i>=ku))return!0;if(`selectionSet`in n&&n.selectionSet){for(let e of n.selectionSet.selections)if(t(e,r,i))return!0}return!1}return{Field(n){if((n.name.value===`__schema`||n.name.value===`__type`)&&t(n))return e.reportError(new M(`Maximum introspection depth exceeded`,{nodes:[n]})),!1}}}var ku,Au=n((()=>{N(),va(),ku=3}));function ju(e){let t=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(e){return i(e),!1}};function i(a){if(t[a.name.value])return;let o=a.name.value;t[o]=!0;let s=e.getFragmentSpreads(a.selectionSet);if(s.length!==0){r[o]=n.length;for(let t of s){let a=t.name.value,o=r[a];if(n.push(t),o===void 0){let t=e.getFragment(a);t&&i(t)}else{let t=n.slice(o),r=t.slice(0,-1).map(e=>`"`+e.name.value+`"`).join(`, `);e.reportError(new M(`Cannot spread fragment "${a}" within itself`+(r===``?`.`:` via ${r}.`),{nodes:t}))}n.pop()}r[o]=void 0}}}var Mu=n((()=>{N()}));function Nu(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:i}of r){let r=i.name.value;t[r]!==!0&&e.reportError(new M(n.name?`Variable "$${r}" is not defined by operation "${n.name.value}".`:`Variable "$${r}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}}var Pu=n((()=>{N()}));function Fu(e){let t=[],n=[];return{OperationDefinition(e){return t.push(e),!1},FragmentDefinition(e){return n.push(e),!1},Document:{leave(){let r=Object.create(null);for(let n of t)for(let t of e.getRecursivelyReferencedFragments(n))r[t.name.value]=!0;for(let t of n){let n=t.name.value;r[n]!==!0&&e.reportError(new M(`Fragment "${n}" is never used.`,{nodes:t}))}}}}}var Iu=n((()=>{N()}));function Lu(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){let r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(let{node:e}of i)r[e.name.value]=!0;for(let i of t){let t=i.variable.name.value;r[t]!==!0&&e.reportError(new M(n.name?`Variable "$${t}" is never used in operation "${n.name.value}".`:`Variable "$${t}" is never used.`,{nodes:i}))}}},VariableDefinition(e){t.push(e)}}}var Ru=n((()=>{N()}));function zu(e){switch(e.kind){case F.OBJECT:return{...e,fields:Bu(e.fields)};case F.LIST:return{...e,values:e.values.map(zu)};case F.INT:case F.FLOAT:case F.STRING:case F.BOOLEAN:case F.NULL:case F.ENUM:case F.VARIABLE:return e}}function Bu(e){return e.map(e=>({...e,value:zu(e.value)})).sort((e,t)=>Lo(e.name.value,t.name.value))}var Vu=n((()=>{Vo(),va()}));function Hu(e){return Array.isArray(e)?e.map(([e,t])=>`subfields "${e}" conflict because `+Hu(t)).join(` and `):e}function Uu(e){let t=new id,n=new ad,r=new Map;return{SelectionSet(i){let a=Wu(e,r,t,n,e.getParentType(),i);for(let[[t,n],r,i]of a){let a=Hu(n);e.reportError(new M(`Fields "${t}" conflict because ${a}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:r.concat(i)}))}}}}function Wu(e,t,n,r,i,a){let o=[],[s,c]=ed(e,t,i,a);if(Ju(e,o,t,n,r,s),c.length!==0)for(let i=0;i<c.length;i++){Gu(e,o,t,n,r,!1,s,c[i]);for(let a=i+1;a<c.length;a++)Ku(e,o,t,n,r,!1,c[i],c[a])}return o}function Gu(e,t,n,r,i,a,o,s){if(r.has(o,s,a))return;r.add(o,s,a);let c=e.getFragment(s);if(!c)return;let[l,u]=td(e,n,c);if(o!==l){Yu(e,t,n,r,i,a,o,l);for(let s of u)Gu(e,t,n,r,i,a,o,s)}}function Ku(e,t,n,r,i,a,o,s){if(o===s||i.has(o,s,a))return;i.add(o,s,a);let c=e.getFragment(o),l=e.getFragment(s);if(!c||!l)return;let[u,d]=td(e,n,c),[f,p]=td(e,n,l);Yu(e,t,n,r,i,a,u,f);for(let s of p)Ku(e,t,n,r,i,a,o,s);for(let o of d)Ku(e,t,n,r,i,a,o,s)}function qu(e,t,n,r,i,a,o,s,c){let l=[],[u,d]=ed(e,t,a,o),[f,p]=ed(e,t,s,c);Yu(e,l,t,n,r,i,u,f);for(let a of p)Gu(e,l,t,n,r,i,u,a);for(let a of d)Gu(e,l,t,n,r,i,f,a);for(let a of d)for(let o of p)Ku(e,l,t,n,r,i,a,o);return l}function Ju(e,t,n,r,i,a){for(let[o,s]of Object.entries(a))if(s.length>1)for(let a=0;a<s.length;a++)for(let c=a+1;c<s.length;c++){let l=Xu(e,n,r,i,!1,o,s[a],s[c]);l&&t.push(l)}}function Yu(e,t,n,r,i,a,o,s){for(let[c,l]of Object.entries(o)){let o=s[c];if(o)for(let s of l)for(let l of o){let o=Xu(e,n,r,i,a,c,s,l);o&&t.push(o)}}}function Xu(e,t,n,r,i,a,o,s){let[c,l,u]=o,[d,f,p]=s,m=i||c!==d&&B(c)&&B(d);if(!m){let e=l.name.value,t=f.name.value;if(e!==t)return[[a,`"${e}" and "${t}" are different fields`],[l],[f]];if(!Zu(l,f))return[[a,`they have differing arguments`],[l],[f]]}let h=u?.type,g=p?.type;if(h&&g&&$u(h,g))return[[a,`they return conflicting types "${L(h)}" and "${L(g)}"`],[l],[f]];let _=l.selectionSet,v=f.selectionSet;if(_&&v)return rd(qu(e,t,n,r,m,Xs(h),_,Xs(g),v),a,l,f)}function Zu(e,t){let n=e.arguments,r=t.arguments;if(n===void 0||n.length===0)return r===void 0||r.length===0;if(r===void 0||r.length===0||n.length!==r.length)return!1;let i=new Map(r.map(({name:e,value:t})=>[e.value,t]));return n.every(e=>{let t=e.value,n=i.get(e.name.value);return n===void 0?!1:Qu(t)===Qu(n)})}function Qu(e){return as(zu(e))}function $u(e,t){return As(e)?As(t)?$u(e.ofType,t.ofType):!0:As(t)?!0:V(e)?V(t)?$u(e.ofType,t.ofType):!0:V(t)?!0:Ls(e)||Ls(t)?e!==t:!1}function ed(e,t,n,r){let i=t.get(r);if(i)return i;let a=Object.create(null),o=Object.create(null);nd(e,n,r,a,o);let s=[a,Object.keys(o)];return t.set(r,s),s}function td(e,t,n){return t.get(n.selectionSet)||ed(e,t,zl(e.getSchema(),n.typeCondition),n.selectionSet)}function nd(e,t,n,r,i){for(let a of n.selections)switch(a.kind){case F.FIELD:{let e=a.name.value,n;(B(t)||Ss(t))&&(n=t.getFields()[e]);let i=a.alias?a.alias.value:e;r[i]||(r[i]=[]),r[i].push([t,a,n]);break}case F.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case F.INLINE_FRAGMENT:{let n=a.typeCondition;nd(e,n?zl(e.getSchema(),n):t,a.selectionSet,r,i);break}}}function rd(e,t,n,r){if(e.length>0)return[[t,e.map(([e])=>e)],[n,...e.map(([,e])=>e).flat()],[r,...e.map(([,,e])=>e).flat()]]}var id,ad,od=n((()=>{lo(),N(),va(),ds(),yc(),Vu(),Bl(),id=class{constructor(){this._data=new Map}has(e,t,n){let r=this._data.get(e)?.get(t);return r===void 0?!1:n?!0:n===r}add(e,t,n){let r=this._data.get(e);r===void 0?this._data.set(e,new Map([[t,n]])):r.set(t,n)}},ad=class{constructor(){this._orderedPairSet=new id}has(e,t,n){return e<t?this._orderedPairSet.has(e,t,n):this._orderedPairSet.has(t,e,n)}add(e,t,n){e<t?this._orderedPairSet.add(e,t,n):this._orderedPairSet.add(t,e,n)}}}));function sd(e){return{InlineFragment(t){let n=e.getType(),r=e.getParentType();if(zs(n)&&zs(r)&&!Sc(e.getSchema(),n,r)){let i=L(r),a=L(n);e.reportError(new M(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${a}".`,{nodes:t}))}},FragmentSpread(t){let n=t.name.value,r=cd(e,n),i=e.getParentType();if(r&&i&&!Sc(e.getSchema(),r,i)){let a=L(i),o=L(r);e.reportError(new M(`Fragment "${n}" cannot be spread here as objects of type "${a}" can never be of type "${o}".`,{nodes:t}))}}}}function cd(e,t){let n=e.getFragment(t);if(n){let t=zl(e.getSchema(),n.typeCondition);if(zs(t))return t}}var ld=n((()=>{lo(),N(),yc(),Cc(),Bl()}));function ud(e){let t=e.getSchema(),n=Object.create(null);for(let t of e.getDocument().definitions)Ql(t)&&(n[t.name.value]=t);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(r){let i=r.name.value,a=n[i],o=t?.getType(i),s;if(a?s=pd[a.kind]:o&&(s=dd(o)),s){if(s!==r.kind){let t=fd(r.kind);e.reportError(new M(`Cannot extend non-${t} type "${i}".`,{nodes:a?[a,r]:r}))}}else{let a=Ho(i,Object.keys({...n,...t?.getTypeMap()}));e.reportError(new M(`Cannot extend type "${i}" because it is not defined.`+Eo(a),{nodes:r.name}))}}}function dd(e){if(ys(e))return F.SCALAR_TYPE_EXTENSION;if(B(e))return F.OBJECT_TYPE_EXTENSION;if(Ss(e))return F.INTERFACE_TYPE_EXTENSION;if(ws(e))return F.UNION_TYPE_EXTENSION;if(Es(e))return F.ENUM_TYPE_EXTENSION;if(Os(e))return F.INPUT_OBJECT_TYPE_EXTENSION;Yi(!1,`Unexpected type: `+L(e))}function fd(e){switch(e){case F.SCALAR_TYPE_EXTENSION:return`scalar`;case F.OBJECT_TYPE_EXTENSION:return`object`;case F.INTERFACE_TYPE_EXTENSION:return`interface`;case F.UNION_TYPE_EXTENSION:return`union`;case F.ENUM_TYPE_EXTENSION:return`enum`;case F.INPUT_OBJECT_TYPE_EXTENSION:return`input object`;default:Yi(!1,`Unexpected kind: `+L(e))}}var pd,md=n((()=>{Oo(),lo(),Xi(),Go(),N(),va(),nu(),yc(),pd={[F.SCALAR_TYPE_DEFINITION]:F.SCALAR_TYPE_EXTENSION,[F.OBJECT_TYPE_DEFINITION]:F.OBJECT_TYPE_EXTENSION,[F.INTERFACE_TYPE_DEFINITION]:F.INTERFACE_TYPE_EXTENSION,[F.UNION_TYPE_DEFINITION]:F.UNION_TYPE_EXTENSION,[F.ENUM_TYPE_DEFINITION]:F.ENUM_TYPE_EXTENSION,[F.INPUT_OBJECT_TYPE_DEFINITION]:F.INPUT_OBJECT_TYPE_EXTENSION}}));function hd(e){return{...gd(e),Field:{leave(t){let n=e.getFieldDef();if(!n)return!1;let r=new Set(t.arguments?.map(e=>e.name.value));for(let i of n.args)if(!r.has(i.name)&&ac(i)){let r=L(i.type);e.reportError(new M(`Field "${n.name}" argument "${i.name}" of type "${r}" is required, but it was not provided.`,{nodes:t}))}}}}}function gd(e){let t=Object.create(null),n=e.getSchema()?.getDirectives()??Gc;for(let e of n)t[e.name]=jo(e.args.filter(ac),e=>e.name);let r=e.getDocument().definitions;for(let e of r)if(e.kind===F.DIRECTIVE_DEFINITION){let n=e.arguments??[];t[e.name.value]=jo(n.filter(_d),e=>e.name.value)}return{Directive:{leave(n){let r=n.name.value,i=t[r];if(i){let t=n.arguments??[],a=new Set(t.map(e=>e.name.value));for(let[t,o]of Object.entries(i))if(!a.has(t)){let i=_s(o.type)?L(o.type):as(o.type);e.reportError(new M(`Directive "@${r}" argument "${t}" of type "${i}" is required, but it was not provided.`,{nodes:n}))}}}}}}function _d(e){return e.type.kind===F.NON_NULL_TYPE&&e.defaultValue==null}var vd=n((()=>{lo(),Mo(),N(),va(),ds(),yc(),Kc()}));function yd(e){return{Field(t){let n=e.getType(),r=t.selectionSet;if(n){if(Ls(Xs(n))){if(r){let i=t.name.value,a=L(n);e.reportError(new M(`Field "${i}" must not have a selection since type "${a}" has no subfields.`,{nodes:r}))}}else if(!r){let r=t.name.value,i=L(n);e.reportError(new M(`Field "${r}" of type "${i}" must have a selection of subfields. Did you mean "${r} { ... }"?`,{nodes:t}))}else if(r.selections.length===0){let r=t.name.value,i=L(n);e.reportError(new M(`Field "${r}" of type "${i}" must have at least one field selected.`,{nodes:t}))}}}}}var bd=n((()=>{lo(),N(),yc()}));function xd(e){return e.map(e=>typeof e==`number`?`[`+e.toString()+`]`:`.`+e).join(``)}var Sd=n((()=>{}));function Cd(e,t,n){return{prev:e,key:t,typename:n}}function wd(e){let t=[],n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}var Td=n((()=>{}));function Ed(e,t,n=Dd){return Od(e,t,n,void 0)}function Dd(e,t,n){let r=`Invalid value `+L(t);throw e.length>0&&(r+=` at "value${xd(e)}"`),n.message=r+`: `+n.message,n}function Od(e,t,n,r){if(V(t)){if(e!=null)return Od(e,t.ofType,n,r);n(wd(r),e,new M(`Expected non-nullable type "${L(t)}" not to be null.`));return}if(e==null)return null;if(As(t)){let i=t.ofType;return qc(e)?Array.from(e,(e,t)=>Od(e,i,n,Cd(r,t,void 0))):[Od(e,i,n,r)]}if(Os(t)){if(!qi(e)||Array.isArray(e)){n(wd(r),e,new M(`Expected type "${t.name}" to be an object.`));return}let i=Object.create(null),a=t.getFields();for(let o of Object.values(a)){let a=e[o.name];if(a===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(V(o.type)){let t=L(o.type);n(wd(r),e,new M(`Field "${o.name}" of required type "${t}" was not provided.`))}continue}i[o.name]=Od(a,o.type,n,Cd(r,o.name,t.name))}for(let i of Object.keys(e))if(!a[i]){let a=Ho(i,Object.keys(t.getFields()));n(wd(r),e,new M(`Field "${i}" is not defined by type "${t.name}".`+Eo(a)))}if(t.isOneOf){let a=Object.keys(i);a.length!==1&&n(wd(r),e,new M(`Exactly one key must be specified for OneOf type "${t.name}".`));let o=a[0],s=i[o];s===null&&n(wd(r).concat(o),s,new M(`Field "${o}" must be non-null.`))}return{...i}}if(Ls(t)){let i;try{i=t.parseValue(e)}catch(i){i instanceof M?n(wd(r),e,i):n(wd(r),e,new M(`Expected type "${t.name}". `+i.message,{originalError:i}));return}return i===void 0&&n(wd(r),e,new M(`Expected type "${t.name}".`)),i}Yi(!1,`Unexpected input type: `+L(t))}var kd=n((()=>{Oo(),lo(),Xi(),Jc(),Ji(),Td(),Sd(),Go(),N(),yc()}));function Ad(e,t,n){if(e){if(e.kind===F.VARIABLE){let r=e.name.value;if(n==null||n[r]===void 0)return;let i=n[r];return i===null&&V(t)?void 0:i}if(V(t))return e.kind===F.NULL?void 0:Ad(e,t.ofType,n);if(e.kind===F.NULL)return null;if(As(t)){let r=t.ofType;if(e.kind===F.LIST){let t=[];for(let i of e.values)if(jd(i,n)){if(V(r))return;t.push(null)}else{let e=Ad(i,r,n);if(e===void 0)return;t.push(e)}return t}let i=Ad(e,r,n);return i===void 0?void 0:[i]}if(Os(t)){if(e.kind!==F.OBJECT)return;let r=Object.create(null),i=jo(e.fields,e=>e.name.value);for(let e of Object.values(t.getFields())){let t=i[e.name];if(!t||jd(t.value,n)){if(e.defaultValue!==void 0)r[e.name]=e.defaultValue;else if(V(e.type))return;continue}let a=Ad(t.value,e.type,n);if(a===void 0)return;r[e.name]=a}if(t.isOneOf){let e=Object.keys(r);if(e.length!==1||r[e[0]]===null)return}return r}if(Ls(t)){let r;try{r=t.parseLiteral(e,n)}catch{return}return r===void 0?void 0:r}Yi(!1,`Unexpected input type: `+L(t))}}function jd(e,t){return e.kind===F.VARIABLE&&(t==null||t[e.name.value]===void 0)}var Md=n((()=>{lo(),Xi(),Mo(),va(),yc()}));function Nd(e,t,n,r){let i=[],a=r?.maxErrors;try{let r=Pd(e,t,n,e=>{if(a!=null&&i.length>=a)throw new M(`Too many errors processing variables, error limit reached. Execution aborted.`);i.push(e)});if(i.length===0)return{coerced:r}}catch(e){i.push(e)}return{errors:i}}function Pd(e,t,n,r){let i=Object.create(null);for(let a of t){let t=a.variable.name.value,o=zl(e,a.type);if(!Ns(o)){r(new M(`Variable "$${t}" expected value of type "${as(a.type)}" which cannot be used as an input type.`,{nodes:a.type}));continue}if(!Ld(n,t)){a.defaultValue?i[t]=Ad(a.defaultValue,o):V(o)&&r(new M(`Variable "$${t}" of required type "${L(o)}" was not provided.`,{nodes:a}));continue}let s=n[t];if(s===null&&V(o)){r(new M(`Variable "$${t}" of non-null type "${L(o)}" must not be null.`,{nodes:a}));continue}i[t]=Ed(s,o,(e,n,i)=>{let o=`Variable "$${t}" got invalid value `+L(n);e.length>0&&(o+=` at "${t}${xd(e)}"`),r(new M(o+`; `+i.message,{nodes:a,originalError:i}))})}return{...i}}function Fd(e,t,n){let r=Object.create(null),i=jo(t.arguments??[],e=>e.name.value);for(let a of e.args){let e=a.name,o=a.type,s=i[e];if(!s){if(a.defaultValue!==void 0)r[e]=a.defaultValue;else if(V(o))throw new M(`Argument "${e}" of required type "${L(o)}" was not provided.`,{nodes:t});continue}let c=s.value,l=c.kind===F.NULL;if(c.kind===F.VARIABLE){let t=c.name.value;if(n==null||!Ld(n,t)){if(a.defaultValue!==void 0)r[e]=a.defaultValue;else if(V(o))throw new M(`Argument "${e}" of required type "${L(o)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:c});continue}l=n[t]==null}if(l&&V(o))throw new M(`Argument "${e}" of non-null type "${L(o)}" must not be null.`,{nodes:c});let u=Ad(c,o,n);if(u===void 0)throw new M(`Argument "${e}" has invalid value ${as(c)}.`,{nodes:c});r[e]=u}return{...r}}function Id(e,t,n){let r=t.directives?.find(t=>t.name.value===e.name);if(r)return Fd(e,r,n)}function Ld(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Rd=n((()=>{lo(),Mo(),Sd(),N(),va(),ds(),yc(),kd(),Bl(),Md()}));function zd(e,t,n,r,i){let a=new Map;return Vd(e,t,n,r,i,a,new Set),a}function Bd(e,t,n,r,i){let a=new Map,o=new Set;for(let s of i)s.selectionSet&&Vd(e,t,n,r,s.selectionSet,a,o);return a}function Vd(e,t,n,r,i,a,o){for(let s of i.selections)switch(s.kind){case F.FIELD:{if(!Hd(n,s))continue;let e=Wd(s),t=a.get(e);t===void 0?a.set(e,[s]):t.push(s);break}case F.INLINE_FRAGMENT:if(!Hd(n,s)||!Ud(e,s,r))continue;Vd(e,t,n,r,s.selectionSet,a,o);break;case F.FRAGMENT_SPREAD:{let i=s.name.value;if(o.has(i)||!Hd(n,s))continue;o.add(i);let c=t[i];if(!c||!Ud(e,c,r))continue;Vd(e,t,n,r,c.selectionSet,a,o);break}}}function Hd(e,t){return Id(Bc,t,e)?.if===!0?!1:Id(zc,t,e)?.if!==!1}function Ud(e,t,n){let r=t.typeCondition;if(!r)return!0;let i=zl(e,r);return i===n?!0:Vs(i)?e.isSubType(i,n):!1}function Wd(e){return e.alias?e.alias.value:e.name.value}var Gd=n((()=>{va(),yc(),Kc(),Bl(),Rd()}));function Kd(e){return{OperationDefinition(t){if(t.operation===`subscription`){let n=e.getSchema(),r=n.getSubscriptionType();if(r){let i=t.name?t.name.value:null,a=Object.create(null),o=e.getDocument(),s=Object.create(null);for(let e of o.definitions)e.kind===F.FRAGMENT_DEFINITION&&(s[e.name.value]=e);let c=zd(n,s,a,r,t.selectionSet);if(c.size>1){let t=[...c.values()].slice(1).flat();e.reportError(new M(i==null?`Anonymous Subscription must select only one top level field.`:`Subscription "${i}" must select only one top level field.`,{nodes:t}))}for(let t of c.values())t[0].name.value.startsWith(`__`)&&e.reportError(new M(i==null?`Anonymous Subscription must not select an introspection top level field.`:`Subscription "${i}" must not select an introspection top level field.`,{nodes:t}))}}}}}var qd=n((()=>{N(),va(),Gd()}));function Jd(e,t){let n=new Map;for(let r of e){let e=t(r),i=n.get(e);i===void 0?n.set(e,[r]):i.push(r)}return n}var Yd=n((()=>{}));function Xd(e){return{DirectiveDefinition(e){let t=e.arguments??[];return n(`@${e.name.value}`,t)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){let t=e.name.value,r=e.fields??[];for(let e of r){let r=e.name.value,i=e.arguments??[];n(`${t}.${r}`,i)}return!1}function n(t,n){let r=Jd(n,e=>e.name.value);for(let[n,i]of r)i.length>1&&e.reportError(new M(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:i.map(e=>e.name)}));return!1}}var Zd=n((()=>{Yd(),N()}));function Qd(e){return{Field:t,Directive:t};function t(t){let n=Jd(t.arguments??[],e=>e.name.value);for(let[t,r]of n)r.length>1&&e.reportError(new M(`There can be only one argument named "${t}".`,{nodes:r.map(e=>e.name)}))}}var $d=n((()=>{Yd(),N()}));function ef(e){let t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){let i=r.name.value;if(n!=null&&n.getDirective(i)){e.reportError(new M(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return t[i]?e.reportError(new M(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}}var tf=n((()=>{N()}));function nf(e){let t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():Gc;for(let e of r)t[e.name]=!e.isRepeatable;let i=e.getDocument().definitions;for(let e of i)e.kind===F.DIRECTIVE_DEFINITION&&(t[e.name.value]=!e.repeatable);let a=Object.create(null),o=Object.create(null);return{enter(n){if(!(`directives`in n)||!n.directives)return;let r;if(n.kind===F.SCHEMA_DEFINITION||n.kind===F.SCHEMA_EXTENSION)r=a;else if(Ql(n)||eu(n)){let e=n.name.value;r=o[e],r===void 0&&(o[e]=r=Object.create(null))}else r=Object.create(null);for(let i of n.directives){let n=i.name.value;t[n]&&(r[n]?e.reportError(new M(`The directive "@${n}" can only be used once at this location.`,{nodes:[r[n],i]})):r[n]=i)}}}}var rf=n((()=>{N(),va(),nu(),Kc()}));function af(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(t){let i=t.name.value;r[i]||(r[i]=Object.create(null));let a=t.values??[],o=r[i];for(let t of a){let r=t.name.value,a=n[i];Es(a)&&a.getValue(r)?e.reportError(new M(`Enum value "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):o[r]?e.reportError(new M(`Enum value "${i}.${r}" can only be defined once.`,{nodes:[o[r],t.name]})):o[r]=t.name}return!1}}var of=n((()=>{N(),yc()}));function sf(e){let t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(t){let i=t.name.value;r[i]||(r[i]=Object.create(null));let a=t.fields??[],o=r[i];for(let t of a){let r=t.name.value;cf(n[i],r)?e.reportError(new M(`Field "${i}.${r}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):o[r]?e.reportError(new M(`Field "${i}.${r}" can only be defined once.`,{nodes:[o[r],t.name]})):o[r]=t.name}return!1}}function cf(e,t){return B(e)||Ss(e)||Os(e)?e.getFields()[t]!=null:!1}var lf=n((()=>{N(),yc()}));function uf(e){let t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){let r=n.name.value;return t[r]?e.reportError(new M(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}}var df=n((()=>{N()}));function ff(e){let t=[],n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){let e=t.pop();e||Yi(!1),n=e}},ObjectField(t){let r=t.name.value;n[r]?e.reportError(new M(`There can be only one input field named "${r}".`,{nodes:[n[r],t.name]})):n[r]=t.name}}}var pf=n((()=>{Xi(),N()}));function mf(e){let t=Object.create(null);return{OperationDefinition(n){let r=n.name;return r&&(t[r.value]?e.reportError(new M(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}var hf=n((()=>{N()}));function gf(e){let t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(t){let i=t.operationTypes??[];for(let t of i){let i=t.operation,a=n[i];r[i]?e.reportError(new M(`Type for ${i} already defined in the schema. It cannot be redefined.`,{nodes:t})):a?e.reportError(new M(`There can be only one ${i} type in schema.`,{nodes:[a,t]})):n[i]=t}return!1}}var _f=n((()=>{N()}));function vf(e){let t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(r){let i=r.name.value;if(n!=null&&n.getType(i)){e.reportError(new M(`Type "${i}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:r.name}));return}return t[i]?e.reportError(new M(`There can be only one type named "${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}var yf=n((()=>{N()}));function bf(e){return{OperationDefinition(t){let n=Jd(t.variableDefinitions??[],e=>e.variable.name.value);for(let[t,r]of n)r.length>1&&e.reportError(new M(`There can be only one variable named "$${t}".`,{nodes:r.map(e=>e.variable.name)}))}}}var xf=n((()=>{Yd(),N()}));function Sf(e){return{ListValue(t){if(!As(qs(e.getParentInputType())))return Cf(e,t),!1},ObjectValue(t){let n=Xs(e.getInputType());if(!Os(n))return Cf(e,t),!1;let r=jo(t.fields,e=>e.name.value);for(let i of Object.values(n.getFields()))if(!r[i.name]&&uc(i)){let r=L(i.type);e.reportError(new M(`Field "${n.name}.${i.name}" of required type "${r}" was not provided.`,{nodes:t}))}n.isOneOf&&wf(e,t,n,r)},ObjectField(t){let n=Xs(e.getParentInputType());if(!e.getInputType()&&Os(n)){let r=Ho(t.name.value,Object.keys(n.getFields()));e.reportError(new M(`Field "${t.name.value}" is not defined by type "${n.name}".`+Eo(r),{nodes:t}))}},NullValue(t){let n=e.getInputType();V(n)&&e.reportError(new M(`Expected value of type "${L(n)}", found ${as(t)}.`,{nodes:t}))},EnumValue:t=>Cf(e,t),IntValue:t=>Cf(e,t),FloatValue:t=>Cf(e,t),StringValue:t=>Cf(e,t),BooleanValue:t=>Cf(e,t)}}function Cf(e,t){let n=e.getInputType();if(!n)return;let r=Xs(n);if(!Ls(r)){let r=L(n);e.reportError(new M(`Expected value of type "${r}", found ${as(t)}.`,{nodes:t}));return}try{if(r.parseLiteral(t,void 0)===void 0){let r=L(n);e.reportError(new M(`Expected value of type "${r}", found ${as(t)}.`,{nodes:t}))}}catch(r){let i=L(n);r instanceof M?e.reportError(r):e.reportError(new M(`Expected value of type "${i}", found ${as(t)}; `+r.message,{nodes:t,originalError:r}))}}function wf(e,t,n,r){let i=Object.keys(r);if(i.length!==1){e.reportError(new M(`OneOf Input Object "${n.name}" must specify exactly one key.`,{nodes:[t]}));return}let a=r[i[0]]?.value;(!a||a.kind===F.NULL)&&e.reportError(new M(`Field "${n.name}.${i[0]}" must be non-null.`,{nodes:[t]}))}var Tf=n((()=>{Oo(),lo(),Mo(),Go(),N(),va(),ds(),yc()}));function Ef(e){return{VariableDefinition(t){let n=zl(e.getSchema(),t.type);if(n!==void 0&&!Ns(n)){let n=t.variable.name.value,r=as(t.type);e.reportError(new M(`Variable "$${n}" cannot be non-input type "${r}".`,{nodes:t.type}))}}}}var Df=n((()=>{N(),ds(),yc(),Bl()}));function Of(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){let r=e.getRecursiveVariableUsages(n);for(let{node:n,type:i,defaultValue:a,parentType:o}of r){let r=n.name.value,s=t[r];if(s&&i){let t=e.getSchema(),c=zl(t,s.type);if(c&&!kf(t,c,s.defaultValue,i,a)){let t=L(c),a=L(i);e.reportError(new M(`Variable "$${r}" of type "${t}" used in position expecting type "${a}".`,{nodes:[s,n]}))}Os(o)&&o.isOneOf&&Gs(c)&&e.reportError(new M(`Variable "$${r}" is of type "${c}" but must be non-nullable to be used for OneOf Input Object "${o}".`,{nodes:[s,n]}))}}}},VariableDefinition(e){t[e.variable.name.value]=e}}}function kf(e,t,n,r,i){if(V(r)&&!V(t)){if(!(n!=null&&n.kind!==F.NULL)&&i===void 0)return!1;let a=r.ofType;return xc(e,t,a)}return xc(e,t,r)}var Af=n((()=>{lo(),N(),va(),yc(),Cc(),Bl()})),jf,Mf,Nf,Pf=n((()=>{iu(),cu(),uu(),pu(),_u(),yu(),Cu(),Tu(),Du(),Au(),Mu(),Pu(),Iu(),Ru(),od(),ld(),md(),vd(),bd(),qd(),Zd(),$d(),tf(),rf(),of(),lf(),df(),pf(),hf(),_f(),yf(),xf(),Tf(),Df(),Af(),jf=Object.freeze([Ou]),Mf=Object.freeze([ru,mf,wu,Kd,bu,lu,Ef,yd,au,uf,vu,Fu,sd,ju,bf,Nu,Lu,mu,nf,du,Qd,Sf,hd,Of,Uu,ff,...jf]),Nf=Object.freeze([Eu,gf,vf,af,sf,Xd,ef,bu,mu,nf,ud,fu,Qd,ff,gd])})),Ff,If,Lf,Rf=n((()=>{va(),is(),Wl(),Ff=class{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return`ASTValidationContext`}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(let e of this.getDocument().definitions)e.kind===F.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];let n=[e],r;for(;r=n.pop();)for(let e of r.selections)e.kind===F.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];let n=Object.create(null),r=[e.selectionSet],i;for(;i=r.pop();)for(let e of this.getFragmentSpreads(i)){let i=e.name.value;if(n[i]!==!0){n[i]=!0;let e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}},If=class extends Ff{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return`SDLValidationContext`}getSchema(){return this._schema}},Lf=class extends Ff{constructor(e,t,n,r){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return`ValidationContext`}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){let n=[],r=new Ul(this._schema);$o(e,Hl(r,{VariableDefinition:()=>!1,Variable(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue(),parentType:r.getParentInputType()})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(let n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}}));function zf(e,t,n=Mf,r,i=new Ul(e)){let a=r?.maxErrors??100;t||Ui(!1,`Must provide document.`),yl(e);let o=Object.freeze({}),s=[],c=new Lf(e,t,i,e=>{if(s.length>=a)throw s.push(new M(`Too many validation errors, error limit reached. Validation aborted.`)),o;s.push(e)}),l=es(n.map(e=>e(c)));try{$o(t,Hl(i,l),Uf)}catch(e){if(e!==o)throw e}return s}function Bf(e,t,n=Nf){let r=[],i=new If(e,t,e=>{r.push(e)});return $o(e,es(n.map(e=>e(i)))),r}function Vf(e){let t=Bf(e);if(t.length!==0)throw Error(t.map(e=>e.message).join(` + +`))}function Hf(e,t){let n=Bf(e,t);if(n.length!==0)throw Error(n.map(e=>e.message).join(` + +`))}var Uf,Wf=n((()=>{Wi(),Io(),N(),ga(),is(),Rl(),Wl(),Pf(),Rf(),Uf=Fo(pa,e=>e.filter(e=>e!==`description`))}));function Gf(e){let t;return function(n,r,i){t===void 0&&(t=new WeakMap);let a=t.get(n);a===void 0&&(a=new WeakMap,t.set(n,a));let o=a.get(r);o===void 0&&(o=new WeakMap,a.set(r,o));let s=o.get(i);return s===void 0&&(s=e(n,r,i),o.set(i,s)),s}}var Kf=n((()=>{}));function qf(e){return Promise.all(Object.values(e)).then(t=>{let n=Object.create(null);for(let[r,i]of Object.keys(e).entries())n[i]=t[r];return n})}var Jf=n((()=>{}));function Yf(e,t,n){let r=n;for(let n of e)r=Gi(r)?r.then(e=>t(e,n)):t(r,n);return r}var Xf=n((()=>{Ki()}));function Zf(e){return e instanceof Error?e:new Qf(e)}var Qf,$f=n((()=>{lo(),Qf=class extends Error{constructor(e){super(`Unexpected error value: `+L(e)),this.name=`NonErrorThrown`,this.thrownValue=e}}}));function ep(e,t,n){let r=Zf(e);return tp(r)?r:new M(r.message,{nodes:r.nodes??t,source:r.source,positions:r.positions,path:n,originalError:r})}function tp(e){return Array.isArray(e.path)}var np=n((()=>{$f(),N()}));function rp(e){arguments.length<2||Ui(!1,`graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.`);let{schema:t,document:n,variableValues:r,rootValue:i}=e;op(t,n,r);let a=sp(e);if(!(`schema`in a))return{errors:a};try{let{operation:e}=a,t=cp(a,e,i);return Gi(t)?t.then(e=>ap(e,a.collectedErrors.errors),e=>(a.collectedErrors.add(e,void 0),ap(null,a.collectedErrors.errors))):ap(t,a.collectedErrors.errors)}catch(e){return a.collectedErrors.add(e,void 0),ap(null,a.collectedErrors.errors)}}function ip(e){let t=rp(e);if(Gi(t))throw Error(`GraphQL execution failed to complete synchronously.`);return t}function ap(e,t){return t.length===0?{data:e}:{errors:t,data:e}}function op(e,t,n){t||Ui(!1,`Must provide document.`),yl(e),n==null||qi(n)||Ui(!1,`Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.`)}function sp(e){let{schema:t,document:n,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:s,typeResolver:c,subscribeFieldResolver:l,options:u}=e,d,f=Object.create(null);for(let e of n.definitions)switch(e.kind){case F.OPERATION_DEFINITION:if(o==null){if(d!==void 0)return[new M(`Must provide operation name if query contains multiple operations.`)];d=e}else e.name?.value===o&&(d=e);break;case F.FRAGMENT_DEFINITION:f[e.name.value]=e;break;default:}if(!d)return o==null?[new M(`Must provide an operation.`)]:[new M(`Unknown operation named "${o}".`)];let p=Nd(t,d.variableDefinitions??[],a??{},{maxErrors:u?.maxCoercionErrors??50});return p.errors?p.errors:{schema:t,fragments:f,rootValue:r,contextValue:i,operation:d,variableValues:p.coerced,fieldResolver:s??Tp,typeResolver:c??wp,subscribeFieldResolver:l??Tp,collectedErrors:new Cp}}function cp(e,t,n){let r=e.schema.getRootType(t.operation);if(r==null)throw new M(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});let i=zd(e.schema,e.fragments,e.variableValues,r,t.selectionSet);switch(t.operation){case ha.QUERY:return up(e,r,n,void 0,i);case ha.MUTATION:return lp(e,r,n,void 0,i);case ha.SUBSCRIPTION:return up(e,r,n,void 0,i)}}function lp(e,t,n,r,i){return Yf(i.entries(),(i,[a,o])=>{let s=dp(e,t,n,o,Cd(r,a,t.name));return s===void 0?i:Gi(s)?s.then(e=>(i[a]=e,i)):(i[a]=s,i)},Object.create(null))}function up(e,t,n,r,i){let a=Object.create(null),o=!1;try{for(let[s,c]of i.entries()){let i=dp(e,t,n,c,Cd(r,s,t.name));i!==void 0&&(a[s]=i,Gi(i)&&(o=!0))}}catch(e){if(o)return qf(a).finally(()=>{throw e});throw e}return o?qf(a):a}function dp(e,t,n,r,i){let a=xp(e.schema,t,r[0]);if(!a)return;let o=a.type,s=a.resolve??e.fieldResolver,c=fp(e,a,r,t,i);try{let t=Fd(a,r[0],e.variableValues),l=e.contextValue,u=s(n,t,l,c),d;return d=Gi(u)?u.then(t=>mp(e,o,r,c,i,t)):mp(e,o,r,c,i,u),Gi(d)?d.then(void 0,t=>pp(ep(t,r,wd(i)),o,i,e)):d}catch(t){return pp(ep(t,r,wd(i)),o,i,e)}}function fp(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function pp(e,t,n,r){if(V(t))throw e;return r.collectedErrors.add(e,n),null}function mp(e,t,n,r,i,a){if(a instanceof Error)throw a;if(V(t)){let o=mp(e,t.ofType,n,r,i,a);if(o===null)throw Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return o}if(a==null)return null;if(As(t))return hp(e,t,n,r,i,a);if(Ls(t))return gp(t,a);if(Vs(t))return _p(e,t,n,r,i,a);if(B(t))return yp(e,t,n,r,i,a);Yi(!1,`Cannot complete value of unexpected output type: `+L(t))}function hp(e,t,n,r,i,a){if(!qc(a))throw new M(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);let o=t.ofType,s=!1,c=Array.from(a,(t,a)=>{let c=Cd(i,a,void 0);try{let i;return i=Gi(t)?t.then(t=>mp(e,o,n,r,c,t)):mp(e,o,n,r,c,t),Gi(i)?(s=!0,i.then(void 0,t=>pp(ep(t,n,wd(c)),o,c,e))):i}catch(t){return pp(ep(t,n,wd(c)),o,c,e)}});return s?Promise.all(c):c}function gp(e,t){let n=e.serialize(t);if(n==null)throw Error(`Expected \`${L(e)}.serialize(${L(t)})\` to return non-nullable value, returned: ${L(n)}`);return n}function _p(e,t,n,r,i,a){let o=t.resolveType??e.typeResolver,s=e.contextValue,c=o(a,s,r,t);return Gi(c)?c.then(o=>yp(e,vp(o,e,t,n,r,a),n,r,i,a)):yp(e,vp(c,e,t,n,r,a),n,r,i,a)}function vp(e,t,n,r,i,a){if(e==null)throw new M(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if(B(e))throw new M(`Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.`);if(typeof e!=`string`)throw new M(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${L(a)}, received "${L(e)}".`);let o=t.schema.getType(e);if(o==null)throw new M(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!B(o))throw new M(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,o))throw new M(`Runtime Object type "${o.name}" is not a possible type for "${n.name}".`,{nodes:r});return o}function yp(e,t,n,r,i,a){let o=Sp(e,t,n);if(t.isTypeOf){let s=t.isTypeOf(a,e.contextValue,r);if(Gi(s))return s.then(r=>{if(!r)throw bp(t,a,n);return up(e,t,a,i,o)});if(!s)throw bp(t,a,n)}return up(e,t,a,i,o)}function bp(e,t,n){return new M(`Expected value of type "${e.name}" but got: ${L(t)}.`,{nodes:n})}function xp(e,t,n){let r=n.name.value;return r===cl.name&&e.getQueryType()===t?cl:r===ll.name&&e.getQueryType()===t?ll:r===ul.name?ul:t.getFields()[r]}var Sp,Cp,wp,Tp,Ep=n((()=>{Wi(),lo(),Xi(),Jc(),Ji(),Ki(),Kf(),Td(),Jf(),Xf(),N(),np(),ga(),va(),yc(),fl(),Rl(),Gd(),Rd(),Sp=Gf((e,t,n)=>Bd(e.schema,e.fragments,e.variableValues,t,n)),Cp=class{constructor(){this._errorPositions=new Set,this._errors=[]}get errors(){return this._errors}add(e,t){this._hasNulledPosition(t)||(this._errorPositions.add(t),this._errors.push(e))}_hasNulledPosition(e){let t=e;for(;t!==void 0;){if(this._errorPositions.has(t))return!0;t=t.prev}return this._errorPositions.has(void 0)}},wp=function(e,t,n,r){if(qi(e)&&typeof e.__typename==`string`)return e.__typename;let i=n.schema.getPossibleTypes(r),a=[];for(let r=0;r<i.length;r++){let o=i[r];if(o.isTypeOf){let i=o.isTypeOf(e,t,n);if(Gi(i))a[r]=i;else if(i)return a.length&&Promise.allSettled(a).catch(()=>{}),o.name}}if(a.length)return Promise.all(a).then(e=>{for(let t=0;t<e.length;t++)if(e[t])return i[t].name})},Tp=function(e,t,n,r){if(qi(e)||typeof e==`function`){let i=e[r.fieldName];return typeof i==`function`?e[r.fieldName](t,n,r):i}}}));function Dp(e){return new Promise(t=>t(kp(e)))}function Op(e){let t=kp(e);if(Gi(t))throw Error(`GraphQL execution failed to complete synchronously.`);return t}function kp(e){arguments.length<2||Ui(!1,`graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.`);let{schema:t,source:n,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:s,typeResolver:c}=e,l=vl(t);if(l.length>0)return{errors:l};let u;try{u=_o(n)}catch(e){return{errors:[e]}}let d=zf(t,u);return d.length>0?{errors:d}:rp({schema:t,document:u,rootValue:r,contextValue:i,variableValues:a,operationName:o,fieldResolver:s,typeResolver:c})}var Ap=n((()=>{Wi(),Ki(),To(),Rl(),Wf(),Ep()})),jp=n((()=>{_l(),yc(),Kc(),Pc(),fl(),Rl(),gs()})),Mp=n((()=>{go(),$i(),ra(),va(),Aa(),Za(),To(),ds(),is(),ga(),nu(),_a()}));function Np(e){return typeof e?.[Symbol.asyncIterator]==`function`}var Pp=n((()=>{}));function Fp(e,t){let n=e[Symbol.asyncIterator]();async function r(e){if(e.done)return e;try{return{value:await t(e.value),done:!1}}catch(e){if(typeof n.return==`function`)try{await n.return()}catch{}throw e}}return{async next(){return r(await n.next())},async return(){return typeof n.return==`function`?r(await n.return()):{value:void 0,done:!0}},async throw(e){if(typeof n.throw==`function`)return r(await n.throw(e));throw e},[Symbol.asyncIterator](){return this}}}var Ip=n((()=>{}));async function Lp(e){arguments.length<2||Ui(!1,`graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.`);let t=await zp(e);return Np(t)?Fp(t,t=>rp({...e,rootValue:t})):t}function Rp(e){let t=e[0];return t&&`document`in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}async function zp(...e){let t=Rp(e),{schema:n,document:r,variableValues:i}=t;op(n,r,i);let a=sp(t);if(!(`schema`in a))return{errors:a};try{let e=await Bp(a);if(!Np(e))throw Error(`Subscription field must return Async Iterable. Received: ${L(e)}.`);return e}catch(e){if(e instanceof M)return{errors:[e]};throw e}}async function Bp(e){let{schema:t,fragments:n,operation:r,variableValues:i,rootValue:a}=e,o=t.getSubscriptionType();if(o==null)throw new M(`Schema is not configured to execute subscription operation.`,{nodes:r});let[s,c]=[...zd(t,n,i,o,r.selectionSet).entries()][0],l=xp(t,o,c[0]);if(!l){let e=c[0].name.value;throw new M(`The subscription field "${e}" is not defined.`,{nodes:c})}let u=Cd(void 0,s,o.name),d=fp(e,l,c,o,u);try{let t=Fd(l,c[0],i),n=e.contextValue,r=await(l.subscribe??e.subscribeFieldResolver)(a,t,n,d);if(r instanceof Error)throw r;return r}catch(e){throw ep(e,c,wd(u))}}var Vp=n((()=>{Wi(),lo(),Pp(),Td(),N(),np(),Gd(),Ep(),Ip(),Rd()})),Hp=n((()=>{Td(),Ep(),Vp(),Rd()}));function Up(e){return{Field(t){let n=e.getFieldDef(),r=n?.deprecationReason;if(n&&r!=null){let i=e.getParentType();i??Yi(!1),e.reportError(new M(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:t}))}},Argument(t){let n=e.getArgument(),r=n?.deprecationReason;if(n&&r!=null){let i=e.getDirective();if(i!=null)e.reportError(new M(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}));else{let i=e.getParentType(),a=e.getFieldDef();i!=null&&a!=null||Yi(!1),e.reportError(new M(`Field "${i.name}.${a.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}))}}},ObjectField(t){let n=Xs(e.getParentInputType());if(Os(n)){let r=n.getFields()[t.name.value],i=r?.deprecationReason;i!=null&&e.reportError(new M(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){let n=e.getEnumValue(),r=n?.deprecationReason;if(n&&r!=null){let i=Xs(e.getInputType());i??Yi(!1),e.reportError(new M(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:t}))}}}}var Wp=n((()=>{Xi(),N(),yc()}));function Gp(e){return{Field(t){let n=Xs(e.getType());n&&Qc(n)&&e.reportError(new M(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}var Kp=n((()=>{N(),yc(),fl()})),qp=n((()=>{Wf(),Rf(),Pf(),iu(),cu(),uu(),pu(),_u(),yu(),Cu(),Tu(),Mu(),Pu(),Iu(),Ru(),od(),ld(),vd(),bd(),qd(),$d(),rf(),df(),pf(),hf(),xf(),Tf(),Df(),Af(),Au(),Du(),_f(),yf(),of(),lf(),Zd(),tf(),md(),Wp(),Kp()})),Jp=n((()=>{N(),la(),np()}));function Yp(e){let t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,oneOf:!1,...e},n=t.descriptions?`description`:``,r=t.specifiedByUrl?`specifiedByURL`:``,i=t.directiveIsRepeatable?`isRepeatable`:``,a=t.schemaDescription?n:``;function o(e){return t.inputValueDeprecation?e:``}let s=t.oneOf?`isOneOf`:``;return` + query IntrospectionQuery { + __schema { + ${a} + queryType { name kind } + mutationType { name kind } + subscriptionType { name kind } + types { + ...FullType + } + directives { + name + ${n} + ${i} + locations + args${o(`(includeDeprecated: true)`)} { + ...InputValue + } + } + } + } + + fragment FullType on __Type { + kind + name + ${n} + ${r} + ${s} + fields(includeDeprecated: true) { + name + ${n} + args${o(`(includeDeprecated: true)`)} { + ...InputValue + } + type { + ...TypeRef + } + isDeprecated + deprecationReason + } + inputFields${o(`(includeDeprecated: true)`)} { + ...InputValue + } + interfaces { + ...TypeRef + } + enumValues(includeDeprecated: true) { + name + ${n} + isDeprecated + deprecationReason + } + possibleTypes { + ...TypeRef + } + } + + fragment InputValue on __InputValue { + name + ${n} + type { ...TypeRef } + defaultValue + ${o(`isDeprecated`)} + ${o(`deprecationReason`)} + } + + fragment TypeRef on __Type { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + } + } + } + } + } + } + } + } + } + } + `}var Xp=n((()=>{}));function Zp(e,t){let n=null;for(let r of e.definitions)if(r.kind===F.OPERATION_DEFINITION){if(t==null){if(n)return null;n=r}else if(r.name?.value===t)return r}return n}var Qp=n((()=>{va()}));function $p(e,t){if(t.operation===`query`){let n=e.getQueryType();if(!n)throw new M(`Schema does not define the required query root type.`,{nodes:t});return n}if(t.operation===`mutation`){let n=e.getMutationType();if(!n)throw new M(`Schema is not configured for mutations.`,{nodes:t});return n}if(t.operation===`subscription`){let n=e.getSubscriptionType();if(!n)throw new M(`Schema is not configured for subscriptions.`,{nodes:t});return n}throw new M(`Can only have query, mutation and subscription operations.`,{nodes:t})}var em=n((()=>{N()}));function tm(e,t){let n=ip({schema:e,document:_o(Yp({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,oneOf:!0,...t}))});return!n.errors&&n.data||Yi(!1),n.data}var nm=n((()=>{Xi(),To(),Ep(),Xp()}));function rm(e,t){qi(e)&&qi(e.__schema)||Ui(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${L(e)}.`);let n=e.__schema,r=No(n.types,e=>e.name,e=>f(e));for(let e of[...Nc,...dl])r[e.name]&&(r[e.name]=e);let i=n.queryType?u(n.queryType):null,a=n.mutationType?u(n.mutationType):null,o=n.subscriptionType?u(n.subscriptionType):null,s=n.directives?n.directives.map(C):[];return new gl({description:n.description,query:i,mutation:a,subscription:o,types:Object.values(r),directives:s,assumeValid:t?.assumeValid});function c(e){if(e.kind===ol.LIST){let t=e.ofType;if(!t)throw Error(`Decorated type deeper than introspection query.`);return new dc(c(t))}if(e.kind===ol.NON_NULL){let t=e.ofType;if(!t)throw Error(`Decorated type deeper than introspection query.`);return new fc(Ks(c(t)))}return l(e)}function l(e){let t=e.name;if(!t)throw Error(`Unknown type reference: ${L(e)}.`);let n=r[t];if(!n)throw Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function u(e){return xs(l(e))}function d(e){return Cs(l(e))}function f(e){if(e!=null&&e.name!=null&&e.kind!=null)switch(e.kind){case ol.SCALAR:return p(e);case ol.OBJECT:return h(e);case ol.INTERFACE:return g(e);case ol.UNION:return _(e);case ol.ENUM:return v(e);case ol.INPUT_OBJECT:return y(e)}let t=L(e);throw Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${t}.`)}function p(e){return new pc({name:e.name,description:e.description,specifiedByURL:e.specifiedByURL})}function m(e){if(e.interfaces===null&&e.kind===ol.INTERFACE)return[];if(!e.interfaces){let t=L(e);throw Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(d)}function h(e){return new mc({name:e.name,description:e.description,interfaces:()=>m(e),fields:()=>b(e)})}function g(e){return new hc({name:e.name,description:e.description,interfaces:()=>m(e),fields:()=>b(e)})}function _(e){if(!e.possibleTypes){let t=L(e);throw Error(`Introspection result missing possibleTypes: ${t}.`)}return new gc({name:e.name,description:e.description,types:()=>e.possibleTypes.map(u)})}function v(e){if(!e.enumValues){let t=L(e);throw Error(`Introspection result missing enumValues: ${t}.`)}return new _c({name:e.name,description:e.description,values:No(e.enumValues,e=>e.name,e=>({description:e.description,deprecationReason:e.deprecationReason}))})}function y(e){if(!e.inputFields){let t=L(e);throw Error(`Introspection result missing inputFields: ${t}.`)}return new vc({name:e.name,description:e.description,fields:()=>S(e.inputFields),isOneOf:e.isOneOf})}function b(e){if(!e.fields)throw Error(`Introspection result missing fields: ${L(e)}.`);return No(e.fields,e=>e.name,x)}function x(e){let t=c(e.type);if(!Fs(t)){let e=L(t);throw Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(!e.args){let t=L(e);throw Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:S(e.args)}}function S(e){return No(e,e=>e.name,ee)}function ee(e){let t=c(e.type);if(!Ns(t)){let e=L(t);throw Error(`Introspection must provide input type for arguments, but received: ${e}.`)}let n=e.defaultValue==null?void 0:Ad(vo(e.defaultValue),t);return{description:e.description,type:t,defaultValue:n,deprecationReason:e.deprecationReason}}function C(e){if(!e.args){let t=L(e);throw Error(`Introspection result missing directive args: ${t}.`)}if(!e.locations){let t=L(e);throw Error(`Introspection result missing directive locations: ${t}.`)}return new Rc({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:S(e.args)})}}var im=n((()=>{Wi(),lo(),Ji(),Po(),To(),yc(),Kc(),fl(),Pc(),_l(),Md()}));function am(e,t,n){ml(e),t!=null&&t.kind===F.DOCUMENT||Ui(!1,`Must provide valid Document AST.`),n?.assumeValid!==!0&&n?.assumeValidSDL!==!0&&Hf(t,e);let r=e.toConfig(),i=om(r,t,n);return r===i?e:new gl(i)}function om(e,t,n){let r=[],i=Object.create(null),a=[],o,s=[];for(let e of t.definitions)if(e.kind===F.SCHEMA_DEFINITION)o=e;else if(e.kind===F.SCHEMA_EXTENSION)s.push(e);else if(Ql(e))r.push(e);else if(eu(e)){let t=e.name.value,n=i[t];i[t]=n?n.concat([e]):[e]}else e.kind===F.DIRECTIVE_DEFINITION&&a.push(e);if(Object.keys(i).length===0&&r.length===0&&a.length===0&&s.length===0&&o==null)return e;let c=Object.create(null);for(let t of e.types)c[t.name]=p(t);for(let e of r){let t=e.name.value;c[t]=um[t]??ce(e)}let l={query:e.query&&d(e.query),mutation:e.mutation&&d(e.mutation),subscription:e.subscription&&d(e.subscription),...o&&S([o]),...S(s)};return{description:o?.description?.value,...l,types:Object.values(c),directives:[...e.directives.map(f),...a.map(te)],extensions:Object.create(null),astNode:o??e.astNode,extensionASTNodes:e.extensionASTNodes.concat(s),assumeValid:n?.assumeValid??!1};function u(e){return As(e)?new dc(u(e.ofType)):V(e)?new fc(u(e.ofType)):d(e)}function d(e){return c[e.name]}function f(e){let t=e.toConfig();return new Rc({...t,args:Fo(t.args,x)})}function p(e){if(Qc(e)||wc(e))return e;if(ys(e))return g(e);if(B(e))return _(e);if(Ss(e))return v(e);if(ws(e))return y(e);if(Es(e))return h(e);if(Os(e))return m(e);Yi(!1,`Unexpected type: `+L(e))}function m(e){let t=e.toConfig(),n=i[t.name]??[];return new vc({...t,fields:()=>({...Fo(t.fields,e=>({...e,type:u(e.type)})),...ie(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}function h(e){let t=e.toConfig(),n=i[e.name]??[];return new _c({...t,values:{...t.values,...ae(n)},extensionASTNodes:t.extensionASTNodes.concat(n)})}function g(e){let t=e.toConfig(),n=i[t.name]??[],r=t.specifiedByURL;for(let e of n)r=cm(e)??r;return new pc({...t,specifiedByURL:r,extensionASTNodes:t.extensionASTNodes.concat(n)})}function _(e){let t=e.toConfig(),n=i[t.name]??[];return new mc({...t,interfaces:()=>[...e.getInterfaces().map(d),...oe(n)],fields:()=>({...Fo(t.fields,b),...ne(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}function v(e){let t=e.toConfig(),n=i[t.name]??[];return new hc({...t,interfaces:()=>[...e.getInterfaces().map(d),...oe(n)],fields:()=>({...Fo(t.fields,b),...ne(n)}),extensionASTNodes:t.extensionASTNodes.concat(n)})}function y(e){let t=e.toConfig(),n=i[t.name]??[];return new gc({...t,types:()=>[...e.getTypes().map(d),...se(n)],extensionASTNodes:t.extensionASTNodes.concat(n)})}function b(e){return{...e,type:u(e.type),args:e.args&&Fo(e.args,x)}}function x(e){return{...e,type:u(e.type)}}function S(e){let t={};for(let n of e){let e=n.operationTypes??[];for(let n of e)t[n.operation]=ee(n.type)}return t}function ee(e){let t=e.name.value,n=um[t]??c[t];if(n===void 0)throw Error(`Unknown type: "${t}".`);return n}function C(e){return e.kind===F.LIST_TYPE?new dc(C(e.type)):e.kind===F.NON_NULL_TYPE?new fc(C(e.type)):ee(e)}function te(e){return new Rc({name:e.name.value,description:e.description?.value,locations:e.locations.map(({value:e})=>e),isRepeatable:e.repeatable,args:re(e.arguments),astNode:e})}function ne(e){let t=Object.create(null);for(let n of e){let e=n.fields??[];for(let n of e)t[n.name.value]={type:C(n.type),description:n.description?.value,args:re(n.arguments),deprecationReason:sm(n),astNode:n}}return t}function re(e){let t=e??[],n=Object.create(null);for(let e of t){let t=C(e.type);n[e.name.value]={type:t,description:e.description?.value,defaultValue:Ad(e.defaultValue,t),deprecationReason:sm(e),astNode:e}}return n}function ie(e){let t=Object.create(null);for(let n of e){let e=n.fields??[];for(let n of e){let e=C(n.type);t[n.name.value]={type:e,description:n.description?.value,defaultValue:Ad(n.defaultValue,e),deprecationReason:sm(n),astNode:n}}}return t}function ae(e){let t=Object.create(null);for(let n of e){let e=n.values??[];for(let n of e)t[n.name.value]={description:n.description?.value,deprecationReason:sm(n),astNode:n}}return t}function oe(e){return e.flatMap(e=>e.interfaces?.map(ee)??[])}function se(e){return e.flatMap(e=>e.types?.map(ee)??[])}function ce(e){let t=e.name.value,n=i[t]??[];switch(e.kind){case F.OBJECT_TYPE_DEFINITION:{let r=[e,...n];return new mc({name:t,description:e.description?.value,interfaces:()=>oe(r),fields:()=>ne(r),astNode:e,extensionASTNodes:n})}case F.INTERFACE_TYPE_DEFINITION:{let r=[e,...n];return new hc({name:t,description:e.description?.value,interfaces:()=>oe(r),fields:()=>ne(r),astNode:e,extensionASTNodes:n})}case F.ENUM_TYPE_DEFINITION:{let r=[e,...n];return new _c({name:t,description:e.description?.value,values:ae(r),astNode:e,extensionASTNodes:n})}case F.UNION_TYPE_DEFINITION:{let r=[e,...n];return new gc({name:t,description:e.description?.value,types:()=>se(r),astNode:e,extensionASTNodes:n})}case F.SCALAR_TYPE_DEFINITION:return new pc({name:t,description:e.description?.value,specifiedByURL:cm(e),astNode:e,extensionASTNodes:n});case F.INPUT_OBJECT_TYPE_DEFINITION:{let r=[e,...n];return new vc({name:t,description:e.description?.value,fields:()=>ie(r),astNode:e,extensionASTNodes:n,isOneOf:lm(e)})}}}}function sm(e){return Id(Hc,e)?.reason}function cm(e){return Id(Uc,e)?.url}function lm(e){return!!Id(Wc,e)}var um,dm=n((()=>{Wi(),lo(),Xi(),Mo(),Io(),va(),nu(),yc(),Kc(),fl(),Pc(),_l(),Wf(),Rd(),Md(),um=jo([...Nc,...dl],e=>e.name)}));function fm(e,t){e!=null&&e.kind===F.DOCUMENT||Ui(!1,`Must provide valid Document AST.`),t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&Vf(e);let n=om({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(n.astNode==null)for(let e of n.types)switch(e.name){case`Query`:n.query=e;break;case`Mutation`:n.mutation=e;break;case`Subscription`:n.subscription=e;break}let r=[...n.directives,...Gc.filter(e=>n.directives.every(t=>t.name!==e.name))];return new gl({...n,directives:r})}function pm(e,t){return fm(_o(e,{noLocation:t?.noLocation,allowLegacyFragmentVariables:t?.allowLegacyFragmentVariables}),{assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}var mm=n((()=>{Wi(),va(),To(),Kc(),_l(),Wf(),dm()}));function hm(e){let t=e.toConfig(),n=No(_m(t.types),e=>e.name,d);return new gl({...t,types:Object.values(n),directives:_m(t.directives).map(o),query:a(t.query),mutation:a(t.mutation),subscription:a(t.subscription)});function r(e){return As(e)?new dc(r(e.ofType)):V(e)?new fc(r(e.ofType)):i(e)}function i(e){return n[e.name]}function a(e){return e&&i(e)}function o(e){let t=e.toConfig();return new Rc({...t,locations:vm(t.locations,e=>e),args:s(t.args)})}function s(e){return gm(e,e=>({...e,type:r(e.type)}))}function c(e){return gm(e,e=>({...e,type:r(e.type),args:e.args&&s(e.args)}))}function l(e){return gm(e,e=>({...e,type:r(e.type)}))}function u(e){return _m(e).map(i)}function d(e){if(ys(e)||Qc(e))return e;if(B(e)){let t=e.toConfig();return new mc({...t,interfaces:()=>u(t.interfaces),fields:()=>c(t.fields)})}if(Ss(e)){let t=e.toConfig();return new hc({...t,interfaces:()=>u(t.interfaces),fields:()=>c(t.fields)})}if(ws(e)){let t=e.toConfig();return new gc({...t,types:()=>u(t.types)})}if(Es(e)){let t=e.toConfig();return new _c({...t,values:gm(t.values,e=>e)})}if(Os(e)){let t=e.toConfig();return new vc({...t,fields:()=>l(t.fields)})}Yi(!1,`Unexpected type: `+L(e))}}function gm(e,t){let n=Object.create(null);for(let r of Object.keys(e).sort(Lo))n[r]=t(e[r]);return n}function _m(e){return vm(e,e=>e.name)}function vm(e,t){return e.slice().sort((e,n)=>Lo(t(e),t(n)))}var ym=n((()=>{lo(),Xi(),Po(),Vo(),yc(),Kc(),fl(),_l()}));function bm(e){return Cm(e,e=>!Lc(e),Sm)}function xm(e){return Cm(e,Lc,Qc)}function Sm(e){return!wc(e)&&!Qc(e)}function Cm(e,t,n){let r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[wm(e),...r.map(e=>Rm(e)),...i.map(e=>Em(e))].filter(Boolean).join(` + +`)}function wm(e){if(e.description==null&&Tm(e))return;let t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);let r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);let i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),Vm(e)+`schema {\n${t.join(` +`)}\n}`}function Tm(e){let t=e.getQueryType();if(t&&t.name!==`Query`)return!1;let n=e.getMutationType();if(n&&n.name!==`Mutation`)return!1;let r=e.getSubscriptionType();return!(r&&r.name!==`Subscription`)}function Em(e){if(ys(e))return Dm(e);if(B(e))return km(e);if(Ss(e))return Am(e);if(ws(e))return jm(e);if(Es(e))return Mm(e);if(Os(e))return Nm(e);Yi(!1,`Unexpected type: `+L(e))}function Dm(e){return Vm(e)+`scalar ${e.name}`+Bm(e)}function Om(e){let t=e.getInterfaces();return t.length?` implements `+t.map(e=>e.name).join(` & `):``}function km(e){return Vm(e)+`type ${e.name}`+Om(e)+Pm(e)}function Am(e){return Vm(e)+`interface ${e.name}`+Om(e)+Pm(e)}function jm(e){let t=e.getTypes(),n=t.length?` = `+t.join(` | `):``;return Vm(e)+`union `+e.name+n}function Mm(e){let t=e.getValues().map((e,t)=>Vm(e,` `,!t)+` `+e.name+zm(e.deprecationReason));return Vm(e)+`enum ${e.name}`+Fm(t)}function Nm(e){let t=Object.values(e.getFields()).map((e,t)=>Vm(e,` `,!t)+` `+Lm(e));return Vm(e)+`input ${e.name}`+(e.isOneOf?` @oneOf`:``)+Fm(t)}function Pm(e){return Fm(Object.values(e.getFields()).map((e,t)=>Vm(e,` `,!t)+` `+e.name+Im(e.args,` `)+`: `+String(e.type)+zm(e.deprecationReason)))}function Fm(e){return e.length===0?``:` { +`+e.join(` +`)+` +}`}function Im(e,t=``){return e.length===0?``:e.every(e=>!e.description)?`(`+e.map(Lm).join(`, `)+`)`:`( +`+e.map((e,n)=>Vm(e,` `+t,!n)+` `+t+Lm(e)).join(` +`)+` +`+t+`)`}function Lm(e){let t=Yc(e.defaultValue,e.type),n=e.name+`: `+String(e.type);return t&&(n+=` = ${as(t)}`),n+zm(e.deprecationReason)}function Rm(e){return Vm(e)+`directive @`+e.name+Im(e.args)+(e.isRepeatable?` repeatable`:``)+` on `+e.locations.join(` | `)}function zm(e){return e==null?``:e===`No longer supported`?` @deprecated`:` @deprecated(reason: ${as({kind:F.STRING,value:e})})`}function Bm(e){return e.specifiedByURL==null?``:` @specifiedBy(url: ${as({kind:F.STRING,value:e.specifiedByURL})})`}function Vm(e,t=``,n=!0){let{description:r}=e;if(r==null)return``;let i=as({kind:F.STRING,value:r,block:Da(r)});return(t&&!n?` +`+t:t)+i.replace(/\n/g,` +`+t)+` +`}var Hm=n((()=>{lo(),Xi(),ka(),va(),ds(),yc(),Kc(),fl(),Pc(),Zc()}));function Um(e){let t=[];for(let n of e)t.push(...n.definitions);return{kind:F.DOCUMENT,definitions:t}}var Wm=n((()=>{va()}));function Gm(e){let t=[],n=Object.create(null);for(let r of e.definitions)switch(r.kind){case F.OPERATION_DEFINITION:t.push(r);break;case F.FRAGMENT_DEFINITION:n[r.name.value]=qm(r.selectionSet);break;default:}let r=Object.create(null);for(let i of t){let t=new Set;for(let e of qm(i.selectionSet))Km(t,n,e);let a=i.name?i.name.value:``;r[a]={kind:F.DOCUMENT,definitions:e.definitions.filter(e=>e===i||e.kind===F.FRAGMENT_DEFINITION&&t.has(e.name.value))}}return r}function Km(e,t,n){if(!e.has(n)){e.add(n);let r=t[n];if(r!==void 0)for(let n of r)Km(e,t,n)}}function qm(e){let t=[];return $o(e,{FragmentSpread(e){t.push(e.name.value)}}),t}var Jm=n((()=>{va(),is()}));function Ym(e){let t=mo(e)?e:new ho(e),n=t.body,r=new Xa(t),i=``,a=!1;for(;r.advance().kind!==I.EOF;){let e=r.token,t=e.kind,o=!ja(e.kind);a&&(o||e.kind===I.SPREAD)&&(i+=` `);let s=n.slice(e.start,e.end);t===I.BLOCK_STRING?i+=Oa(e.value,{minimize:!0}):i+=s,a=o}return i}var Xm=n((()=>{ka(),Za(),go(),Aa()}));function Zm(e){let t=Qm(e);if(t)throw t;return e}function Qm(e){if(typeof e==`string`||Ui(!1,`Expected name to be a string.`),e.startsWith(`__`))return new M(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{ms(e)}catch(e){return e}}var $m=n((()=>{Wi(),N(),gs()}));function eh(e,t){return nh(e,t).filter(e=>e.type in gh)}function th(e,t){return nh(e,t).filter(e=>e.type in _h)}function nh(e,t){return[...ih(e,t),...rh(e,t)]}function rh(e,t){let n=[],r=hh(e.getDirectives(),t.getDirectives());for(let e of r.removed)n.push({type:gh.DIRECTIVE_REMOVED,description:`${e.name} was removed.`});for(let[e,t]of r.persisted){let r=hh(e.args,t.args);for(let t of r.added)ac(t)&&n.push({type:gh.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${t.name} on directive ${e.name} was added.`});for(let t of r.removed)n.push({type:gh.DIRECTIVE_ARG_REMOVED,description:`${t.name} was removed from ${e.name}.`});e.isRepeatable&&!t.isRepeatable&&n.push({type:gh.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${e.name}.`});for(let r of e.locations)t.locations.includes(r)||n.push({type:gh.DIRECTIVE_LOCATION_REMOVED,description:`${r} was removed from ${e.name}.`})}return n}function ih(e,t){let n=[],r=hh(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(let e of r.removed)n.push({type:gh.TYPE_REMOVED,description:wc(e)?`Standard scalar ${e.name} was removed because it is not referenced anymore.`:`${e.name} was removed.`});for(let[e,t]of r.persisted)Es(e)&&Es(t)?n.push(...sh(e,t)):ws(e)&&ws(t)?n.push(...oh(e,t)):Os(e)&&Os(t)?n.push(...ah(e,t)):B(e)&&B(t)||Ss(e)&&Ss(t)?n.push(...lh(e,t),...ch(e,t)):e.constructor!==t.constructor&&n.push({type:gh.TYPE_CHANGED_KIND,description:`${e.name} changed from ${ph(e)} to ${ph(t)}.`});return n}function ah(e,t){let n=[],r=hh(Object.values(e.getFields()),Object.values(t.getFields()));for(let t of r.added)uc(t)?n.push({type:gh.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${t.name} on input type ${e.name} was added.`}):n.push({type:_h.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${t.name} on input type ${e.name} was added.`});for(let t of r.removed)n.push({type:gh.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(let[t,i]of r.persisted)fh(t.type,i.type)||n.push({type:gh.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(i.type)}.`});return n}function oh(e,t){let n=[],r=hh(e.getTypes(),t.getTypes());for(let t of r.added)n.push({type:_h.TYPE_ADDED_TO_UNION,description:`${t.name} was added to union type ${e.name}.`});for(let t of r.removed)n.push({type:gh.TYPE_REMOVED_FROM_UNION,description:`${t.name} was removed from union type ${e.name}.`});return n}function sh(e,t){let n=[],r=hh(e.getValues(),t.getValues());for(let t of r.added)n.push({type:_h.VALUE_ADDED_TO_ENUM,description:`${t.name} was added to enum type ${e.name}.`});for(let t of r.removed)n.push({type:gh.VALUE_REMOVED_FROM_ENUM,description:`${t.name} was removed from enum type ${e.name}.`});return n}function ch(e,t){let n=[],r=hh(e.getInterfaces(),t.getInterfaces());for(let t of r.added)n.push({type:_h.IMPLEMENTED_INTERFACE_ADDED,description:`${t.name} added to interfaces implemented by ${e.name}.`});for(let t of r.removed)n.push({type:gh.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${t.name}.`});return n}function lh(e,t){let n=[],r=hh(Object.values(e.getFields()),Object.values(t.getFields()));for(let t of r.removed)n.push({type:gh.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(let[t,i]of r.persisted)n.push(...uh(e,t,i)),dh(t.type,i.type)||n.push({type:gh.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(i.type)}.`});return n}function uh(e,t,n){let r=[],i=hh(t.args,n.args);for(let n of i.removed)r.push({type:gh.ARG_REMOVED,description:`${e.name}.${t.name} arg ${n.name} was removed.`});for(let[n,a]of i.persisted)if(!fh(n.type,a.type))r.push({type:gh.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${n.name} has changed type from ${String(n.type)} to ${String(a.type)}.`});else if(n.defaultValue!==void 0)if(a.defaultValue===void 0)r.push({type:_h.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} defaultValue was removed.`});else{let i=mh(n.defaultValue,n.type),o=mh(a.defaultValue,a.type);i!==o&&r.push({type:_h.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} has changed defaultValue from ${i} to ${o}.`})}for(let n of i.added)ac(n)?r.push({type:gh.REQUIRED_ARG_ADDED,description:`A required arg ${n.name} on ${e.name}.${t.name} was added.`}):r.push({type:_h.OPTIONAL_ARG_ADDED,description:`An optional arg ${n.name} on ${e.name}.${t.name} was added.`});return r}function dh(e,t){return As(e)?As(t)&&dh(e.ofType,t.ofType)||V(t)&&dh(e,t.ofType):V(e)?V(t)&&dh(e.ofType,t.ofType):Js(t)&&e.name===t.name||V(t)&&dh(e,t.ofType)}function fh(e,t){return As(e)?As(t)&&fh(e.ofType,t.ofType):V(e)?V(t)&&fh(e.ofType,t.ofType)||!V(t)&&fh(e.ofType,t):Js(t)&&e.name===t.name}function ph(e){if(ys(e))return`a Scalar type`;if(B(e))return`an Object type`;if(Ss(e))return`an Interface type`;if(ws(e))return`a Union type`;if(Es(e))return`an Enum type`;if(Os(e))return`an Input type`;Yi(!1,`Unexpected type: `+L(e))}function mh(e,t){let n=Yc(e,t);return n??Yi(!1),as(zu(n))}function hh(e,t){let n=[],r=[],i=[],a=jo(e,({name:e})=>e),o=jo(t,({name:e})=>e);for(let t of e){let e=o[t.name];e===void 0?r.push(t):i.push([t,e])}for(let e of t)a[e.name]===void 0&&n.push(e);return{added:n,persisted:i,removed:r}}var gh,_h,vh=n((()=>{lo(),Xi(),Mo(),ds(),yc(),Pc(),Zc(),Vu(),(function(e){e.TYPE_REMOVED=`TYPE_REMOVED`,e.TYPE_CHANGED_KIND=`TYPE_CHANGED_KIND`,e.TYPE_REMOVED_FROM_UNION=`TYPE_REMOVED_FROM_UNION`,e.VALUE_REMOVED_FROM_ENUM=`VALUE_REMOVED_FROM_ENUM`,e.REQUIRED_INPUT_FIELD_ADDED=`REQUIRED_INPUT_FIELD_ADDED`,e.IMPLEMENTED_INTERFACE_REMOVED=`IMPLEMENTED_INTERFACE_REMOVED`,e.FIELD_REMOVED=`FIELD_REMOVED`,e.FIELD_CHANGED_KIND=`FIELD_CHANGED_KIND`,e.REQUIRED_ARG_ADDED=`REQUIRED_ARG_ADDED`,e.ARG_REMOVED=`ARG_REMOVED`,e.ARG_CHANGED_KIND=`ARG_CHANGED_KIND`,e.DIRECTIVE_REMOVED=`DIRECTIVE_REMOVED`,e.DIRECTIVE_ARG_REMOVED=`DIRECTIVE_ARG_REMOVED`,e.REQUIRED_DIRECTIVE_ARG_ADDED=`REQUIRED_DIRECTIVE_ARG_ADDED`,e.DIRECTIVE_REPEATABLE_REMOVED=`DIRECTIVE_REPEATABLE_REMOVED`,e.DIRECTIVE_LOCATION_REMOVED=`DIRECTIVE_LOCATION_REMOVED`})(gh||={}),(function(e){e.VALUE_ADDED_TO_ENUM=`VALUE_ADDED_TO_ENUM`,e.TYPE_ADDED_TO_UNION=`TYPE_ADDED_TO_UNION`,e.OPTIONAL_INPUT_FIELD_ADDED=`OPTIONAL_INPUT_FIELD_ADDED`,e.OPTIONAL_ARG_ADDED=`OPTIONAL_ARG_ADDED`,e.IMPLEMENTED_INTERFACE_ADDED=`IMPLEMENTED_INTERFACE_ADDED`,e.ARG_DEFAULT_VALUE_CHANGE=`ARG_DEFAULT_VALUE_CHANGE`})(_h||={})}));function yh(e,t){return Th(e,xo(t))}function bh(e,t){let n=t.name.value,r=e.getType(n);if(r!=null)return{kind:`NamedType`,type:r}}function xh(e,t){let n=t.name.value,r=e.getType(n);if(!r)throw Error(`Expected ${L(n)} to be defined as a type in the schema.`);if(!Es(r)&&!Os(r)&&!B(r)&&!Ss(r))throw Error(`Expected ${L(n)} to be an Enum, Input Object, Object or Interface type.`);if(Es(r)){let e=t.memberName.value,n=r.getValue(e);return n==null?void 0:{kind:`EnumValue`,type:r,enumValue:n}}if(Os(r)){let e=t.memberName.value,n=r.getFields()[e];return n==null?void 0:{kind:`InputField`,type:r,inputField:n}}let i=t.memberName.value,a=r.getFields()[i];if(a!=null)return{kind:`Field`,type:r,field:a}}function Sh(e,t){let n=t.name.value,r=e.getType(n);if(r==null)throw Error(`Expected ${L(n)} to be defined as a type in the schema.`);if(!B(r)&&!Ss(r))throw Error(`Expected ${L(n)} to be an object type or interface type.`);let i=t.fieldName.value,a=r.getFields()[i];if(a==null)throw Error(`Expected ${L(i)} to exist as a field of type ${L(n)} in the schema.`);let o=t.argumentName.value,s=a.args.find(e=>e.name===o);if(s!=null)return{kind:`FieldArgument`,type:r,field:a,fieldArgument:s}}function Ch(e,t){let n=t.name.value,r=e.getDirective(n);if(r)return{kind:`Directive`,directive:r}}function wh(e,t){let n=t.name.value,r=e.getDirective(n);if(!r)throw Error(`Expected ${L(n)} to be defined as a directive in the schema.`);let{argumentName:{value:i}}=t,a=r.args.find(e=>e.name===i);if(a)return{kind:`DirectiveArgument`,directive:r,directiveArgument:a}}function Th(e,t){switch(t.kind){case F.TYPE_COORDINATE:return bh(e,t);case F.MEMBER_COORDINATE:return xh(e,t);case F.ARGUMENT_COORDINATE:return Sh(e,t);case F.DIRECTIVE_COORDINATE:return Ch(e,t);case F.DIRECTIVE_ARGUMENT_COORDINATE:return wh(e,t)}}var Eh=n((()=>{lo(),va(),To(),yc()})),Dh=n((()=>{Xp(),Qp(),em(),nm(),im(),mm(),dm(),ym(),Hm(),Bl(),Md(),ps(),Zc(),Wl(),kd(),Wm(),Jm(),Xm(),Cc(),$m(),vh(),Eh()})),Oh=i({BREAK:()=>rs,BreakingChangeType:()=>gh,DEFAULT_DEPRECATION_REASON:()=>Vc,DangerousChangeType:()=>_h,DirectiveLocation:()=>P,ExecutableDefinitionsRule:()=>ru,FieldsOnCorrectTypeRule:()=>au,FragmentsOnCompositeTypesRule:()=>lu,GRAPHQL_MAX_INT:()=>Ec,GRAPHQL_MIN_INT:()=>Dc,GraphQLBoolean:()=>jc,GraphQLDeprecatedDirective:()=>Hc,GraphQLDirective:()=>Rc,GraphQLEnumType:()=>_c,GraphQLError:()=>M,GraphQLFloat:()=>kc,GraphQLID:()=>Mc,GraphQLIncludeDirective:()=>zc,GraphQLInputObjectType:()=>vc,GraphQLInt:()=>Oc,GraphQLInterfaceType:()=>hc,GraphQLList:()=>dc,GraphQLNonNull:()=>fc,GraphQLObjectType:()=>mc,GraphQLOneOfDirective:()=>Wc,GraphQLScalarType:()=>pc,GraphQLSchema:()=>gl,GraphQLSkipDirective:()=>Bc,GraphQLSpecifiedByDirective:()=>Uc,GraphQLString:()=>Ac,GraphQLUnionType:()=>gc,Kind:()=>F,KnownArgumentNamesRule:()=>du,KnownDirectivesRule:()=>mu,KnownFragmentNamesRule:()=>vu,KnownTypeNamesRule:()=>bu,Lexer:()=>Xa,Location:()=>da,LoneAnonymousOperationRule:()=>wu,LoneSchemaDefinitionRule:()=>Eu,MaxIntrospectionDepthRule:()=>Ou,NoDeprecatedCustomRule:()=>Up,NoFragmentCyclesRule:()=>ju,NoSchemaIntrospectionCustomRule:()=>Gp,NoUndefinedVariablesRule:()=>Nu,NoUnusedFragmentsRule:()=>Fu,NoUnusedVariablesRule:()=>Lu,OperationTypeNode:()=>ha,OverlappingFieldsCanBeMergedRule:()=>Uu,PossibleFragmentSpreadsRule:()=>sd,PossibleTypeExtensionsRule:()=>ud,ProvidedRequiredArgumentsRule:()=>hd,ScalarLeafsRule:()=>yd,SchemaMetaFieldDef:()=>cl,SingleFieldSubscriptionsRule:()=>Kd,Source:()=>ho,Token:()=>fa,TokenKind:()=>I,TypeInfo:()=>Ul,TypeKind:()=>ol,TypeMetaFieldDef:()=>ll,TypeNameMetaFieldDef:()=>ul,UniqueArgumentDefinitionNamesRule:()=>Xd,UniqueArgumentNamesRule:()=>Qd,UniqueDirectiveNamesRule:()=>ef,UniqueDirectivesPerLocationRule:()=>nf,UniqueEnumValueNamesRule:()=>af,UniqueFieldDefinitionNamesRule:()=>sf,UniqueFragmentNamesRule:()=>uf,UniqueInputFieldNamesRule:()=>ff,UniqueOperationNamesRule:()=>mf,UniqueOperationTypesRule:()=>gf,UniqueTypeNamesRule:()=>vf,UniqueVariableNamesRule:()=>bf,ValidationContext:()=>Lf,ValuesOfCorrectTypeRule:()=>Sf,VariablesAreInputTypesRule:()=>Ef,VariablesInAllowedPositionRule:()=>Of,__Directive:()=>el,__DirectiveLocation:()=>tl,__EnumValue:()=>al,__Field:()=>rl,__InputValue:()=>il,__Schema:()=>$c,__Type:()=>nl,__TypeKind:()=>sl,assertAbstractType:()=>Hs,assertCompositeType:()=>Bs,assertDirective:()=>Ic,assertEnumType:()=>Ds,assertEnumValueName:()=>hs,assertInputObjectType:()=>ks,assertInputType:()=>Ps,assertInterfaceType:()=>Cs,assertLeafType:()=>Rs,assertListType:()=>js,assertName:()=>ms,assertNamedType:()=>Ys,assertNonNullType:()=>Ms,assertNullableType:()=>Ks,assertObjectType:()=>xs,assertOutputType:()=>Is,assertScalarType:()=>bs,assertSchema:()=>ml,assertType:()=>vs,assertUnionType:()=>Ts,assertValidName:()=>Zm,assertValidSchema:()=>yl,assertWrappingType:()=>Ws,astFromValue:()=>Yc,buildASTSchema:()=>fm,buildClientSchema:()=>rm,buildSchema:()=>pm,coerceInputValue:()=>Ed,concatAST:()=>Um,createSourceEventStream:()=>zp,defaultFieldResolver:()=>Tp,defaultTypeResolver:()=>wp,doTypesOverlap:()=>Sc,execute:()=>rp,executeSync:()=>ip,extendSchema:()=>am,findBreakingChanges:()=>eh,findDangerousChanges:()=>th,formatError:()=>sa,getArgumentValues:()=>Fd,getDirectiveValues:()=>Id,getEnterLeaveForKind:()=>ts,getIntrospectionQuery:()=>Yp,getLocation:()=>Zi,getNamedType:()=>Xs,getNullableType:()=>qs,getOperationAST:()=>Zp,getOperationRootType:()=>$p,getVariableValues:()=>Nd,getVisitFn:()=>ns,graphql:()=>Dp,graphqlSync:()=>Op,introspectionFromSchema:()=>tm,introspectionTypes:()=>dl,isAbstractType:()=>Vs,isCompositeType:()=>zs,isConstValueNode:()=>Yl,isDefinitionNode:()=>Gl,isDirective:()=>Fc,isEnumType:()=>Es,isEqualType:()=>bc,isExecutableDefinitionNode:()=>Kl,isInputObjectType:()=>Os,isInputType:()=>Ns,isInterfaceType:()=>Ss,isIntrospectionType:()=>Qc,isLeafType:()=>Ls,isListType:()=>As,isNamedType:()=>Js,isNonNullType:()=>V,isNullableType:()=>Gs,isObjectType:()=>B,isOutputType:()=>Fs,isRequiredArgument:()=>ac,isRequiredInputField:()=>uc,isScalarType:()=>ys,isSchema:()=>pl,isSchemaCoordinateNode:()=>tu,isSelectionNode:()=>ql,isSpecifiedDirective:()=>Lc,isSpecifiedScalarType:()=>wc,isType:()=>_s,isTypeDefinitionNode:()=>Ql,isTypeExtensionNode:()=>eu,isTypeNode:()=>Xl,isTypeSubTypeOf:()=>xc,isTypeSystemDefinitionNode:()=>Zl,isTypeSystemExtensionNode:()=>$l,isUnionType:()=>ws,isValidNameError:()=>Qm,isValueNode:()=>Jl,isWrappingType:()=>Us,lexicographicSortSchema:()=>hm,locatedError:()=>ep,parse:()=>_o,parseConstValue:()=>yo,parseSchemaCoordinate:()=>xo,parseType:()=>bo,parseValue:()=>vo,print:()=>as,printError:()=>oa,printIntrospectionSchema:()=>xm,printLocation:()=>ea,printSchema:()=>bm,printSourceLocation:()=>ta,printType:()=>Em,recommendedRules:()=>jf,resolveASTSchemaCoordinate:()=>Th,resolveObjMapThunk:()=>Qs,resolveReadonlyArrayThunk:()=>Zs,resolveSchemaCoordinate:()=>yh,responsePathAsArray:()=>wd,separateOperations:()=>Gm,specifiedDirectives:()=>Gc,specifiedRules:()=>Mf,specifiedScalarTypes:()=>Nc,stripIgnoredCharacters:()=>Ym,subscribe:()=>Lp,syntaxError:()=>ca,typeFromAST:()=>zl,validate:()=>zf,validateSchema:()=>vl,valueFromAST:()=>Ad,valueFromASTUntyped:()=>fs,version:()=>Bi,versionInfo:()=>Vi,visit:()=>$o,visitInParallel:()=>es,visitWithTypeInfo:()=>Hl}),kh=n((()=>{Hi(),Ap(),jp(),Mp(),Hp(),qp(),Jp(),Dh()}));kh();function Ah(e){let t=[],n=/`([^`]+)`/g,r=/\s*\[(\w+)\]\s+<([^>]+)>$/gm,i=new Map,a=e.replace(n,(e,n)=>{let r=t.length;return t.push(n),`<!--INLINE:CODE:${r}-->`});for(let e of a.matchAll(r)){let[,t,n]=e;i.set(t,n)}a=a.replace(/\[([^\]]+)\]\(([^)]+)\)/g,`<a href="$2" target="_blank">$1</a>`).replace(/(\*\*|__)(.*?)\1/g,`<strong style="white-space: nowrap;">$2</strong>`).replace(/'/g,`’`).replace(/(\.\.\.)/g,`…`).replace(/---/g,`<hr/>`);for(let e in t)a=a.replace(`<!--INLINE:CODE:${e}-->`,`<code>${jh(t[e])}</code>`);return a.trimEnd()}function jh(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var Mh=A(`<button class="link svelte-1lzwyfl"> </button>`);function Nh(e,t){Xe(t,!0);function n(e){return V(e)?`${n(e.ofType)}!`:As(e)?`[${n(e.ofType)}]`:e.name}let r=Wt(()=>Xs(t.type)),i=Wt(()=>n(t.type));var a=Mh(),o=D(a,!0);T(a),zn(()=>qr(o,k(i))),Ir(`click`,a,()=>t.onNavigate(k(r).name)),j(e,a),Ze()}Lr([`click`]);var Ph=A(`<div class="description svelte-1ckn7ri"></div>`),Fh=A(`<div class="arg-description svelte-1ckn7ri"></div>`),Ih=A(`<div class="arg svelte-1ckn7ri"><span class="arg-name"> </span>: <!> <!></div>`),Lh=A(`<div><div class="section-label svelte-1ckn7ri">Arguments</div> <div class="args svelte-1ckn7ri"></div></div>`),Rh=A(`<div class="field svelte-1ckn7ri"><div class="heading svelte-1ckn7ri"> </div> <!> <div><div class="section-label svelte-1ckn7ri">Type</div> <!></div> <!></div>`);function zh(e,t){Xe(t,!0);let n=Wt(()=>`args`in t.field?t.field.args:[]);var r=Rh(),i=D(r),a=D(i,!0);T(i);var o=O(i,2),s=e=>{var n=Ph();di(n,()=>Ah(t.field.description),!0),T(n),j(e,n)};ei(o,e=>{t.field.description&&e(s)});var c=O(o,2);Nh(O(D(c),2),{get onNavigate(){return t.onNavigate},get type(){return t.field.type}}),T(c);var l=O(c,2),u=e=>{var r=Lh(),i=O(D(r),2);ai(i,21,()=>k(n),ti,(e,n)=>{var r=Ih(),i=D(r),a=D(i,!0);T(i);var o=O(i,2);Nh(o,{get onNavigate(){return t.onNavigate},get type(){return k(n).type}});var s=O(o,2),c=e=>{var t=Fh();di(t,()=>Ah(k(n).description),!0),T(t),j(e,t)};ei(s,e=>{k(n).description&&e(c)}),T(r),zn(()=>qr(a,k(n).name)),j(e,r)}),T(i),T(r),j(e,r)};ei(l,e=>{k(n).length>0&&e(u)}),T(r),zn(()=>qr(a,t.field.name)),j(e,r),Ze()}kh();var Bh=A(`<span class="kind svelte-1lfer34"> </span>`),Vh=A(`<div class="description svelte-1lfer34"></div>`),Hh=A(`<div class="entry svelte-1lfer34"><!></div>`),Uh=A(`<div><div class="section-label svelte-1lfer34">Implements</div> <div class="list svelte-1lfer34"></div></div>`),Wh=A(`<div class="entry-description svelte-1lfer34"></div>`),Gh=A(`<div class="entry svelte-1lfer34"><button class="field-button svelte-1lfer34"> </button>: <!> <!></div>`),Kh=A(`<div><div class="section-label svelte-1lfer34">Fields</div> <div class="list svelte-1lfer34"></div></div>`),qh=A(`<div class="entry svelte-1lfer34"><!></div>`),Jh=A(`<div><div class="section-label svelte-1lfer34">Members</div> <div class="list svelte-1lfer34"></div></div>`),Yh=A(`<div class="entry-description svelte-1lfer34"></div>`),Xh=A(`<div class="entry svelte-1lfer34"><span> </span> <!></div>`),Zh=A(`<div><div class="section-label svelte-1lfer34">Values</div> <div class="list svelte-1lfer34"></div></div>`),Qh=A(`<div class="type svelte-1lfer34"><div class="heading svelte-1lfer34"><!> </div> <!> <!> <!> <!> <!></div>`);function $h(e,t){Xe(t,!0);let n=Wt(()=>B(t.type)||Ss(t.type)||Os(t.type)?Object.values(t.type.getFields()):[]),r=Wt(()=>B(t.type)||Ss(t.type)?t.type.getInterfaces():[]),i=Wt(()=>ws(t.type)?t.type.getTypes():[]),a=Wt(()=>Es(t.type)?t.type.getValues():[]),o=Wt(()=>B(t.type)?`type`:Ss(t.type)?`interface`:ws(t.type)?`union`:Es(t.type)?`enum`:Os(t.type)?`input`:ys(t.type)?`scalar`:``);var s=Qh(),c=D(s),l=D(c),u=e=>{var t=Bh(),n=D(t,!0);T(t),zn(()=>qr(n,k(o))),j(e,t)};ei(l,e=>{k(o)&&e(u)});var d=O(l,1,!0);T(c);var f=O(c,2),p=e=>{var n=Vh();di(n,()=>Ah(t.type.description),!0),T(n),j(e,n)};ei(f,e=>{t.type.description&&e(p)});var m=O(f,2),h=e=>{var n=Uh(),i=O(D(n),2);ai(i,21,()=>k(r),ti,(e,n)=>{var r=Hh();Nh(D(r),{get onNavigate(){return t.onNavigateType},get type(){return k(n)}}),T(r),j(e,r)}),T(i),T(n),j(e,n)};ei(m,e=>{k(r).length>0&&e(h)});var g=O(m,2),_=e=>{var r=Kh(),i=O(D(r),2);ai(i,21,()=>k(n),ti,(e,n)=>{var r=Gh(),i=D(r),a=D(i,!0);T(i);var o=O(i,2);Nh(o,{get onNavigate(){return t.onNavigateType},get type(){return k(n).type}});var s=O(o,2),c=e=>{var t=Wh();di(t,()=>Ah(k(n).description),!0),T(t),j(e,t)};ei(s,e=>{k(n).description&&e(c)}),T(r),zn(()=>qr(a,k(n).name)),Ir(`click`,i,()=>t.onNavigateField(k(n).name)),j(e,r)}),T(i),T(r),j(e,r)};ei(g,e=>{k(n).length>0&&e(_)});var v=O(g,2),y=e=>{var n=Jh(),r=O(D(n),2);ai(r,21,()=>k(i),ti,(e,n)=>{var r=qh();Nh(D(r),{get onNavigate(){return t.onNavigateType},get type(){return k(n)}}),T(r),j(e,r)}),T(r),T(n),j(e,n)};ei(v,e=>{k(i).length>0&&e(y)});var b=O(v,2),x=e=>{var t=Zh(),n=O(D(t),2);ai(n,21,()=>k(a),ti,(e,t)=>{var n=Xh(),r=D(n),i=D(r,!0);T(r);var a=O(r,2),o=e=>{var n=Yh();di(n,()=>Ah(k(t).description),!0),T(n),j(e,n)};ei(a,e=>{k(t).description&&e(o)}),T(n),zn(()=>qr(i,k(t).name)),j(e,n)}),T(n),T(t),j(e,t)};ei(b,e=>{k(a).length>0&&e(x)}),T(s),zn(()=>qr(d,t.type.name)),j(e,s),Ze()}Lr([`click`]),kh();var eg=A(`<span class="separator svelte-1qhgkss">/</span> <button> </button>`,1),tg=A(`<button class="root-link svelte-1qhgkss"> </button>`),ng=A(`<div class="root svelte-1qhgkss"><div class="section-label svelte-1qhgkss">Root Types</div> <div class="root-list svelte-1qhgkss"></div></div>`),rg=A(`<div class="empty svelte-1qhgkss">Type not found in schema.</div>`),ig=A(`<div class="explorer svelte-1qhgkss"><div class="breadcrumbs svelte-1qhgkss"><button>Docs</button> <!></div> <div class="body svelte-1qhgkss"><!></div></div>`);function ag(e,t){Xe(t,!0);let n=tn(cn([])),r=Wt(()=>k(n).length>0?k(n)[k(n).length-1]:null),i=Wt(()=>{let e=[],n=t.schema.getQueryType(),r=t.schema.getMutationType(),i=t.schema.getSubscriptionType();return n&&e.push({label:`Query`,type:n}),r&&e.push({label:`Mutation`,type:r}),i&&e.push({label:`Subscription`,type:i}),e}),a=Wt(()=>{if(!k(r))return null;let e=k(r).kind===`type`?k(r).name:k(r).typeName;return t.schema.getType(e)??null}),o=Wt(()=>!k(r)||k(r).kind!==`field`||!k(a)?null:B(k(a))||Ss(k(a))||Os(k(a))?k(a).getFields()[k(r).fieldName]??null:null);function s(e){return e.kind===`type`?e.name:e.fieldName}function c(e){E(n,k(n).slice(0,e+1),!0)}function l(){E(n,[],!0)}function u(e){let t=k(r)?.kind===`type`?k(r).name:null;t&&E(n,[...k(n),{fieldName:e,kind:`field`,typeName:t}],!0)}function d(e){t.schema.getType(e)&&E(n,[...k(n),{kind:`type`,name:e}],!0)}var f=ig(),p=D(f),m=D(p);let h;ai(O(m,2),17,()=>k(n),ti,(e,t,r)=>{var i=eg(),a=O(yn(i),2);let o;var l=D(a,!0);T(a),zn(e=>{o=vi(a,1,`crumb svelte-1qhgkss`,null,o,{current:r===k(n).length-1}),qr(l,e)},[()=>s(k(t))]),Ir(`click`,a,()=>c(r)),j(e,i)}),T(p);var g=O(p,2),_=D(g),v=e=>{var t=ng(),n=O(D(t),2);ai(n,21,()=>k(i),ti,(e,t)=>{var n=tg(),r=D(n);T(n),zn(()=>qr(r,`${k(t).label??``}: ${k(t).type.name??``}`)),Ir(`click`,n,()=>d(k(t).type.name)),j(e,n)}),T(n),T(t),j(e,t)},y=e=>{zh(e,{get field(){return k(o)},onNavigate:d})},b=e=>{$h(e,{onNavigateField:u,onNavigateType:d,get type(){return k(a)}})},x=e=>{j(e,rg())};ei(_,e=>{k(n).length===0?e(v):k(o)?e(y,1):k(a)?e(b,2):e(x,-1)}),T(g),T(f),zn(()=>h=vi(m,1,`crumb svelte-1qhgkss`,null,h,{current:k(n).length===0})),Ir(`click`,m,l),j(e,f),Ze()}Lr([`click`]);var H={blue:{1:`89.66% 0.046 260.67`,2:`80.17% 0.091 258.88`,3:`70.94% 0.136 258.06`,4:`62.39% 0.181 258.33`,5:`54.87% 0.222 260.33`,6:`51.15% 0.204 260.17`,7:`47.36% 0.185 259.89`,8:`43.48% 0.17 260.2`,9:`39.53% 0.15 259.87`},gray:{1:`95.57% 0.003 286.35`,2:`92.04% 0.002 197.12`,3:`88.28% 0.003 286.34`,4:`84.68% 0.002 197.12`,5:`80.73% 0.002 247.84`,6:`75.03% 0.002 247.85`,7:`69.01% 0.003 286.32`,8:`63.12% 0.004 219.55`,9:`56.82% 0.004 247.89`},green:{1:`93.96% 0.05 148.74`,2:`88.77% 0.096 147.71`,3:`83.74% 0.139 146.57`,4:`79.33% 0.179 145.62`,5:`75.23% 0.209 144.64`,6:`70.03% 0.194 144.71`,7:`64.24% 0.175 144.92`,8:`58.83% 0.158 145.05`,9:`52.77% 0.138 145.41`},orange:{1:`93.83% 0.037 56.93`,2:`88.37% 0.072 55.8`,3:`83.56% 0.107 56.49`,4:`78.75% 0.141 54.32`,5:`74.61% 0.171 51.56`,6:`69.33% 0.157 52.18`,7:`63.8% 0.142 52.1`,8:`58.28% 0.128 52.2`,9:`52.49% 0.113 51.98`},pink:{1:`95.8% 0.023 354.27`,2:`92.14% 0.046 352.31`,3:`88.9% 0.066 354.39`,4:`85.43% 0.09 354.1`,5:`82.23% 0.112 355.33`,6:`76.37% 0.101 355.37`,7:`70.23% 0.092 354.96`,8:`64.11% 0.084 353.91`,9:`57.68% 0.074 353.14`},purple:{1:`89.1% 0.046 305.24`,2:`78.68% 0.091 305`,3:`68.5% 0.136 303.78`,4:`58.47% 0.181 302.06`,5:`49.39% 0.215 298.31`,6:`46.11% 0.198 298.4`,7:`42.77% 0.181 298.49`,8:`39.46% 0.164 298.29`,9:`36.01% 0.145 298.35`},red:{1:`88.98% 0.052 3.28`,2:`78.78% 0.109 4.54`,3:`69.86% 0.162 7.82`,4:`62.73% 0.209 12.37`,5:`58.63% 0.231 19.6`,6:`54.41% 0.214 19.06`,7:`49.95% 0.195 18.34`,8:`45.8% 0.177 17.7`,9:`41.17% 0.157 16.58`},yellow:{1:`97.05% 0.039 91.2`,2:`95% 0.07 92.39`,3:`92.76% 0.098 92.58`,4:`90.92% 0.125 92.56`,5:`89% 0.146 91.5`,6:`82.39% 0.133 91.5`,7:`75.84% 0.122 92.21`,8:`69.14% 0.109 91.04`,9:`62.29% 0.097 91.9`},yin:{1:`91.87% 0.003 264.54`,2:`84.61% 0.004 286.31`,3:`76.89% 0.004 247.87`,4:`69.17% 0.004 247.88`,5:`61.01% 0.005 271.34`,6:`52.79% 0.005 271.32`,7:`43.87% 0.005 271.3`,8:`35.02% 0.005 236.66`,9:`25.11% 0.006 258.36`}},og={blue:{1:`oklch(${H.blue[1]})`,2:`oklch(${H.blue[2]})`,3:`oklch(${H.blue[3]})`,4:`oklch(${H.blue[4]})`,5:`oklch(${H.blue[5]})`,6:`oklch(${H.blue[6]})`,7:`oklch(${H.blue[7]})`,8:`oklch(${H.blue[8]})`,9:`oklch(${H.blue[9]})`},gray:{1:`oklch(${H.gray[1]})`,2:`oklch(${H.gray[2]})`,3:`oklch(${H.gray[3]})`,4:`oklch(${H.gray[4]})`,5:`oklch(${H.gray[5]})`,6:`oklch(${H.gray[6]})`,7:`oklch(${H.gray[7]})`,8:`oklch(${H.gray[8]})`,9:`oklch(${H.gray[9]})`},green:{1:`oklch(${H.green[1]})`,2:`oklch(${H.green[2]})`,3:`oklch(${H.green[3]})`,4:`oklch(${H.green[4]})`,5:`oklch(${H.green[5]})`,6:`oklch(${H.green[6]})`,7:`oklch(${H.green[7]})`,8:`oklch(${H.green[8]})`,9:`oklch(${H.green[9]})`},orange:{1:`oklch(${H.orange[1]})`,2:`oklch(${H.orange[2]})`,3:`oklch(${H.orange[3]})`,4:`oklch(${H.orange[4]})`,5:`oklch(${H.orange[5]})`,6:`oklch(${H.orange[6]})`,7:`oklch(${H.orange[7]})`,8:`oklch(${H.orange[8]})`,9:`oklch(${H.orange[9]})`},pink:{1:`oklch(${H.pink[1]})`,2:`oklch(${H.pink[2]})`,3:`oklch(${H.pink[3]})`,4:`oklch(${H.pink[4]})`,5:`oklch(${H.pink[5]})`,6:`oklch(${H.pink[6]})`,7:`oklch(${H.pink[7]})`,8:`oklch(${H.pink[8]})`,9:`oklch(${H.pink[9]})`},purple:{1:`oklch(${H.purple[1]})`,2:`oklch(${H.purple[2]})`,3:`oklch(${H.purple[3]})`,4:`oklch(${H.purple[4]})`,5:`oklch(${H.purple[5]})`,6:`oklch(${H.purple[6]})`,7:`oklch(${H.purple[7]})`,8:`oklch(${H.purple[8]})`,9:`oklch(${H.purple[9]})`},red:{1:`oklch(${H.red[1]})`,2:`oklch(${H.red[2]})`,3:`oklch(${H.red[3]})`,4:`oklch(${H.red[4]})`,5:`oklch(${H.red[5]})`,6:`oklch(${H.red[6]})`,7:`oklch(${H.red[7]})`,8:`oklch(${H.red[8]})`,9:`oklch(${H.red[9]})`},yellow:{1:`oklch(${H.yellow[1]})`,2:`oklch(${H.yellow[2]})`,3:`oklch(${H.yellow[3]})`,4:`oklch(${H.yellow[4]})`,5:`oklch(${H.yellow[5]})`,6:`oklch(${H.yellow[6]})`,7:`oklch(${H.yellow[7]})`,8:`oklch(${H.yellow[8]})`,9:`oklch(${H.yellow[9]})`},yin:{1:`oklch(${H.yin[1]})`,2:`oklch(${H.yin[2]})`,3:`oklch(${H.yin[3]})`,4:`oklch(${H.yin[4]})`,5:`oklch(${H.yin[5]})`,6:`oklch(${H.yin[6]})`,7:`oklch(${H.yin[7]})`,8:`oklch(${H.yin[8]})`,9:`oklch(${H.yin[9]})`}},sg=`oklch(99.4% 0 0)`,cg=(e,t)=>og[e][t];og.blue[1],og.blue[4],og.blue[8],og.gray[1],og.gray[4],og.gray[8],og.green[1],og.green[4],og.green[8],og.orange[1],og.orange[4],og.orange[8],og.pink[1],og.pink[4],og.pink[8],og.purple[1],og.purple[4],og.purple[8],og.red[1],og.red[4],og.red[8],og.yellow[1],og.yellow[4],og.yellow[8],og.yin[1];function lg(e){if(e<768)return!1;for(let t=0,n=vg.length;;){let r=t+n>>1;if(e<vg[r])n=r;else if(e>=yg[r])t=r+1;else return!0;if(t==n)return!1}}function ug(e){return e>=127462&&e<=127487}function dg(e,t,n=!0,r=!0){return(n?fg:pg)(e,t,r)}function fg(e,t,n){if(t==e.length)return t;t&&hg(e.charCodeAt(t))&&gg(e.charCodeAt(t-1))&&t--;let r=mg(e,t);for(t+=_g(r);t<e.length;){let i=mg(e,t);if(r==bg||i==bg||n&&lg(i))t+=_g(i),r=i;else if(ug(i)){let n=0,r=t-2;for(;r>=0&&ug(mg(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function pg(e,t,n){for(;t>0;){let r=fg(e,t-2,n);if(r<t)return r;t--}return 0}function mg(e,t){let n=e.charCodeAt(t);if(!gg(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return hg(r)?(n-55296<<10)+(r-56320)+65536:n}function hg(e){return e>=56320&&e<57344}function gg(e){return e>=55296&&e<56320}function _g(e){return e<65536?1:2}var vg,yg,bg,xg=n((()=>{vg=[],yg=[],(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?yg:vg).push(n+=e[t])})(),bg=8205})),Sg=i({Annotation:()=>G_,AnnotationType:()=>K_,ChangeDesc:()=>w_,ChangeSet:()=>T_,CharCategory:()=>X_,Compartment:()=>F_,EditorSelection:()=>U,EditorState:()=>$_,Facet:()=>W,Line:()=>x_,MapMode:()=>C_,Prec:()=>N_,Range:()=>tv,RangeSet:()=>rv,RangeSetBuilder:()=>iv,RangeValue:()=>ev,SelectionRange:()=>D_,StateEffect:()=>G,StateEffectType:()=>q_,StateField:()=>j_,Text:()=>h_,Transaction:()=>J_,codePointAt:()=>Ag,codePointSize:()=>Mg,combineConfig:()=>n_,countColumn:()=>p_,findClusterBreak:()=>Dg,findColumn:()=>m_,fromCodePoint:()=>jg});function Cg(e){let t=-1;for(let n of e)t+=n.length+1;return t}function wg(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function Tg(e,t,n){return wg(e,[``],t,n)}function Eg(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Dg(e,t,n=!0,r=!0){return dg(e,t,n,r)}function Og(e){return e>=56320&&e<57344}function kg(e){return e>=55296&&e<56320}function Ag(e,t){let n=e.charCodeAt(t);if(!kg(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return Og(r)?(n-55296<<10)+(r-56320)+65536:n}function jg(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Mg(e){return e<65536?1:2}function Ng(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function Pg(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(h_.empty);e.push(n)}}function Fg(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=h_.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function Ig(e,t,n,r=!1){let i=[],a=r?[]:null,o=new E_(e),s=new E_(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);Ng(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(Ng(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(Ng(i,0,o.ins),a&&Pg(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;Ng(i,t,e<o.i?o.ins:0),a&&e<o.i&&Pg(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?T_.createSet(i,a):w_.create(i);else throw Error(`Mismatched change set lengths`)}function Lg(e,t,n=!1){let r=[],i=n?[]:null,a=new E_(e),o=new E_(t);for(let e=!1;;)if(a.done&&o.done)return i?T_.createSet(r,i):w_.create(r);else if(a.ins==0)Ng(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)Ng(r,0,o.ins,e),i&&Pg(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;Ng(r,t,n,e),i&&n&&Pg(i,r,o.text)}else o.ins==-1?(Ng(r,a.off?0:a.len,t,e),i&&Pg(i,r,a.textBit(t))):(Ng(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&Pg(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}function Rg(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}function zg(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}function Bg(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function Vg(e,t){let n=!1;for(let r of t)Gg(e,r)&1&&(n=!0);return n}function Hg(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=Kg(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)Gg(e,t);return e.values[o]=s(e),1},update(e,n){if(!Vg(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=Vg(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&zg(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}function Ug(e){return t=>new P_(t,e)}function Wg(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof I_&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof I_){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof P_)a(e.inner,e.prec);else if(e instanceof j_)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof k_)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,M_.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,M_.default),r.reduce((e,t)=>e.concat(t))}function Gg(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function Kg(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}function qg(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function Jg(e,t,n){let r,i,a;return n?(r=t.changes,i=T_.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:G.mapEffects(e.effects,r).concat(G.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function Yg(e,t,n){let r=t.selection,i=$g(t.annotations);return t.userEvent&&(i=i.concat(J_.userEvent.of(t.userEvent))),{changes:t.changes instanceof T_?t.changes:T_.of(t.changes||[],n,e.facet(B_)),selection:r&&(r instanceof U?r:U.single(r.anchor,r.head)),effects:$g(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function Xg(e,t,n){let r=Yg(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=Jg(r,Yg(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=J_.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return Qg(n?Zg(i):i)}function Zg(e){let t=e.startState,n=!0;for(let r of t.facet(V_)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:qg(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=T_.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=J_.create(t,r,e.selection&&e.selection.map(i),G.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(H_);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof J_?i:Array.isArray(i)&&i.length==1&&i[0]instanceof J_?i[0]:Xg(t,$g(i),!1)}return e}function Qg(e){let t=e.startState,n=t.facet(U_),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=Jg(r,Yg(t,a,e.changes.newLength),!0))}return r==e?e:J_.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}function $g(e){return e==null?Y_:Array.isArray(e)?e:[e]}function e_(e){if(Q_)return Q_.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>``&&(n.toUpperCase()!=n.toLowerCase()||Z_.test(n)))return!0}return!1}function t_(e){return t=>{if(!/\S/.test(t))return X_.Space;if(e_(t))return X_.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return X_.Word;return X_.Other}}function n_(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],a=r[e];if(a===void 0)r[e]=i;else if(!(a===i||i===void 0))if(Object.hasOwnProperty.call(n,e))r[e]=n[e](a,i);else throw Error(`Config merge conflict for field `+e)}for(let e in t)r[e]===void 0&&(r[e]=t[e]);return r}function r_(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}function i_(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}function a_(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(i_(t,r)>0)return e.slice().sort(i_);t=r}return e}function o_(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let a=r.get(e.chunk[t]);a!=null&&(n?n.mapPos(a):a)==e.chunkPos[t]&&!n?.touchesRange(a,a+e.chunk[t].length)&&i.add(e.chunk[t])}return i}function s_(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}function c_(e,t,n,r,i,a){e.goto(t),n.goto(r);let o=r+i,s=r,c=r-t,l=!!a.boundChange;for(let t=!1;;){let r=e.to+c-n.to,i=r||e.endSide-n.endSide,u=i<0?e.to+c:n.to,d=Math.min(u,o);if(e.point||n.point?(e.point&&n.point&&r_(e.point,n.point)&&l_(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,d,e.point,n.point),t=!1):(t&&a.boundChange(s),d>s&&!l_(e.active,n.active)&&a.compareRange(s,d,e.active,n.active),l&&d<o&&(r||e.openEnd(u)!=n.openEnd(u))&&(t=!0)),u>o)break;s=u,i<=0&&e.next(),i>=0&&n.next()}}function l_(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!r_(e[n],t[n]))return!1;return!0}function u_(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function d_(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function f_(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function p_(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=Dg(e,i));return r}function m_(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=e.charCodeAt(r)==9?n-i%n:1,r=Dg(e,r)}return r===!0?-1:e.length}var h_,g_,__,v_,y_,b_,x_,S_,C_,w_,T_,E_,D_,U,O_,W,k_,A_,j_,M_,N_,P_,F_,I_,L_,R_,z_,B_,V_,H_,U_,W_,G_,K_,q_,G,J_,Y_,X_,Z_,Q_,$_,ev,tv,nv,rv,iv,av,ov,sv,cv=n((()=>{xg(),h_=class e{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Eg(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),__.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Eg(this,e,t);let n=[];return this.decompose(e,t,n,0),__.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new v_(this),i=new v_(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new v_(this,e)}iterRange(e,t=this.length){return new y_(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new b_(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new g_(t):__.from(g_.split(t,[]))}},g_=class e extends h_{constructor(e,t=Cg(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new x_(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(Tg(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=wg(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=Eg(this,t,n);let i=wg(this.text,wg(r.text,Tg(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):__.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=` +`){[e,t]=Eg(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},__=class e extends h_{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=Eg(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=` +`){[e,t]=Eg(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new g_(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof g_&&c&&(n=u[u.length-1])instanceof g_&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new g_(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}},h_.empty=new g_([``],0),v_=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof g_?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof g_?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(r instanceof g_){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof g_?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},y_=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new v_(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value=``,this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=``}},b_=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}},typeof Symbol<`u`&&(h_.prototype[Symbol.iterator]=function(){return this.iter()},v_.prototype[Symbol.iterator]=y_.prototype[Symbol.iterator]=b_.prototype[Symbol.iterator]=function(){return this}),x_=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}},S_=/\r\n?|\n/,C_=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(C_||={}),w_=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){Fg(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:Lg(this,e)}mapDesc(e,t=!1){return e.empty?this:Ig(this,e,t)}mapPos(e,t=-1,n=C_.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=C_.Simple&&c>=e&&(n==C_.TrackDel&&r<e&&c>e||n==C_.TrackBefore&&r<e||n==C_.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},T_=class e extends w_{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return Fg(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return Ig(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(h_.empty);r.push(a?t.slice(i,i+a):h_.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:Lg(this,e,!0)}map(e,t=!1){return e.empty?this:Ig(this,e,t,!0)}iterChanges(e,t=!1){Fg(this,e,t)}get desc(){return w_.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new E_(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);Ng(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;Ng(n,e,t),t>0&&Pg(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);Ng(n,e,-1),Ng(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:w_.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&Ng(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?h_.of(l.split(r||S_)):l:h_.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&Ng(i,e-o,-1),Ng(i,s-e,d),Pg(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(h_.empty);r[e]=h_.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}},E_=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?h_.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?h_.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},D_=class e{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return U.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return U.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return U.range(e.anchor,e.head)}static create(t,n,r){return new e(t,n,r)}},U=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>D_.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return D_.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r,i){let a=(n??16777215)<<6|(r==null?7:Math.min(6,r));return!i&&e!=t&&(i=t<e?1:-1),t<e?D_.create(t,e,48|a):D_.create(e,t,(i?i<0?8:16:0)|a)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}},O_=0,W=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=O_++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:zg),!!t.static,t.enables)}of(e){return new k_([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new k_(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new k_(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}},k_=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=O_++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||Vg(e,c)){let r=t(e);if(a?!Bg(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=Kg(o,c);if(this.dependencies.every(t=>t instanceof W?o.facet(t)===e.facet(t):t instanceof j_?o.field(t,!1)==e.field(t,!1):!0)||(a?Bg(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}},A_=W.define({static:!0}),j_=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(O_++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(A_).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(A_),i=n.facet(A_),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,A_.of({field:this,create:e})]}get extension(){return this}},M_={lowest:4,low:3,default:2,high:1,highest:0},N_={highest:Ug(M_.highest),high:Ug(M_.high),default:Ug(M_.default),low:Ug(M_.low),lowest:Ug(M_.lowest)},P_=class{constructor(e,t){this.inner=e,this.prec=t}},F_=class e{of(e){return new I_(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},I_=class{constructor(e,t){this.compartment=e,this.inner=t}},L_=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of Wg(t,n,o))e instanceof j_?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0))if(s[n.id]=c.length<<1|1,zg(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>Hg(e,n,t))}}return new e(t,o,l.map(e=>e(s)),s,c,a)}},R_=W.define(),z_=W.define({combine:e=>e.some(e=>e),static:!0}),B_=W.define({combine:e=>e.length?e[0]:void 0,static:!0}),V_=W.define(),H_=W.define(),U_=W.define(),W_=W.define({combine:e=>e.length?e[0]:!1}),G_=class{constructor(e,t){this.type=e,this.value=t}static define(){return new K_}},K_=class{of(e){return new G_(this,e)}},q_=class{constructor(e){this.map=e}of(e){return new G(this,e)}},G=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new q_(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}},G.reconfigure=G.define(),G.appendConfig=G.define(),J_=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&Rg(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return this._doc||=this.changes.apply(this.startState.doc)}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}},J_.time=G_.define(),J_.userEvent=G_.define(),J_.addToHistory=G_.define(),J_.remote=G_.define(),Y_=[],X_=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(X_||={}),Z_=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{Q_=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}$_=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)Gg(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`);return}return Gg(this,n),Kg(this,n)}update(...e){return Xg(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(F_.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(G.reconfigure)?(n=null,r=e.value):e.is(G.appendConfig)&&(n=null,r=$g(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=L_.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(z_)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:U.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=$g(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=G.mapEffects(a,c).concat(G.mapEffects($g(o.effects),l))}return{changes:r,selection:U.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof T_?t:T_.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return h_.of(t.split(this.facet(e.lineSeparator)||S_))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Gg(this,t),Kg(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof j_&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:U.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=L_.resolve(t.extensions||[],new Map),r=t.doc instanceof h_?t.doc:h_.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||S_)),i=t.selection?t.selection instanceof U?t.selection:U.single(t.selection.anchor,t.selection.head):U.single(0);return Rg(i,r.length),n.staticFacet(z_)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||` +`}get readOnly(){return this.facet(W_)}phrase(t,...n){for(let n of this.facet(e.phrases))if(Object.prototype.hasOwnProperty.call(n,t)){t=n[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(e,t)=>{if(t==`$`)return`$`;let r=+(t||1);return!r||r>n.length?e:n[r-1]})),t}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(R_))for(let a of i(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt(`wordChars`,e);return t_(t.length?t[0]:``)}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),a=e-n,o=e-n;for(;a>0;){let e=Dg(t,a,!1);if(i(t.slice(e,a))!=X_.Word)break;a=e}for(;o<r;){let e=Dg(t,o);if(i(t.slice(o,e))!=X_.Word)break;o=e}return a==o?null:U.range(a+n,o+n)}},$_.allowMultipleSelections=z_,$_.tabSize=W.define({combine:e=>e.length?e[0]:4}),$_.lineSeparator=B_,$_.readOnly=W_,$_.phrases=W.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),$_.languageData=R_,$_.changeFilter=V_,$_.transactionFilter=H_,$_.transactionExtender=U_,F_.reconfigure=G.define(),ev=class{eq(e){return this==e}range(e,t=e){return tv.create(e,t,this)}},ev.prototype.startSide=ev.prototype.endSide=0,ev.prototype.point=!1,ev.prototype.mapMode=C_.TrackDel,tv=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,r){return new e(t,n,r)}},nv=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let a=r,o=i.length;;){if(a==o)return a;let r=a+o>>1,s=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==a)return s>=0?a:o;s>=0?o=r:a=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,i);i<a;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(t,n){let r=[],i=[],a=[],o=-1,s=-1;for(let e=0;e<this.value.length;e++){let c=this.value[e],l=this.from[e]+t,u=this.to[e]+t,d,f;if(l==u){let e=n.mapPos(l,c.startSide,c.mapMode);if(e==null||(d=f=e,c.startSide!=c.endSide&&(f=n.mapPos(l,c.endSide),f<d)))continue}else if(d=n.mapPos(l,c.startSide),f=n.mapPos(u,c.endSide),d>f||d==f&&c.startSide>0&&c.endSide<=0)continue;(f-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(s=Math.max(s,f-d)),r.push(c),i.push(d-o),a.push(f-o))}return{mapped:r.length?new e(i,a,r,s):null,pos:o}}},rv=class e{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(t,n,r,i){return new e(t,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,o=t.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(i_)),this.isEmpty)return n.length?e.of(n):this;let s=new av(this,null,-1).goto(0),c=0,l=[],u=new iv;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let e=n[c++];u.addInner(e.from,e.to,e.value)||l.push(e)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!o||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&u.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!o||i>s.to||a<s.from||o(s.from,s.to,s.value))&&(u.addInner(s.from,s.to,s.value)||l.push(tv.create(s.from,s.to,s.value))),s.next());return u.finishInner(this.nextLayer.isEmpty&&!l.length?e.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],o=this.chunk[e],s=t.touchesRange(a,a+o.length);if(s===!1)i=Math.max(i,o.maxPoint),n.push(o),r.push(t.mapPos(a));else if(s===!0){let{mapped:e,pos:s}=o.map(a,t);e&&(i=Math.max(i,e.maxPoint),n.push(e),r.push(s))}}let a=this.nextLayer.map(t);return n.length==0?a:new e(r,n,a||e.empty,i)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],a=this.chunk[r];if(t>=i&&e<=i+a.length&&a.between(i,e-i,t-i,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return ov.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return ov.from(e).goto(t)}static compare(e,t,n,r,i=-1){let a=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),s=o_(a,o,n),c=new sv(a,s,i),l=new sv(o,s,i);n.iterGaps((e,t,n)=>c_(c,e,l,t,n,r)),n.empty&&n.length==0&&c_(c,0,l,0,0,r)}static eq(e,t,n=0,r){r??=999999999;let i=e.filter(e=>!e.isEmpty&&t.indexOf(e)<0),a=t.filter(t=>!t.isEmpty&&e.indexOf(t)<0);if(i.length!=a.length)return!1;if(!i.length)return!0;let o=o_(i,a),s=new sv(i,o,0).goto(n),c=new sv(a,o,0).goto(n);for(;;){if(s.to!=c.to||!l_(s.active,c.active)||s.point&&(!c.point||!r_(s.point,c.point)))return!1;if(s.to>r)return!0;s.next(),c.next()}}static spans(e,t,n,r,i=-1){let a=new sv(e,null,i).goto(t),o=t,s=a.openStart;for(;;){let e=Math.min(a.to,n);if(a.point){let n=a.activeForPoint(a.to),i=a.pointFrom<t?n.length+1:a.point.startSide<0?n.length:Math.min(n.length,s);r.point(o,e,a.point,n,i,a.pointRank),s=Math.min(a.openEnd(e),n.length)}else e>o&&(r.span(o,e,a.active,s),s=a.openEnd(e));if(a.to>n)return s+(a.point&&a.to>n?1:0);o=a.to,a.next()}}static of(e,t=!1){let n=new iv;for(let r of e instanceof tv?[e]:t?a_(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(t){if(!t.length)return e.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=e.empty;i=i.nextLayer)n=new e(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}},rv.empty=new rv([],[],null,-1),rv.empty.nextLayer=rv.empty,iv=class e{finishChunk(e){this.chunks.push(new nv(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||=new e).add(t,n,r)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(rv.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=rv.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}},av=class{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}},ov=class e{constructor(e){this.heap=e}static from(t,n=null,r=-1){let i=[];for(let e=0;e<t.length;e++)for(let a=t[e];!a.isEmpty;a=a.nextLayer)a.maxPoint>=r&&i.push(new av(a,n,r,e));return i.length==1?i[0]:new e(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)s_(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)s_(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),s_(this.heap,0)}}},sv=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=ov.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){u_(this.active,e),u_(this.activeTo,e),u_(this.activeRank,e),this.minActive=f_(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;d_(this.active,t,n),d_(this.activeTo,t,r),d_(this.activeRank,t,i),e&&d_(e,t,this.cursor.from),this.minActive=f_(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&u_(n,r)}else if(!this.cursor.value){this.to=this.endSide=1e9;break}else if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let e=this.cursor.value;if(!e.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}})),lv,uv,dv,fv,pv,mv,hv,gv=n((()=>{lv=`ͼ`,uv=typeof Symbol>`u`?`__`+lv:Symbol.for(lv),dv=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),fv=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},pv=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=fv[uv]||1;return fv[uv]=e+1,lv+e.toString(36)}static mount(e,t,n){let r=e[dv],i=n&&n.nonce;r?i&&r.setNonce(i):r=new hv(e,i),r.mount(Array.isArray(t)?t:[t],e)}},mv=new Map,hv=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=mv.get(n);if(t)return e[dv]=t;this.sheet=new r.CSSStyleSheet,mv.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[dv]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let a=e[t],o=this.modules.indexOf(a);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),o==-1){if(this.modules.splice(i++,0,a),n)for(let e=0;e<a.rules.length;e++)n.insertRule(a.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+` +`;this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}}}));function _v(e){var t=!(bv&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||xv&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?yv:vv)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var vv,yv,bv,xv,Sv,Cv=n((()=>{for(vv={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},yv={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},bv=typeof navigator<`u`&&/Mac/.test(navigator.platform),xv=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Sv=0;Sv<10;Sv++)vv[48+Sv]=vv[96+Sv]=String(Sv);for(Sv=1;Sv<=24;Sv++)vv[Sv+111]=`F`+Sv;for(Sv=65;Sv<=90;Sv++)vv[Sv]=String.fromCharCode(Sv+32),yv[Sv]=String.fromCharCode(Sv);for(var e in vv)yv.hasOwnProperty(e)||(yv[e]=vv[e])}));function wv(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)Tv(e,arguments[t]);return e}function Tv(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)Tv(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}var Ev=n((()=>{})),Dv=i({BidiSpan:()=>SS,BlockInfo:()=>QC,BlockType:()=>aS,BlockWrapper:()=>lS,Decoration:()=>q,Direction:()=>mS,EditorView:()=>J,GutterMarker:()=>MT,MatchDecorator:()=>qw,RectangleMarker:()=>Lw,ViewPlugin:()=>US,ViewUpdate:()=>tC,WidgetType:()=>iS,__test:()=>$T,closeHoverTooltips:()=>wT,crosshairCursor:()=>vx,drawSelection:()=>$b,dropCursor:()=>rx,getDialog:()=>Mx,getDrawSelectionConfig:()=>ex,getPanel:()=>kx,getTooltip:()=>Tx,gutter:()=>Px,gutterLineClass:()=>NT,gutterWidgetClass:()=>PT,gutters:()=>Fx,hasHoverTooltips:()=>Ex,highlightActiveLine:()=>dx,highlightActiveLineGutter:()=>Hx,highlightSpecialChars:()=>sx,highlightTrailingWhitespace:()=>Gx,highlightWhitespace:()=>Wx,hoverTooltip:()=>wx,keymap:()=>Mw,layer:()=>Qb,lineNumberMarkers:()=>HT,lineNumberWidgetMarker:()=>UT,lineNumbers:()=>Bx,logException:()=>gy,panels:()=>Ox,placeholder:()=>fx,rectangularSelection:()=>_x,repositionTooltips:()=>Dx,runScopeHandlers:()=>Gb,scrollPastEnd:()=>ux,showDialog:()=>jx,showPanel:()=>OT,showTooltip:()=>_T,tooltips:()=>yx});function Ov(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}function kv(e,t,n){if(e==t)return!0;e||=rS,t||=rS;let r=Object.keys(e),i=Object.keys(t);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function Av(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function jv(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function Mv(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}function Nv(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function Pv(e,t){return e==t||!!(e&&t&&e.compare(t))}function Fv(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}function Iv(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function Lv(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function Rv(e,t){if(!t.anchorNode)return!1;try{return Lv(e,t.anchorNode)}catch{return!1}}function zv(e){return e.nodeType==3?Zv(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function Bv(e,t,n,r){return n?Uv(e,t,n,r,-1)||Uv(e,t,n,r,1):!1}function Vv(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function Hv(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function Uv(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Wv(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||n.nodeType!=1)return!1;t=Vv(e)+(i<0?0:1),e=n}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable==`false`)return!1;t=i<0?Wv(e):0}else return!1}}function Wv(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Gv(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function Kv(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function qv(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function Jv(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(u.nodeType==1){let e,f=u==c.body,p=1,m=1;if(f)e=Kv(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:p,scaleY:m}=qv(u,t)),e={left:t.left,right:t.left+u.clientWidth*p,top:t.top,bottom:t.top+u.clientHeight*m}}let h=0,g=0;if(i==`nearest`)t.top<e.top+o?(g=t.top-(e.top+o),n>0&&t.bottom>e.bottom+g&&(g=t.bottom-e.bottom+o)):t.bottom>e.bottom-o&&(g=t.bottom-e.bottom+o,n<0&&t.top-g<e.top&&(g=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;g=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}if(r==`nearest`?t.left<e.left+a?(h=t.left-(e.left+a),n>0&&t.right>e.right+h&&(h=t.right-e.right+a)):t.right>e.right-a&&(h=t.right-e.right+a,n<0&&t.left<e.left+h&&(h=t.left-(e.left+a))):h=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left,h||g)if(f)l.scrollBy(h,g);else{let e=0,n=0;if(g){let e=u.scrollTop;u.scrollTop+=g/m,n=(u.scrollTop-e)*m}if(h){let t=u.scrollLeft;u.scrollLeft+=h/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-h)<1&&(r=`nearest`),n&&Math.abs(n-g)<1&&(i=`nearest`)}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function Yv(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}function Xv(e){if(e.setActive)return e.setActive();if(dS)return e.focus(dS);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(dS==null?{get preventScroll(){return dS={preventScroll:!0},!0}}:void 0),!dS){dS=!1;for(let e=0;e<t.length;){let n=t[e++],r=t[e++],i=t[e++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=i&&(n.scrollLeft=i)}}}function Zv(e,t,n=t){let r=fS||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function Qv(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function $v(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function ey(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,Wv(n));;)if(r){if(n.nodeType!=1)return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=Wv(n))}else if(n==e)return!0;else r=Vv(n),n=n.parentNode}function ty(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function ny(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r>0)return{node:n,offset:r};else if(n.nodeType==1&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=Wv(n)}else if(n.parentNode&&!Hv(n))r=Vv(n),n=n.parentNode;else return null}function ry(e,t){for(let n=e,r=t;;)if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};else if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Hv(n))r=Vv(n)+1,n=n.parentNode;else return null}function iy(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}function ay(e){return e<=247?_S[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?vS[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}function oy(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!oy(r.inner,i.inner))return!1}return!0}function sy(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=ay(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),CS[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=CS[e];if(i==128)e<s-1&&t==CS[e+1]&&t&24?i=CS[e]=t:CS[e]=256;else if(i==64){let i=e+1;for(;i<s&&CS[i]==64;)i++;let a=e&&t==8||i<n&&CS[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)CS[t]=a;e=i-1}else i==8&&r==1&&(CS[e]=1);t=i,i&7&&(r=i)}}}function cy(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=yS[n=e.charCodeAt(t)])if(r<0){for(let e=s-3;e>=0;e-=3)if(bS[e+1]==-r){let n=bS[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(CS[t]=CS[bS[e]]=r),s=e;break}}else if(bS.length==189)break;else bS[s++]=t,bS[s++]=n,bS[s++]=c;else if((o=CS[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=bS[t+2];if(n&2)break;if(e)bS[t+2]|=2;else{if(n&4)break;bS[t+2]|=4}}}}}function ly(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=CS[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(CS[o]==256)o++;else break;let l=a==1,u=l==((o<t?CS[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),CS[--t]=u;c=o}else a=o,c++}}}function uy(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=CS[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(CS[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new SS(c,m.from,f)),dy(e,m.direction==hS==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?CS[p]!=s:CS[p]==s))break;else p++;d?uy(e,c,p,r+1,i,d,o):c<p&&o.push(new SS(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=CS[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(CS[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new SS(m.to,c,f)),dy(e,m.direction==hS==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?CS[p-1]!=s:CS[p-1]==s))break;else p--;d?uy(e,p,c,r+1,i,d,o):p<c&&o.push(new SS(p,c,f)),c=p}}function dy(e,t,n,r,i,a,o){let s=t%2?2:1;sy(e,i,a,r,s),cy(e,i,a,r,s),ly(i,a,r,s),uy(e,i,a,t,n,r,o)}function fy(e,t,n){if(!e)return[new SS(0,0,+(t==gS))];if(t==hS&&!n.length&&!xS.test(e))return py(e.length);if(n.length)for(;e.length>CS.length;)CS[CS.length]=256;let r=[],i=t==hS?0:1;return dy(e,i,i,n,0,e.length,r),r}function py(e){return[new SS(0,e,0)]}function my(e,t,n,r,i){let a=r.head-e.from,o=SS.find(t,a,r.bidiLevel??-1,r.assoc),s=t[o],c=s.side(i,n);if(a==c){let e=o+=i?1:-1;if(e<0||e>=t.length)return null;s=t[o=e],a=s.side(!i,n),c=s.side(i,n)}let l=Dg(e.text,a,s.forward(i,n));(l<s.from||l>s.to)&&(l=c),wS=e.text.slice(Math.min(a,l),Math.max(a,l));let u=o==(i?t.length-1:0)?null:t[o+(i?1:-1)];return u&&l==c&&u.level+ +!i<s.level?U.cursor(u.side(!i,n)+e.from,u.forward(i,n)?1:-1,u.level):U.cursor(l+e.from,s.forward(i,n)?-1:1,s.level)}function hy(e,t,n){for(let r=t;r<n;r++){let t=ay(e.charCodeAt(r));if(t==1)return hS;if(t==2||t==4)return gS}return hS}function gy(e,t,n){let r=e.facet(OS);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+`:`,t):console.error(t))}function _y(e,t){let n=e.state.facet(ZS);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return rv.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let n=r[e].spec.bidiIsolate,i;if(n??=hy(t.text,o,s),a>0&&c.length&&(i=c[c.length-1]).to==o&&i.direction==n)i.to=s,c=i.inner;else{let e={from:o,to:s,direction:n,inner:[]};c.push(e),c=e.inner}}}}),i}function vy(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(QS)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}function yy(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}function by(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=zv(t);return n[n.length-1]||null}function xy(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}function Sy(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function Cy(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}function wy(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r?e:(e||={class:`cm-line`},n&&Ov(n,e),r&&(e.class+=` `+r),e)}function Ty(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof cC&&t.push(r.mark)}return t}function Ey(e){let t=rC.get(e);return t&&t.setDOM(e.cloneNode()),e}function Dy(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)Dy(n,t)}}function Oy(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function ky(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=ny(n.focusNode,n.focusOffset),i=ry(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=rC.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=rC.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function Ay(e,t,n){let r=ky(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new eC(c.mapPos(a),c.mapPos(o),a,o),text:i}}function jy(e,t){return e.nodeType==1?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}function My(e,t,n){let r=new CC;return rv.compare(e,t,n,r),r.changes}function Ny(e,t,n){let r=new wC;return rv.compare(e,t,n,r),r.changes}function Py(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable==`false`)return!0;return!1}function Fy(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}function Iy(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return U.cursor(t);a==0?n=1:a==i.length&&(n=-1);let o=a,s=a;n<0?o=Dg(i.text,a,!1):s=Dg(i.text,a);let c=r(i.text.slice(o,s));for(;o>0;){let e=Dg(i.text,o,!1);if(r(i.text.slice(e,o))!=c)break;o=e}for(;s<i.length;){let e=Dg(i.text,s);if(r(i.text.slice(s,e))!=c)break;s=e}return U.range(o+i.from,s+i.from)}function Ly(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,r=Math.floor((i-n.top-(e.defaultLineHeight-t)*.5)/t);a+=r*e.viewState.heightOracle.lineLength}let o=e.state.sliceDoc(n.from,n.to);return n.from+m_(o,a,e.state.tabSize)}function Ry(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==aS.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function zy(e,t,n,r){let i=Ry(e,t.head,t.assoc||-1),a=!r||i.type!=aS.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(i.from),o=e.posAtCoords({x:n==(r==mS.LTR)?t.right-1:t.left+1,y:(a.top+a.bottom)/2});if(o!=null)return U.cursor(o,n?-1:1)}return U.cursor(n?i.to:i.from,n?-1:1)}function By(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),o=e.textDirectionAt(i.from);for(let s=t,c=null;;){let t=my(i,a,o,s,n),l=wS;if(!t){if(i.number==(n?e.state.doc.lines:1))return s;l=` +`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),t=e.visualLineSide(i,!n)}if(!c){if(!r)return t;c=r(l)}else if(!c(l))return s;s=t}}function Vy(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==X_.Space&&(i=t),i==t}}function Hy(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return U.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),u=e.documentTop;if(l)o??=l.left-c.left,s=a<0?l.top:l.bottom;else{let t=e.viewState.lineBlockAt(i);o??=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-t.from)),s=(a<0?t.top:t.bottom)+u}let d=c.left+o,f=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=Ky(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return U.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return U.cursor(i.pos,i.assoc,void 0,o)}}function Uy(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function Wy(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let t=Uy(e,i.from,0);t!=i.from&&(a=U.cursor(t,-1))}else{let t=Uy(e,i.from,-1),n=Uy(e,i.to,1);(t!=i.from||n!=i.to)&&(a=U.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?U.create(n,t.mainIndex):t}function Gy(e,t,n){let r=Uy(e.state.facet(XS).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:U.cursor(r,r<n.from?1:-1)}function Ky(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new EC(0,1);if(c>e.viewState.docHeight)return new EC(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==aS.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==aS.Text){let t=Ly(e,i,l,o,s);return new EC(t,t==l.from?1:-1)}}if(l.type!=aS.Text)return c<(l.top+l.bottom)/2?new EC(l.from,1):new EC(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new DC(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}function qy(e,t,n){for(;;){if(!t||n<Wv(t))return!1;if(t==e)return!0;n=Vv(t)+1,t=t.parentNode}}function Jy(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let t=rC.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}function Yy(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return Yy(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}else if(e.isText())return{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling};else return null}function Xy(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,s=a.from,c=null;(o===8||K.android&&t.text.length<r-e)&&(s=a.to,c=`end`);let l=i.doc.sliceString(e,r,OC),u,d;!a.empty&&a.from>=e&&a.to<=r&&(t.typeOver||l!=t.text)&&l.slice(0,a.from-e)==t.text.slice(0,a.from-e)&&l.slice(a.to-e)==t.text.slice(u=t.text.length-(l.length-(a.to-e)))?n={from:a.from,to:a.to,insert:h_.of(t.text.slice(a.from-e,u).split(OC))}:(d=$y(l,t.text,s-e,c))&&(K.chrome&&o==13&&d.toB==d.from+2&&t.text.slice(d.from,d.toB)==OC+OC&&d.toB--,n={from:e+d.from,to:e+d.toA,insert:h_.of(t.text.slice(d.from,d.toB).split(OC))})}else r&&(!e.hasFocus&&i.facet(BS)||nb(r,a))&&(r=null);if(!n&&!r)return!1;if((K.mac||K.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=U.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:h_.of([n.insert.toString().replace(`.`,` `)])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:K.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==` + `&&e.lineWrapping&&(r&&=U.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:h_.of([` `])}),n)return Zy(e,n,r,o);if(r&&!nb(r,a)){let t=!1,n=`select`;return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin==`select`&&(t=!0),n=e.inputState.lastSelectionOrigin,n==`select.pointer`&&(r=Wy(i.facet(XS).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}else return!1}function Zy(e,t,n,r=-1){if(K.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(K.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==` `)&&t.insert.length==1&&t.insert.lines==2&&Qv(e.contentDOM,`Enter`,13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&Qv(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&Qv(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=Qy(e,t,n);return e.state.facet(AS).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function Qy(e,t,n){let r,i=e.state,a=i.selection.main,o=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let n=t.from<a.from?-1:1,r=n<0?a.from:a.to,s=Uy(i.facet(XS).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:U.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=a.from<t.from?i.sliceDoc(a.from,t.from):``,o=a.to>t.to?i.sliceDoc(t.to,a.to):``;r=i.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+o))}else{let o=i.changes(t),s=n&&n.main.to<=o.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let c=e.state.sliceDoc(t.from,t.to),l,u=n&&ky(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);l={from:u.from,to:u.to-e}}else l=e.state.doc.lineAt(a.head);let d=a.to-t.to;r=i.changeByRange(n=>{if(n.from==a.from&&n.to==a.to)return{changes:o,range:s||n.map(o)};let r=n.to-d,u=r-c.length;if(e.state.sliceDoc(u,r)!=c||r>=l.from&&u<=l.to)return{range:n};let f=i.changes({from:u,to:r,insert:t.insert}),p=n.to-a.to;return{changes:f,range:s?U.range(Math.max(0,s.anchor+p),Math.max(0,s.head+p)):n.map(f)}})}else r={changes:o,selection:s&&i.selection.replaceRange(s)}}let s=`input.type`;return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=`.compose`,e.inputState.compositionFirstChange&&(s+=`.start`,e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function $y(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let o=e.length,s=t.length;for(;o>0&&s>0&&e.charCodeAt(o-1)==t.charCodeAt(s-1);)o--,s--;if(r==`end`){let e=Math.max(0,a-Math.min(o,s));n-=o+e-a}if(o<a&&e.length<t.length){let e=n<=a&&n>=o?a-n:0;a-=e,s=a+(s-o),o=a}else if(s<a){let e=n<=a&&n>=s?a-n:0;a-=e,o=a+(o-s),s=a}return{from:a,toA:o,toB:s}}function eb(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new AC(n,r)),(i!=n||a!=r)&&t.push(new AC(i,a))),t}function tb(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?U.single(n+t,r+t):null}function nb(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}function rb(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(e){gy(n.state,e)}}}function ib(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let t of e){let e=t.spec,r=e&&e.plugin.domEventHandlers,i=e&&e.plugin.domEventObservers;if(r)for(let e in r){let i=r[e];i&&n(e).handlers.push(rb(t.value,i))}if(i)for(let e in i){let r=i[e];r&&n(e).observers.push(rb(t.value,r))}}for(let e in RC)n(e).handlers.push(RC[e]);for(let e in zC)n(e).observers.push(zC[e]);return t}function ab(e){return Math.max(0,e)*.7+8}function ob(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}function sb(e,t){let n=e.state.facet(TS);return n.length?n[0](t):K.mac?t.metaKey:t.ctrlKey}function cb(e,t){let n=e.state.facet(ES);return n.length?n[0](t):K.mac?!t.altKey:!t.ctrlKey}function lb(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=Iv(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let e=0;e<i.length;e++){let n=i[e];if(n.left<=t.clientX&&n.right>=t.clientX&&n.top<=t.clientY&&n.bottom>=t.clientY)return!0}return!1}function ub(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=rC.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}function db(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement(`textarea`));n.style.cssText=`position: fixed; left: -10000px; top: 10px`,n.focus(),setTimeout(()=>{e.focus(),n.remove(),pb(e,n.value)},50)}function fb(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function pb(e,t){t=fb(e.state,MS,t);let{state:n}=e,r,i=1,a=n.toText(t),o=a.lines==n.selection.ranges.length;if(GC!=null&&n.selection.ranges.every(e=>e.empty)&&GC==a.toString()){let e=-1;r=n.changeByRange(r=>{let s=n.doc.lineAt(r.from);if(s.from==e)return{range:r};e=s.from;let c=n.toText((o?a.line(i++).text:t)+n.lineBreak);return{changes:{from:s.from,insert:c},range:U.cursor(r.from+c.length)}})}else r=o?n.changeByRange(e=>{let t=a.line(i++);return{changes:{from:e.from,to:e.to,insert:t.text},range:U.cursor(e.from+t.length)}}):n.replaceSelection(a);e.dispatch(r,{userEvent:`input.paste`,scrollIntoView:!0})}function mb(e,t,n,r){if(r==1)return U.cursor(t,n);if(r==2)return Iy(e.state,t,n);{let r=e.docView.lineAt(t,n),i=e.state.doc.lineAt(r?r.posAtEnd:t),a=r?r.posAtStart:i.from,o=r?r.posAtEnd:i.to;return o<e.state.doc.length&&o==i.to&&o++,U.range(a,o)}}function hb(e){if(!VC)return e.detail;let t=HC,n=WC;return HC=e,WC=Date.now(),UC=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(UC+1)%3:1}function gb(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=hb(t),i=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),i=i.map(e.changes))},get(t,a,o){let s=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c,l=mb(e,s.pos,s.assoc,r);if(n.pos!=s.pos&&!a){let t=mb(e,n.pos,n.assoc,r),i=Math.min(t.from,l.from),a=Math.max(t.to,l.to);l=i<l.from?U.range(i,a,l.assoc):U.range(a,i,l.assoc)}return a?i.replaceRange(i.main.extend(l.from,l.to,l.assoc)):o&&r==1&&i.ranges.length>1&&(c=_b(i,s.pos))?c:o?i.addRange(l):U.create([l])}}}function _b(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return U.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-+(e.mainIndex>n))}return null}function vb(e,t,n,r){if(n=fb(e.state,MS,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,o=r&&a&&cb(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(o?[o,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:o?`move.drop`:`input.drop`}),e.inputState.draggedContent=null}function yb(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement(`textarea`));r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function bb(e){let t=[],n=[],r=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let i=-1;for(let{from:r}of e.selection.ranges){let a=e.doc.lineAt(r);a.number>i&&(t.push(a.text),n.push({from:a.from,to:Math.min(e.doc.length,a.to+1)})),i=a.number}r=!0}return{text:fb(e,NS,t.join(e.lineBreak)),ranges:n,linewise:r}}function xb(e,t){let n=[];for(let r of e.facet(jS)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:KC.of(!0)}):null}function Sb(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=xb(e.state,t);n?e.dispatch(n):e.update([])}},10)}function Cb(e){qC.has(e)||(qC.add(e),e.addEventListener(`copy`,()=>{}),e.addEventListener(`cut`,()=>{}))}function wb(){YC=!1}function Tb(e,t){return e==t?e:(e.constructor!=t.constructor&&(YC=!0),t)}function Eb(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof aw&&(r=e[t+1])instanceof aw&&e.splice(t-1,3,new aw(n.length+1+r.length))}function Db(e,t,n){let r=new lw;return rv.compare(e,t,n,r,0),r.changes}function Ob(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let t=e.parentNode;t&&t!=r.body;)if(t.nodeType==1){let n=t,r=window.getComputedStyle(n);if((n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)&&r.overflow!=`visible`){let r=n.getBoundingClientRect();a=Math.max(a,r.left),o=Math.min(o,r.right),s=Math.max(s,r.top),c=Math.min(t==e.parentNode?i.innerHeight:c,r.bottom)}t=r.position==`absolute`||r.position==`fixed`?n.offsetParent:n.parentNode}else if(t.nodeType==11)t=t.host;else break;return{left:a-n.left,right:Math.max(a,o)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function kb(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function Ab(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}function jb(e,t,n){let r=[],i=e,a=0;return rv.spans(n,e,t,{span(){},point(e,t){e>i&&(r.push({from:i,to:e}),a+=e-i),i=t}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function Mb({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let e=0;;e++){let{from:n,to:i}=t[e],a=i-n;if(r<=a)return n+r;r-=a}}function Nb(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function Pb(e,t){for(let n of e)if(t(n))return n}function Fb(e){let t=e.facet(qS).filter(e=>typeof e!=`function`),n=e.facet(YS).filter(e=>typeof e!=`function`);return n.length&&t.push(rv.join(n)),t}function Ib(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new QC(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(e=>Ib(e,t)):e._content)}function Lb(e,t,n){return new pv(t,{finish(t){return/&/.test(t)?t.replace(/&\w*/,t=>{if(t==`&`)return e;if(!n||!n[t])throw RangeError(`Unsupported selector: ${t}`);return n[t]}):e+` `+t}})}function Rb(e,t,n){for(;t;){let r=rC.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i==e.dom?n>0?t.nextSibling:t.previousSibling:i}return null}function zb(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.docView.domAtPos(e.state.selection.main.anchor,1);return Bv(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Bb(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return zb(e,n)}let n=null;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.contentDOM.addEventListener(`beforeinput`,r,!0),e.dom.ownerDocument.execCommand(`indent`),e.contentDOM.removeEventListener(`beforeinput`,r,!0),n?zb(e,n):null}function Vb(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let t=r[i],a=typeof t==`function`?t(e):t;a&&Ov(a,n)}return n}function Hb(e,t){let n=e.split(/-(?!$)/),r=n[n.length-1];r==`Space`&&(r=` `);let i,a,o,s;for(let e=0;e<n.length-1;++e){let r=n[e];if(/^(cmd|meta|m)$/i.test(r))s=!0;else if(/^a(lt)?$/i.test(r))i=!0;else if(/^(c|ctrl|control)$/i.test(r))a=!0;else if(/^s(hift)?$/i.test(r))o=!0;else if(/^mod$/i.test(r))t==`mac`?s=!0:a=!0;else throw Error(`Unrecognized modifier name: `+r)}return i&&(r=`Alt-`+r),a&&(r=`Ctrl-`+r),s&&(r=`Meta-`+r),o&&(r=`Shift-`+r),r}function Ub(e,t,n){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n!==!1&&t.shiftKey&&(e=`Shift-`+e),e}function Wb(e){let t=e.facet(Mw),n=Nw.get(t);return n||Nw.set(t,n=Kb(t.reduce((e,t)=>e.concat(t),[]))),n}function Gb(e,t,n){return qb(Wb(e.state),t,e,n)}function Kb(e,t=Aw){let n=Object.create(null),r=Object.create(null),i=(e,t)=>{let n=r[e];if(n==null)r[e]=t;else if(n!=t)throw Error(`Key binding `+e+` is used both as a regular binding and as a multi-stroke prefix`)},a=(e,r,a,o,s)=>{let c=n[e]||(n[e]=Object.create(null)),l=r.split(/ (?!$)/).map(e=>Hb(e,t));for(let t=1;t<l.length;t++){let n=l.slice(0,t).join(` `);i(n,!0),c[n]||(c[n]={preventDefault:!0,stopPropagation:!1,run:[t=>{let r=Pw={view:t,prefix:n,scope:e};return setTimeout(()=>{Pw==r&&(Pw=null)},Fw),!0}]})}let u=l.join(` `);i(u,!1);let d=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(c._any?.run)?.slice()||[]});a&&d.run.push(a),o&&(d.preventDefault=!0),s&&(d.stopPropagation=!0)};for(let r of e){let e=r.scope?r.scope.split(` `):[`editor`];if(r.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||={preventDefault:!1,stopPropagation:!1,run:[]};let{any:i}=r;for(let t in e)e[t].run.push(e=>i(e,Iw))}let i=r[t]||r.key;if(i)for(let t of e)a(t,i,r.run,r.preventDefault,r.stopPropagation),r.shift&&a(t,`Shift-`+i,r.shift,r.preventDefault,r.stopPropagation)}return n}function qb(e,t,n,r){Iw=t;let i=_v(t),a=Mg(Ag(i,0))==i.length&&i!=` `,o=``,s=!1,c=!1,l=!1;Pw&&Pw.view==n&&Pw.scope==r&&(o=Pw.prefix+` `,FC.indexOf(t.keyCode)<0&&(c=!0,Pw=null));let u=new Set,d=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(n)))return e.stopPropagation&&(l=!0),!0;e.preventDefault&&(e.stopPropagation&&(l=!0),c=!0)}return!1},f=e[r],p,m;return f&&(d(f[o+Ub(i,t,!a)])?s=!0:a&&(t.altKey||t.metaKey||t.ctrlKey)&&!(K.windows&&t.ctrlKey&&t.altKey)&&!(K.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(p=vv[t.keyCode])&&p!=i?(d(f[o+Ub(p,t,!0)])||t.shiftKey&&(m=yv[t.keyCode])!=i&&m!=p&&d(f[o+Ub(m,t,!1)]))&&(s=!0):a&&t.shiftKey&&d(f[o+Ub(i,t,!0)])&&(s=!0),!s&&d(f._any)&&(s=!0)),c&&(s=!0),s&&l&&t.stopPropagation(),Iw=null,s}function Jb(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==mS.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function Yb(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let a=e.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,s=e.posAtCoords({x:a.left+1,y:o}),c=e.posAtCoords({x:a.right-1,y:o});return s==null||c==null?r:{from:Math.max(r.from,Math.min(s,c)),to:Math.min(r.to,Math.max(s,c))}}function Xb(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),a=e.textDirection==mS.LTR,o=e.contentDOM,s=o.getBoundingClientRect(),c=Jb(e),l=o.querySelector(`.cm-line`),u=l&&window.getComputedStyle(l),d=s.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=s.right-(u?parseInt(u.paddingRight):0),p=Ry(e,r,1),m=Ry(e,i,-1),h=p.type==aS.Text?p:null,g=m.type==aS.Text?m:null;if(h&&(e.lineWrapping||p.widgetLineBreaks)&&(h=Yb(e,r,1,h)),g&&(e.lineWrapping||m.widgetLineBreaks)&&(g=Yb(e,i,-1,g)),h&&g&&h.from==g.from&&h.to==g.to)return v(y(n.from,n.to,h));{let t=h?y(n.from,null,h):b(p,!1),r=g?y(null,n.to,g):b(m,!0),i=[];return(h||p).to<(g||m).from-(h&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<r.top?i.push(_(d,t.bottom,f,r.top)):t.bottom<r.top&&e.elementAtHeight((t.bottom+r.top)/2).type==aS.Text&&(t.bottom=r.top=(t.bottom+r.top)/2),v(t).concat(i).concat(v(r))}function _(e,n,r,i){return new Lw(t,e-c.left,n-c.top,Math.max(0,r-e),i-n)}function v({top:e,bottom:t,horizontal:n}){let r=[];for(let i=0;i<n.length;i+=2)r.push(_(n[i],e,n[i+1],t));return r}function y(t,n,r){let i=1e9,o=-1e9,s=[];function c(t,n,c,l,u){let p=e.coordsAtPos(t,t==r.to?-2:2),m=e.coordsAtPos(c,c==r.from?2:-2);!p||!m||(i=Math.min(p.top,m.top,i),o=Math.max(p.bottom,m.bottom,o),u==mS.LTR?s.push(a&&n?d:p.left,a&&l?f:m.right):s.push(!a&&l?d:m.left,!a&&n?f:p.right))}let l=t??r.from,u=n??r.to;for(let r of e.visibleRanges)if(r.to>l&&r.from<u)for(let i=Math.max(r.from,l),a=Math.min(r.to,u);;){let r=e.state.doc.lineAt(i);for(let o of e.bidiSpans(r)){let e=o.from+r.from,s=o.to+r.from;if(e>=a)break;s>i&&c(Math.max(e,i),t==null&&e<=l,Math.min(s,a),n==null&&s>=u,o.dir)}if(i=r.to+1,i>=a)break}return s.length==0&&c(l,t==null,u,n==null,e.textDirection),{top:i,bottom:o,horizontal:s}}function b(e,t){let n=s.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}function Zb(e,t){return e.constructor==t.constructor&&e.eq(t)}function Qb(e){return[US.define(t=>new Rw(t,e)),zw.of(e)]}function $b(e={}){return[Bw.of(e),Vw,Hw,Uw,FS.of(!0)]}function ex(e){return e.facet(Bw)}function tx(e){return e.startState.facet(Bw)!=e.state.facet(Bw)}function nx(e,t){t.style.animationDuration=e.facet(Bw).cursorBlinkRate+`ms`}function rx(){return[Gw,Kw]}function ix(e,t,n,r,i){t.lastIndex=0;for(let a=e.iterRange(n,r),o=n,s;!a.next().done;o+=a.value.length)if(!a.lineBreak)for(;s=t.exec(a.value);)i(o+s.index,s)}function ax(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:a}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),a=Math.min(e.state.doc.lineAt(a).to,a+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=a:r.push({from:i,to:a});return r}function ox(){if(Zw==null&&typeof document<`u`&&document.body){let e=document.body.style;Zw=(e.tabSize??e.MozTabSize)!=null}return Zw||!1}function sx(e={}){return[Qw.of(e),cx()]}function cx(){return $w||=US.fromClass(class{constructor(e){this.view=e,this.decorations=q.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Qw)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new qw({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=Ag(t[0],0);if(a==9){let e=i.lineAt(r),t=n.state.tabSize,a=p_(e.text,t,r-e.from);return q.replace({widget:new nT((t-a%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=q.replace({widget:new tT(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Qw);e.startState.facet(Qw)==t?this.decorations=this.decorator.updateDeco(e,this.decorations):(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view))}},{decorations:e=>e.decorations})}function lx(e){return e>=32?eT:e==10?``:String.fromCharCode(9216+e)}function ux(){return[rT,KS.of(e=>e.plugin(rT)?.attrs||null)]}function dx(){return aT}function fx(e){let t=US.fromClass(class{constructor(t){this.view=t,this.placeholder=e?q.set([q.widget({widget:new oT(e),side:1}).range(0)]):q.none}get decorations(){return this.view.state.doc.length?q.none:this.placeholder}},{decorations:e=>e.decorations});return typeof e==`string`?[t,J.contentAttributes.of({"aria-placeholder":e})]:t}function px(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>sT||n.off>sT||t.col<0||n.col<0){let o=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=s&&a.push(U.range(n.from+o,n.to+s))}}else{let o=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=m_(n.text,o,e.tabSize,!0);if(r<0)a.push(U.cursor(n.to));else{let t=m_(n.text,s,e.tabSize);a.push(U.range(n.from+r,n.from+t))}}}return a}function mx(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function hx(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,a=i>sT?-1:i==r.length?mx(e,t.clientX):p_(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function gx(e,t){let n=hx(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get(t,i,a){let o=hx(e,t);if(!o)return r;let s=px(e.state,n,o);return s.length?a?U.create(s.concat(r.ranges)):U.create(s):r}}:null}function _x(e){let t=e?.eventFilter||(e=>e.altKey&&e.button==0);return J.mouseSelectionStyle.of((e,n)=>t(n)?gx(e,n):null)}function vx(e={}){let[t,n]=cT[e.key||`Alt`],r=US.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){(e.keyCode==t||!n(e))&&this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,J.contentAttributes.of(e=>e.plugin(r)?.isDown?lT:null)]}function yx(e={}){return fT.of(e)}function bx(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}function xx(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+`px`)}function Sx(e,t){let{left:n,right:r,top:i,bottom:a}=e.getBoundingClientRect(),o;if(o=e.querySelector(`.cm-tooltip-arrow`)){let e=o.getBoundingClientRect();i=Math.min(e.top,i),a=Math.max(e.bottom,a)}return t.clientX>=n-ST&&t.clientX<=r+ST&&t.clientY>=i-ST&&t.clientY<=a+ST}function Cx(e,t,n,r,i,a){let o=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,s)<i)return!1;let c=e.posAtCoords({x:r,y:i},!1);return c>=t&&c<=n}function wx(e,t={}){let n=G.define(),r=j_.define({create(){return[]},update(e,r){if(e.length&&(t.hideOnChange&&(r.docChanged||r.selection)?e=[]:t.hideOn&&(e=e.filter(e=>!t.hideOn(r,e))),r.docChanged)){let t=[];for(let n of e){let e=r.changes.mapPos(n.pos,-1,C_.TrackDel);if(e!=null){let i=Object.assign(Object.create(null),n);i.pos=e,i.end!=null&&(i.end=r.changes.mapPos(i.end)),t.push(i)}}e=t}for(let t of r.effects)t.is(n)&&(e=t.value),t.is(CT)&&(e=[]);return e},provide:e=>vT.from(e)});return{active:r,extension:[r,US.define(i=>new xT(i,e,r,n,t.hoverTime||300)),bT]}}function Tx(e,t){let n=e.plugin(mT);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}function Ex(e){return e.facet(vT).some(e=>e)}function Dx(e){let t=e.plugin(mT);t&&t.maybeMeasure()}function Ox(e){return e?[TT.of(e)]:[]}function kx(e,t){let n=e.plugin(ET),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}function Ax(e){let t=e.nextSibling;return e.remove(),t}function jx(e,t){let n,r=new Promise(e=>n=e),i=e=>Nx(e,t,n);e.state.field(kT,!1)?e.dispatch({effects:AT.of(i)}):e.dispatch({effects:G.appendConfig.of(kT.init(()=>[i]))});let a=jT.of(i);return{close:a,result:r.then(t=>((e.win.queueMicrotask||(t=>e.win.setTimeout(t,10)))(()=>{e.state.field(kT).indexOf(i)>-1&&e.dispatch({effects:a})}),t))}}function Mx(e,t){let n=e.state.field(kT,!1)||[];for(let r of n){let n=kx(e,r);if(n&&n.dom.classList.contains(t))return n}return null}function Nx(e,t,n){let r=t.content?t.content(e,()=>o(null)):null;if(!r){if(r=wv(`form`),t.input){let e=wv(`input`,t.input);/^(text|password|number|email|tel|url)$/.test(e.type)&&e.classList.add(`cm-textfield`),e.name||=`input`,r.appendChild(wv(`label`,(t.label||``)+`: `,e))}else r.appendChild(document.createTextNode(t.label||``));r.appendChild(document.createTextNode(` `)),r.appendChild(wv(`button`,{class:`cm-button`,type:`submit`},t.submitLabel||`OK`))}let i=r.nodeName==`FORM`?[r]:r.querySelectorAll(`form`);for(let e=0;e<i.length;e++){let t=i[e];t.addEventListener(`keydown`,e=>{e.keyCode==27?(e.preventDefault(),o(null)):e.keyCode==13&&(e.preventDefault(),o(t))}),t.addEventListener(`submit`,e=>{e.preventDefault(),o(t)})}let a=wv(`div`,r,wv(`button`,{onclick:()=>o(null),"aria-label":e.state.phrase(`close`),class:`cm-dialog-close`,type:`button`},[`×`]));t.class&&(a.className=t.class),a.classList.add(`cm-dialog`);function o(t){a.contains(a.ownerDocument.activeElement)&&e.focus(),n(t)}return{dom:a,top:t.top,mount:()=>{if(t.focus){let e;e=typeof t.focus==`string`?r.querySelector(t.focus):r.querySelector(`input`)||r.querySelector(`button`),e&&`select`in e?e.select():e&&`focus`in e&&e.focus()}}}}function Px(e){return[Fx(),IT.of({...FT,...e})]}function Fx(e){let t=[RT];return e&&e.fixed===!1&&t.push(LT.of(!0)),t}function Ix(e){return Array.isArray(e)?e:[e]}function Lx(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}function Rx(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}function zx(e,t){return e.state.facet(WT).formatNumber(t,e.state)}function Bx(e={}){return[WT.of(e),Fx(),KT]}function Vx(e){let t=9;for(;t<e;)t=t*10+9;return t}function Hx(){return JT}function Ux(e){return US.define(t=>({decorations:e.createDeco(t),update(t){this.decorations=e.updateDeco(t,this.decorations)}}),{decorations:e=>e.decorations})}function Wx(){return ZT}function Gx(){return QT}var Kx,qx,Jx,Yx,Xx,Zx,Qx,$x,eS,tS,nS,K,rS,iS,aS,q,oS,sS,cS,lS,uS,dS,fS,pS,mS,hS,gS,_S,vS,yS,bS,xS,SS,CS,wS,TS,ES,DS,OS,kS,AS,jS,MS,NS,PS,FS,IS,LS,RS,zS,BS,VS,HS,US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,rC,iC,aC,oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC,OC,kC,AC,jC,MC,NC,PC,FC,IC,LC,RC,zC,BC,VC,HC,UC,WC,GC,KC,qC,JC,YC,XC,ZC,QC,$C,ew,tw,nw,rw,iw,aw,ow,sw,cw,lw,uw,dw,fw,pw,mw,hw,gw,_w,vw,yw,bw,xw,Sw,Cw,ww,Tw,Ew,J,Dw,Ow,kw,Aw,jw,Mw,Nw,Pw,Fw,Iw,Lw,Rw,zw,Bw,Vw,Hw,Uw,Ww,Gw,Kw,qw,Jw,Yw,Xw,Zw,Qw,$w,eT,tT,nT,rT,iT,aT,oT,sT,cT,lT,uT,dT,fT,pT,mT,hT,gT,_T,vT,yT,bT,xT,ST,CT,wT,TT,ET,DT,OT,kT,AT,jT,MT,NT,PT,FT,IT,LT,RT,zT,BT,VT,HT,UT,WT,GT,KT,qT,JT,YT,XT,ZT,QT,$T,eE=n((()=>{cv(),gv(),Cv(),Ev(),Kx=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},qx=typeof document<`u`?document:{documentElement:{style:{}}},Jx=/Edge\/(\d+)/.exec(Kx.userAgent),Yx=/MSIE \d/.test(Kx.userAgent),Xx=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Kx.userAgent),Zx=!!(Yx||Xx||Jx),Qx=!Zx&&/gecko\/(\d+)/i.test(Kx.userAgent),$x=!Zx&&/Chrome\/(\d+)/.exec(Kx.userAgent),eS=`webkitFontSmoothing`in qx.documentElement.style,tS=!Zx&&/Apple Computer/.test(Kx.vendor),nS=tS&&(/Mobile\/\w+/.test(Kx.userAgent)||Kx.maxTouchPoints>2),K={mac:nS||/Mac/.test(Kx.platform),windows:/Win/.test(Kx.platform),linux:/Linux|X11/.test(Kx.platform),ie:Zx,ie_version:Yx?qx.documentMode||6:Xx?+Xx[1]:Jx?+Jx[1]:0,gecko:Qx,gecko_version:Qx?+(/Firefox\/(\d+)/.exec(Kx.userAgent)||[0,0])[1]:0,chrome:!!$x,chrome_version:$x?+$x[1]:0,ios:nS,android:/Android\b/.test(Kx.userAgent),webkit:eS,webkit_version:eS?+(/\bAppleWebKit\/(\d+)/.exec(Kx.userAgent)||[0,0])[1]:0,safari:tS,safari_version:tS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Kx.userAgent)||[0,0])[1]:0,tabSize:qx.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`},rS=Object.create(null),iS=class{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},aS=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(aS||={}),q=class extends ev{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new oS(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new cS(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=Nv(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new cS(e,n,r,t,e.widget||null,!0)}static line(e){return new sS(e)}static set(e,t=!1){return rv.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}},q.none=rv.empty,oS=class e extends q{constructor(e){let{start:t,end:n}=Nv(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?Ov(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||rS}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&kv(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}},oS.prototype.point=!1,sS=class e extends q{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&kv(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}},sS.prototype.mapMode=C_.TrackBefore,sS.prototype.point=!0,cS=class e extends q{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?C_.TrackBefore:C_.TrackAfter:C_.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?aS.WidgetBefore:aS.WidgetAfter:aS.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&Pv(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}},cS.prototype.point=!0,lS=class e extends ev{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&kv(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||rS)}static set(e,t=!1){return rv.of(e,t)}},lS.prototype.startSide=lS.prototype.endSide=-1,uS=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Wv(t):0),n,Math.min(e.focusOffset,n?Wv(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}},dS=null,K.safari&&K.safari_version>=26&&(dS=!1),pS=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,Vv(t),n)}static after(t,n){return new e(t.parentNode,Vv(t)+1,n)}},mS=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(mS||={}),hS=mS.LTR,gS=mS.RTL,_S=iy(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),vS=iy(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),yS=Object.create(null),bS=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);yS[t]=n,yS[n]=-t}xS=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,SS=class{get dir(){return this.level%2?gS:hS}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}},CS=[],wS=``,TS=W.define(),ES=W.define(),DS=W.define(),OS=W.define(),kS=W.define(),AS=W.define(),jS=W.define(),MS=W.define(),NS=W.define(),PS=W.define({combine:e=>e.some(e=>e)}),FS=W.define({combine:e=>e.some(e=>e)}),IS=W.define(),LS=class e{constructor(e,t,n,r,i,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e(U.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},RS=G.define({map:(e,t)=>e.map(t)}),zS=G.define(),BS=W.define({combine:e=>e.length?e[0]:!0}),VS=0,HS=W.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),US=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(HS.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(HS.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(VS++,t,r,i,e=>{let t=[];return o&&t.push(qS.of(t=>{let n=t.plugin(e);return n?o(n):q.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},WS=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(!this.value){if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){gy(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(gy(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){gy(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},GS=W.define(),KS=W.define(),qS=W.define(),JS=W.define(),YS=W.define(),XS=W.define(),ZS=W.define(),QS=W.define(),$S=W.define(),eC=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},tC=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=T_.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new eC(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},nC=[],rC=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return nC}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let e=this.domAttrs;e&&Av(this.dom,e)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:``)+(this.breakAfter?`#`:``)}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let n=Vv(this.dom),r=this.length?e>0:t>0;return new pS(this.parent.dom,n+ +!!r,e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof aC)return e;return null}static get(e){return e.cmTile}},iC=class extends rC{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=yy(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=yy(r);this.length=a}},aC=class extends iC{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=rC.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof oC)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},oC=class e extends iC{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},sC=class e extends iC{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||a.isHidden&&(t>0||n&&xy(a,d)))&&(f>c||d.flags&32)?(a=d,o=c-u):(u<c||d.flags&16&&!d.isHidden)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t){let n=this.resolveInline(e,t,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),t):by(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new pS(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new pS(e.dom,0);e==n.tile&&(a=!0)}}return new pS(this.dom,0)}},cC=class e extends iC{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},lC=class e extends rC{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let n=this.dom.nodeValue.length;e>n&&(e=n);let r=e,i=e,a=0;e==0&&t<0||e==n&&t>=0?K.chrome||K.gecko||(e?(r--,a=1):i<n&&(i++,a=-1)):t<0?r--:i<n&&i++;let o=Zv(this.dom,r,i).getClientRects();if(!o.length)return null;let s=o[(a?a<0:t>=0)?0:o.length-1];return K.safari&&!a&&s.width==0&&(s=Array.prototype.find.call(o,e=>e.width)||s),a?Gv(s,a<0):s||null}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},uC=class e extends rC{constructor(e,t,n,r){super(e,t,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return Gv(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return Gv(n,!r)}}get overrideDOMText(){if(!this.length)return h_.empty;let{root:e}=this;if(!e)return h_.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},dC=class extends rC{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return h_.empty}coordsIn(e){return this.dom.getBoundingClientRect()}},fC=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite())if(i==r.length)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(e){let t=Math.min(e,r.length-i);n&&n.skip(r,i,i+t),e-=t,i+=t}else break;else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},pC=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},mC=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new lC(a.dom,a.text+e);t.parent=i}else i.append(r||lC.of(e,this.cache.find(lC)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?Ey(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof cC&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(Ey(n.dom)),r=i;else{if(this.cache.reused.get(n)){let e=rC.get(n.dom);e&&e.setDOM(Ey(n.dom))}let e=cC.of(n.mark,n.dom);r.append(e),r=e}this.cache.reused.set(n,2)}let i=rC.get(e.text);i&&this.cache.reused.set(i,2);let a=new lC(e.text,e.text.nodeValue);a.flags|=8,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=yC;let n=sC.start(e,t||this.cache.find(sC)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof cC&&a.mark.eq(i))n=a,t--;else{let e=cC.of(i,this.cache.find(cC,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!Sy(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(K.ios&&Sy(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(xC,0,32)||new uC(xC.toDOM(),0,xC,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new pC(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-t.rank||this.wrappers[n-1].to-t.to)<0;)n--;this.wrappers.splice(n,0,t)}this.wrapperPos=this.pos}getBlockPos(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof oC&&n.wrapper.eq(t.wrapper))e=n;else{let n=oC.of(t.wrapper,this.cache.find(oC,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(dC,void 0,1);return n&&(n.flags=t),n||new dC(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},hC=class{constructor(e){this.skipCount=0,this.text=``,this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text=``,this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},gC=[uC,sC,lC,cC,dC,oC,aC];for(let e=0;e<gC.length;e++)gC[e].bucket=e;_C=class{constructor(e){this.view=e,this.buckets=gC.map(()=>[]),this.index=gC.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=i.length-1;e>=0;e--){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new uC(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},vC=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new _C(e),this.text=new hC(e.state.doc),this.builder=new mC(this.cache,new aC(e,e.contentDOM),rv.iter(n)),this.cache.reused.set(t,2),this.old=new fC(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=Ty(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget())if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?uC.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length&&!this.cache.reused.has(e)?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof dC)this.cache.add(e);else if(e instanceof cC)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof cC&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof cC&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=0,a=rv.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof cS){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?bC.block:bC.inline),c=Cy(a),l=this.cache.findWidget(i,t-e,c)||uC.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=wy(n,a);t>e&&this.text.skip(t-e)},span:(e,t,i,a)=>{for(let o=e;o<t;){let s=this.text.next(Math.min(512,t-o));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),o++):(r.ensureLine(n),r.addText(s,i,o==e?a:i.length),o+=s.length),n=null}}});r.addLineStartIfNotCovered(n),this.openWidget=a>i,this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=rC.get(r);if(r==this.view.contentDOM)break;e instanceof cC?t.push(e):e?.isLine()?n=e:e instanceof oC||(r.nodeName==`DIV`&&!n&&r!=this.view.contentDOM?n=new sC(r,yC):n||t.push(cC.of(new oS({tagName:r.nodeName.toLowerCase(),attributes:Mv(r)}),r)))}return{line:n,marks:t}}},yC={class:`cm-line`},bC=class extends iS{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}},bC.inline=new bC(`span`),bC.block=new bC(`div`),xC=new class extends iS{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},SC=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=q.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new aC(e,e.contentDOM),this.updateInner([new eC(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!Fy(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?Ay(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new eC(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(K.ie||K.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=My(i,this.decorations,e.changes);o.length&&(t=eC.extendWithRanges(t,o));let s=Ny(a,this.blockWrappers,e.changes);return s.length&&(t=eC.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new vC(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&rC.get(t.text)&&r.cache.reused.set(rC.get(t.text),2),this.tile=r.run(e,t),Dy(n,r.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+`px`,this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+`px`:``;let r=K.chrome||K.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof TC&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(zS)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(BS)||n.tabIndex>-1)&&Rv(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),K.gecko&&s.empty&&!this.hasComposition&&Oy(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new pS(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!Bv(c.node,c.offset,u.anchorNode,u.anchorOffset)||!Bv(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{K.android&&K.chrome&&n.contains(u.focusNode)&&Py(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=Iv(this.view.root);if(e)if(s.empty){if(K.gecko){let e=jy(c.node,c.offset);if(e&&e!=3){let t=(e==1?ny:ry)(c.node,c.offset);t&&(c=new pS(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new pS(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new pS(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Bv(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=Iv(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=Wv(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!rC.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(e,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.widget instanceof TC?null:n.coordsInWidget(r,t,!0):n.coordsIn(r,t)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:n}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=r(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let n=Dg(e.text,t);if(n==t)return null;let r=Zv(e.dom,t,n).getClientRects();for(let e=0;e<r.length;e++){let t=r[e];if(e==r.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return r(t,n)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==mS.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof oC)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?zv(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?mS.RTL:mS.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=zv(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=zv(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(q.replace({widget:new TC(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return q.set(e)}updateDeco(){let e=1,t=this.view.state.facet(qS).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(YS).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(rv.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(JS).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(IS))try{if(t(this.view,e.range,e))return!0}catch(e){gy(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.assoc??(t.empty?0:t.head>t.anchor?-1:1)),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let i=vy(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;if(Jv(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==mS.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);e&&e.dom.scrollIntoView({block:`nearest`})}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Dy(this.tile)}},CC=class{constructor(){this.changes=[]}compareRange(e,t){Fv(e,t,this.changes)}comparePoint(e,t){Fv(e,t,this.changes)}boundChange(e){Fv(e,e,this.changes)}},wC=class{constructor(){this.changes=[]}compareRange(e,t){Fv(e,t,this.changes)}comparePoint(){}boundChange(e){Fv(e,e,this.changes)}},TC=class extends iS{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement(`div`);return e.className=`cm-gap`,this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+`px`,!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},EC=class{constructor(e,t){this.pos=e,this.assoc=t}},DC=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[SS.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[SS.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t){let n=0,r=e.length-1,i=new Set,a=this.bidiIn(e[0],e[r]),o,s,c=-1,l=1e9,u;search:for(;n<r;){let d=r-n,f=n+r>>1;adjust:if(i.has(f)){let e=n+Math.floor(Math.random()*d);for(let t=0;t<d;t++){if(!i.has(e)){f=e;break adjust}e++,e==r&&(e=n)}break search}i.add(f);let p=t(f);if(p)for(let t=0;t<p.length;t++){let i=p[t],d=0;if(!(i.width==0&&p.length>1)){if(i.bottom<this.y)(!o||o.bottom<i.bottom)&&(o=i),d=1;else if(i.top>this.y)(!s||s.top>i.top)&&(s=i),d=-1;else{let e=i.left>this.x?this.x-i.left:i.right<this.x?this.x-i.right:0,t=Math.abs(e);t<l&&(c=f,l=t,u=i),e&&(d=e<0==(this.baseDir==mS.LTR)?-1:1)}d==-1&&(!a||this.baseDirAt(e[f],1))?r=f:d==1&&(!a||this.baseDirAt(e[f+1],-1))&&(n=f+1)}}}if(!u){let n=o&&(!s||this.y-o.bottom<s.top-this.y)?o:s;return this.y=(n.top+n.bottom)/2,this.scan(e,t)}if(l){let{top:n,bottom:r}=u;if(o&&o.bottom>(n+n+r)/3)return this.y=o.bottom-1,this.scan(e,t);if(s&&s.top<(n+r+r)/3)return this.y=s.top+1,this.scan(e,t)}let d=(a?this.dirAt(e[c],1):this.baseDir)==mS.LTR;return{i:c,after:this.x>(u.left+u.right)/2==d}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=Dg(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return Zv(e.dom,i,a).getClientRects()});return r.after?new EC(n[r.i+1],-1):new EC(n[r.i],1)}scanTile(e,t){if(!e.length)return new EC(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:Zv(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new EC(n[r.i+1],-1):new EC(a,1)}},OC=``,kC=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet($_.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=OC}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=rC.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=rC.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:Hv(r))||Hv(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!Jy(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=rC.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(qy(e,n.node,n.offset)?t:0))}},AC=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},jC=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:i,impreciseAnchor:a}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=Yy(e.docView.tile,t,n,0))){let t=i||a?[]:eb(e),n=new kC(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=tb(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!Lv(e.contentDOM,t.focusNode)?o.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=a&&a.node==t.anchorNode&&a.offset==t.anchorOffset||!Lv(e.contentDOM,t.anchorNode)?o.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),s=e.viewport;if((K.ios||K.chrome)&&o.main.empty&&n!=r&&(s.from>0||s.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=s.from-t,o=s.to-i;(a==0||a==1||t==0)&&(o==0||o==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(U.range(r,n));else if(e.lineWrapping&&r==n&&!(o.main.empty&&o.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=U.create([U.cursor(n,r)])}else this.newSel=U.single(r,n)}}},MC=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText=``,this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,K.safari&&e.contentDOM.addEventListener(`input`,()=>null),K.gecko&&Cb(e.contentDOM.ownerDocument)}handleEvent(e){!ub(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.resolve().then(()=>this.runHandlers(e.type,e)))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=ib(e),n=this.handlers,r=this.view.contentDOM;for(let e in t)if(e!=`scroll`){let i=!t[e].handlers.length,a=n[e];a&&i!=!a.handlers.length&&(r.removeEventListener(e,this.handleEvent),a=null),a||r.addEventListener(e,this.handleEvent,{passive:i})}for(let e in n)e!=`scroll`&&!t[e]&&r.removeEventListener(e,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&FC.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),K.android&&K.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return K.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=NC.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||PC.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key==`Enter`&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Qv(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:K.safari&&!K.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}},NC=[{key:`Backspace`,keyCode:8,inputType:`deleteContentBackward`},{key:`Enter`,keyCode:13,inputType:`insertParagraph`},{key:`Enter`,keyCode:13,inputType:`insertLineBreak`},{key:`Delete`,keyCode:46,inputType:`deleteContentForward`}],PC=`dthko`,FC=[16,17,18,20,91,92,224,225],IC=6,LC=class{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Yv(e.contentDOM),this.atoms=e.state.facet(XS).map(t=>t(e));let i=e.contentDOM.ownerDocument;i.addEventListener(`mousemove`,this.move=this.move.bind(this)),i.addEventListener(`mouseup`,this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet($_.allowMultipleSelections)&&sb(e,t),this.dragging=lb(e,t)&&hb(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&ob(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,i=0,a=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:o}=this.scrollParents.y.getBoundingClientRect());let s=vy(this.view);e.clientX-s.left<=r+IC?t=-ab(r-e.clientX):e.clientX+s.right>=a-IC&&(t=ab(e.clientX-a)),e.clientY-s.top<=i+IC?n=-ab(i-e.clientY):e.clientY+s.bottom>=o-IC&&(n=ab(e.clientY-o)),this.setScrollSpeed(t,n)}up(e){this.dragging??this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener(`mousemove`,this.move),e.removeEventListener(`mouseup`,this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,n=Wy(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:`select.pointer`}),this.mustSelect=!1}update(e){e.transactions.some(e=>e.isUserEvent(`input.type`))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}},RC=Object.create(null),zC=Object.create(null),BC=K.ie&&K.ie_version<15||K.ios&&K.webkit_version<604,zC.scroll=e=>{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},zC.wheel=zC.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()},RC.keydown=(e,t)=>(e.inputState.setSelectionOrigin(`select`),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1),zC.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin(`select.pointer`)},zC.touchmove=e=>{e.inputState.setSelectionOrigin(`select.pointer`)},RC.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(DS))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=gb(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new LC(e,t,n,r)),r&&e.observer.ignore(()=>{Xv(e.contentDOM);let t=e.root.activeElement;t&&!t.contains(e.contentDOM)&&t.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin(`select.pointer`);return!1},VC=K.ie&&K.ie_version<=11,HC=null,UC=0,WC=0,RC.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let r=e.docView.tile.nearest(t.target);if(r&&r.isWidget()){let e=r.posAtStart,t=e+r.length;(e>=n.to||t<=n.from)&&(n=U.range(e,t))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData(`Text`,fb(e.state,NS,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed=`copyMove`),!1},RC.dragend=e=>(e.inputState.draggedContent=null,!1),RC.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&vb(e,t,r.filter(e=>e!=null).join(e.state.lineBreak),!1)};for(let e=0;e<n.length;e++){let t=new FileReader;t.onerror=a,t.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(r[e]=t.result),a()},t.readAsText(n[e])}return!0}else{let n=t.dataTransfer.getData(`Text`);if(n)return vb(e,t,n,!0),!0}return!1},RC.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=BC?null:t.clipboardData;return n?(pb(e,n.getData(`text/plain`)||n.getData(`text/uri-list`)),!0):(db(e),!1)},GC=null,RC.copy=RC.cut=(e,t)=>{if(!Rv(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=bb(e.state);if(!n&&!i)return!1;GC=i?n:null,t.type==`cut`&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:`delete.cut`});let a=BC?null:t.clipboardData;return a?(a.clearData(),a.setData(`text/plain`,n),!0):(yb(e,n),!1)},KC=G_.define(),zC.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),Sb(e)},zC.blur=e=>{e.observer.clearSelectionRange(),Sb(e)},zC.compositionstart=zC.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange??(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))},zC.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,K.chrome&&K.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))},zC.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},RC.beforeinput=(e,t)=>{if((t.inputType==`insertText`||t.inputType==`insertCompositionText`)&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType==`insertReplacementText`&&e.observer.editContext){let n=t.dataTransfer?.getData(`text/plain`),r=t.getTargetRanges();if(n&&r.length){let t=r[0];return Zy(e,{from:e.posAtDOM(t.startContainer,t.startOffset),to:e.posAtDOM(t.endContainer,t.endOffset),insert:e.state.toText(n)},null),!0}}let n;if(K.chrome&&K.android&&(n=NC.find(e=>e.inputType==t.inputType))&&(e.observer.delayAndroidKey(n.key,n.keyCode),n.key==`Backspace`||n.key==`Delete`)){let t=window.visualViewport?.height||0;setTimeout(()=>{(window.visualViewport?.height||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return K.ios&&t.inputType==`deleteContentForward`&&e.observer.flushSoon(),K.safari&&t.inputType==`insertText`&&e.inputState.composing>=0&&setTimeout(()=>zC.compositionend(e,t),20),!1},qC=new Set,JC=[`pre-wrap`,`normal`,`pre-line`,`break-spaces`],YC=!1,XC=class{constructor(e){this.lineWrapping=e,this.doc=h_.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return JC.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,i,a){let o=JC.indexOf(e)>-1,s=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=i,s){this.heightSamples={};for(let e=0;e<a.length;e++){let t=a[e];t<0?e++:this.heightSamples[Math.floor(t*10)]=!0}}return s}},ZC=class{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}},QC=class e{constructor(e,t,n,r,i){this.from=e,this.length=t,this.top=n,this.height=r,this._content=i}get type(){return typeof this._content==`number`?aS.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof cS?this._content.widget:null}get widgetLineBreaks(){return typeof this._content==`number`?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new e(this.from,this.length+t.length,this.top,this.height+t.height,n)}},$C=(function(e){return e[e.ByPos=0]=`ByPos`,e[e.ByHeight=1]=`ByHeight`,e[e.ByPosNoHeight=2]=`ByPosNoHeight`,e})($C||={}),ew=.001,tw=class e{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ew&&(YC=!0),this.height=e)}replace(t,n,r){return e.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let i=this,a=n.doc;for(let o=r.length-1;o>=0;o--){let{fromA:s,toA:c,fromB:l,toB:u}=r[o],d=i.lineAt(s,$C.ByPosNoHeight,n.setDoc(t),0,0),f=d.to>=c?d:i.lineAt(c,$C.ByPosNoHeight,n,0,0);for(u+=f.to-c,c=f.to;o>0&&d.from<=r[o-1].toA;)s=r[o-1].fromA,l=r[o-1].fromB,o--,s<d.from&&(d=i.lineAt(s,$C.ByPosNoHeight,n,0,0));l+=d.from-s,s=d.from;let p=cw.build(n.setDoc(a),e,l,u);i=Tb(i,i.replace(s,c,p))}return i.updateHeight(n,0)}static empty(){return new iw(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r)if(i>a*2){let e=t[n-1];e.break?t.splice(--n,1,e.left,null,e.right):t.splice(--n,1,e.left,e.right),r+=1+e.break,i-=e.size}else if(a>i*2){let e=t[r];e.break?t.splice(r,1,e.left,null,e.right):t.splice(r,1,e.left,e.right),r+=2+e.break,a-=e.size}else break;else if(i<a){let e=t[n++];e&&(i+=e.size)}else{let e=t[--r];e&&(a+=e.size)}let o=0;return t[n-1]==null?(o=1,n--):t[n]??(o=1,r++),new ow(e.of(t.slice(0,n)),o,e.of(t.slice(r)))}},tw.prototype.size=1,nw=q.replace({}),rw=class extends tw{constructor(e,t,n){super(e,t),this.deco=n,this.spaceAbove=0}mainBlock(e,t){return new QC(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,n,r){return this.spaceAbove&&e<n+this.spaceAbove?new QC(r,0,n,this.spaceAbove,nw):this.mainBlock(n,r)}lineAt(e,t,n,r,i){let a=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,n,r,i).join(a):a}forEachLine(e,t,n,r,i,a){e<=i+this.length&&t>=i&&a(this.lineAt(0,$C.ByPos,n,r,i))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},iw=class e extends rw{constructor(e,t,n){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,t){return new QC(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof e||i instanceof aw&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof aw?i=new e(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):tw.of(r)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:``}${this.widgetHeight?`:`+this.widgetHeight:``})`}},aw=class e extends tw{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-n+1,a,o=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);a=t/i,this.length>i+1&&(o=(this.height-t)/(this.length-i-1))}else a=this.height/i;return{firstLine:n,lastLine:r,perLine:a,perChar:o}}blockAt(e,t,n,r){let{firstLine:i,lastLine:a,perLine:o,perChar:s}=this.heightMetrics(t,r);if(t.lineWrapping){let i=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),a=t.doc.lineAt(i),c=o+a.length*s,l=Math.max(n,e-c/2);return new QC(a.from,a.length,l,c,0)}else{let r=Math.max(0,Math.min(a-i,Math.floor((e-n)/o))),{from:s,length:c}=t.doc.line(i+r);return new QC(s,c,n+o*r,o,0)}}lineAt(e,t,n,r,i){if(t==$C.ByHeight)return this.blockAt(e,n,r,i);if(t==$C.ByPosNoHeight){let{from:t,to:r}=n.doc.lineAt(e);return new QC(t,r-t,0,0,0)}let{firstLine:a,perLine:o,perChar:s}=this.heightMetrics(n,i),c=n.doc.lineAt(e),l=o+c.length*s,u=c.number-a,d=r+o*u+s*(c.from-i-u);return new QC(c.from,c.length,Math.max(r,Math.min(d,r+this.height-l)),l,0)}forEachLine(e,t,n,r,i,a){e=Math.max(e,i),t=Math.min(t,i+this.length);let{firstLine:o,perLine:s,perChar:c}=this.heightMetrics(n,i);for(let l=e,u=r;l<=t;){let t=n.doc.lineAt(l);if(l==e){let n=t.number-o;u+=s*n+c*(e-i-n)}let r=s+c*t.length;a(new QC(t.from,t.length,u,r,0)),u+=r,l=t.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let t=r[r.length-1];t instanceof e?r[r.length-1]=new e(t.length+i):r.push(null,new e(i-1))}if(t>0){let n=r[0];n instanceof e?r[0]=new e(t+n.length):r.unshift(new e(t-1),null)}return tw.of(r)}decomposeLeft(t,n){n.push(new e(t-1),null)}decomposeRight(t,n){n.push(null,new e(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let r=[],o=Math.max(n,i.from),s=-1;for(i.from>n&&r.push(new e(i.from-n-1).updateHeight(t,n));o<=a&&i.more;){let e=t.doc.lineAt(o).length;r.length&&r.push(null);let n=i.heights[i.index++],a=0;n<0&&(a=-n,n=i.heights[i.index++]),s==-1?s=n:Math.abs(n-s)>=ew&&(s=-2);let c=new iw(e,n,a);c.outdated=!1,r.push(c),o+=e+1}o<=a&&r.push(null,new e(a-o).updateHeight(t,o));let c=tw.of(r);return(s<0||Math.abs(c.height-this.height)>=ew||Math.abs(s-this.heightMetrics(t,n).perLine)>=ew)&&(YC=!0),Tb(this,c)}else (r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},ow=class extends tw{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let i=n+this.left.height;return e<i?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,i,r+this.left.length+this.break)}lineAt(e,t,n,r,i){let a=r+this.left.height,o=i+this.left.length+this.break,s=t==$C.ByHeight?e<a:e<o,c=s?this.left.lineAt(e,t,n,r,i):this.right.lineAt(e,t,n,a,o);if(this.break||(s?c.to<o:c.from>o))return c;let l=t==$C.ByPosNoHeight?$C.ByPosNoHeight:$C.ByPos;return s?c.join(this.right.lineAt(o,l,n,a,o)):this.left.lineAt(o,l,n,r,i).join(c)}forEachLine(e,t,n,r,i,a){let o=r+this.left.height,s=i+this.left.length+this.break;if(this.break)e<s&&this.left.forEachLine(e,t,n,r,i,a),t>=s&&this.right.forEachLine(e,t,n,o,s,a);else{let c=this.lineAt(s,$C.ByPos,n,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,i,a),c.to>=e&&c.from<=t&&a(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,o,s,a)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let i=[];e>0&&this.decomposeLeft(e,i);let a=i.length;for(let e of n)i.push(e);if(e>0&&Eb(i,a-1),t<this.length){let e=i.length;this.decomposeRight(t,i),Eb(i,e)}return tw.of(i)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?tw.of(this.break?[e,null,t]:[e,t]):(this.left=Tb(this.left,e),this.right=Tb(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:i,right:a}=this,o=t+i.length+this.break,s=null;return r&&r.from<=t+i.length&&r.more?s=i=i.updateHeight(e,t,n,r):i.updateHeight(e,t,n),r&&r.from<=o+a.length&&r.more?s=a=a.updateHeight(e,o,n,r):a.updateHeight(e,o,n),s?this.balanced(i,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?` `:`-`)+this.right}},sw=5,cw=class e{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof iw?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new iw(e-this.pos,-1,0)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,i=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new rw(a,r,n)):(a||i||r>=sw)&&this.addLineDeco(r,i,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new iw(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let n=new aw(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof iw)return e;let t=new iw(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos+=e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos+=n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof iw)&&!this.isCovered?this.nodes.push(new iw(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let e of this.nodes)e instanceof iw&&e.updateHeight(this.oracle,n),n+=e?e.length:1;return this.nodes}static build(t,n,r,i){let a=new e(r,t);return rv.spans(n,r,i,a,0),a.finish(r)}},lw=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&Fv(e,t,this.changes,5)}},uw=class{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,t){return q.replace({widget:new dw(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}},dw=class extends iS{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement(`div`);return this.vertical?e.style.height=this.size+`px`:(e.style.width=this.size+`px`,e.style.height=`2px`,e.style.display=`inline-block`),e}get estimatedHeight(){return this.vertical?this.size:-1}},fw=class{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=mw,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=mS.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=t.facet(KS).some(e=>typeof e!=`function`&&e.class==`cm-lineWrapping`);this.heightOracle=new XC(n),this.stateDeco=Fb(t),this.heightMap=tw.empty().applyChanges(this.stateDeco,h_.empty,this.heightOracle.setDoc(t.doc),[new eC(0,0,0,t.doc.length)]);for(let e=0;e<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());e++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=q.set(this.lineGaps.map(e=>e.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:e,to:t})=>r>=e&&r<=t)){let{from:t,to:n}=this.lineBlockAt(r);e.push(new pw(t,n))}}return this.viewports=e.sort((e,t)=>e.from-t.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?mw:new hw(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Ib(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=Fb(this.state);let r=e.changedRanges,i=eC.extendWithRanges(r,Db(n,this.stateDeco,e?e.changes:T_.empty(this.state.doc.length))),a=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);wb(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=a||YC)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<s.from||t.range.head>s.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,t));let c=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(FS)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,i=n.whiteSpace;this.defaultTextDirection=n.direction==`rtl`?mS.RTL:mS.LTR;let a=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent===`refresh`,o=t.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,l=0;if(o.width&&o.height){let{scaleX:e,scaleY:n}=qv(t,o);(e>.005&&Math.abs(this.scaleX-e)>.005||n>.005&&Math.abs(this.scaleY-n)>.005)&&(this.scaleX=e,this.scaleY=n,c|=16,a=s=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=d)&&(this.paddingTop=u,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let f=Yv(this.view.contentDOM,!1).y;f!=this.scrollParent&&(this.scrollParent=f,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=ty(this.scrollParent||e.win);let m=(this.printing?Ab:Ob)(t,this.paddingTop),h=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let _=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(_!=this.inView&&(this.inView=_,_&&(s=!0)),!this.inView&&!this.scrollTarget&&!kb(e.dom))return 0;let v=o.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),s){let t=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(t)&&(a=!0),a||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:n,charWidth:o,textHeight:s}=e.docView.measureTextSize();a=n>0&&r.refresh(i,n,o,s,Math.max(5,v/o),t),a&&(e.docView.minWidth=0,c|=16)}h>0&&g>0?l=Math.max(h,g):h<0&&g<0&&(l=Math.min(h,g)),wb();for(let n of this.viewports){let i=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(a?tw.empty().applyChanges(this.stateDeco,h_.empty,this.heightOracle,[new eC(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new ZC(n.from,i))}YC&&(c|=2)}let y=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(l,this.scrollTarget),c|=this.updateForViewport()),(c&2||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:a,visibleBottom:o}=this,s=new pw(r.lineAt(a-n*1e3,$C.ByHeight,i,0,0).from,r.lineAt(o+(1-n)*1e3,$C.ByHeight,i,0,0).to);if(t){let{head:e}=t.range;if(e<s.from||e>s.to){let n=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),a=r.lineAt(e,$C.ByPos,i,0,0),o;o=t.y==`center`?(a.top+a.bottom)/2-n/2:t.y==`start`||t.y==`nearest`&&e<s.from?a.top:a.bottom-n,s=new pw(r.lineAt(o-1e3/2,$C.ByHeight,i,0,0).from,r.lineAt(o+n+1e3/2,$C.ByHeight,i,0,0).to)}}return s}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new pw(this.heightMap.lineAt(n,$C.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,$C.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,$C.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(t,$C.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:o}=this;return(e==0||r<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||i>=o+Math.max(10,Math.min(n,250)))&&r>a-2*1e3&&i<o+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new uw(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,i=r>>1,a=r<<1;if(this.defaultTextDirection!=mS.LTR&&!n)return[];let o=[],s=(r,a,c,l)=>{if(a-r<i)return;let u=this.state.selection.main,d=[u.from];u.empty||d.push(u.to);for(let e of d)if(e>r&&e<a){s(r,e-10,c,l),s(e+10,a,c,l);return}let f=Pb(e,e=>e.from>=c.from&&e.to<=c.to&&Math.abs(e.from-r)<i&&Math.abs(e.to-a)<i&&!d.some(t=>e.from<t&&e.to>t));if(!f){if(a<c.to&&t&&n&&t.visibleRanges.some(e=>e.from<=a&&e.to>=a)){let e=t.moveToLineBoundary(U.cursor(a),!1,!0).head;e>r&&(a=e)}let e=this.gapSize(c,r,a,l);f=new uw(r,a,e,n||e<2e6?e:2e6)}o.push(f)},c=t=>{if(t.length<a||t.type!=aS.Text)return;let i=jb(t.from,t.to,this.stateDeco);if(i.total<a)return;let o=this.scrollTarget?this.scrollTarget.range.head:null,c,l;if(n){let e=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,n,a;if(o!=null){let r=Nb(i,o),s=((this.visibleBottom-this.visibleTop)/2+e)/t.height;n=r-s,a=r+s}else n=(this.visibleTop-t.top-e)/t.height,a=(this.visibleBottom-t.top+e)/t.height;c=Mb(i,n),l=Mb(i,a)}else{let n=i.total*this.heightOracle.charWidth,a=r*this.heightOracle.charWidth,s=0;if(n>2e6)for(let n of e)n.from>=t.from&&n.from<t.to&&n.size!=n.displaySize&&n.from*this.heightOracle.charWidth+s<this.pixelViewport.left&&(s=n.size-n.displaySize);let u=this.pixelViewport.left+s,d=this.pixelViewport.right+s,f,p;if(o!=null){let e=Nb(i,o),t=((d-u)/2+a)/n;f=e-t,p=e+t}else f=(u-a)/n,p=(d+a)/n;c=Mb(i,f),l=Mb(i,p)}c>t.from&&s(t.from,c,t,i),l<t.to&&s(l,t.to,t,i)};for(let e of this.viewportLines)Array.isArray(e.type)?e.type.forEach(c):c(e);return o}gapSize(e,t,n,r){let i=Nb(r,n)-Nb(r,t);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){uw.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=q.set(e.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];rv.spans(t,this.viewport.from,this.viewport.to,{span(e,t){n.push({from:e,to:t})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let t=0;t<n.length&&!(r&8);t++){let i=this.visibleRanges[t],a=n[t];(i.from!=a.from||i.to!=a.to)&&(r|=4,e&&e.mapPos(i.from,-1)==a.from&&e.mapPos(i.to,1)==a.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Ib(this.heightMap.lineAt(e,$C.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Ib(this.heightMap.lineAt(this.scaler.fromDOM(e),$C.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Ib(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},pw=class{constructor(e,t){this.from=e,this.to=t}},mw={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}},hw=class e{constructor(e,t,n){let r=0,i=0,a=0;this.viewports=n.map(({from:n,to:i})=>{let a=t.lineAt(n,$C.ByPos,e,0,0).top,o=t.lineAt(i,$C.ByPos,e,0,0).bottom;return r+=o-a,{from:n,to:i,top:a,bottom:o,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let e of this.viewports)e.domTop=a+(e.top-i)*this.scale,a=e.domBottom=e.domTop+(e.bottom-e.top),i=e.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.top)return r+(e-n)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);n=i.bottom,r=i.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let i=t<this.viewports.length?this.viewports[t]:null;if(!i||e<i.domTop)return n+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);n=i.bottom,r=i.domBottom}}eq(t){return t instanceof e?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,n)=>e.from==t.viewports[n].from&&e.to==t.viewports[n].to):!1}},gw=W.define({combine:e=>e.join(` `)}),_w=W.define({combine:e=>e.indexOf(!0)>-1}),vw=pv.newName(),yw=pv.newName(),bw=pv.newName(),xw={"&light":`.`+yw,"&dark":`.`+bw},Sw=Lb(`.`+vw,{"&":{position:`relative !important`,boxSizing:`border-box`,"&.cm-focused":{outline:`1px dotted #212121`},display:`flex !important`,flexDirection:`column`},".cm-scroller":{display:`flex !important`,alignItems:`flex-start !important`,fontFamily:`monospace`,lineHeight:1.4,height:`100%`,overflowX:`auto`,position:`relative`,zIndex:0,overflowAnchor:`none`},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:`block`,whiteSpace:`pre`,wordWrap:`normal`,boxSizing:`border-box`,minHeight:`100%`,padding:`4px 0`,outline:`none`,"&[contenteditable=true]":{WebkitUserModify:`read-write-plaintext-only`}},".cm-lineWrapping":{whiteSpace_fallback:`pre-wrap`,whiteSpace:`break-spaces`,wordBreak:`break-word`,overflowWrap:`anywhere`,flexShrink:1},"&light .cm-content":{caretColor:`black`},"&dark .cm-content":{caretColor:`white`},".cm-line":{display:`block`,padding:`0 2px 0 6px`},".cm-layer":{position:`absolute`,left:0,top:0,contain:`size style`,"& > *":{position:`absolute`}},"&light .cm-selectionBackground":{background:`#d9d9d9`},"&dark .cm-selectionBackground":{background:`#222`},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#d7d4f0`},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:`#233`},".cm-cursorLayer":{pointerEvents:`none`},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:`steps(1) cm-blink 1.2s infinite`},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:`1.2px solid black`,marginLeft:`-0.6px`,pointerEvents:`none`},".cm-cursor":{display:`none`},"&dark .cm-cursor":{borderLeftColor:`#ddd`},".cm-selectionHandle":{backgroundColor:`currentColor`,width:`1.5px`},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:`""`,backgroundColor:`inherit`,borderRadius:`50%`,width:`8px`,height:`8px`,position:`absolute`,left:`-3.25px`},".cm-selectionHandle-start::before":{top:`-8px`},".cm-selectionHandle-end::before":{bottom:`-8px`},".cm-dropCursor":{position:`absolute`},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:`block`},".cm-iso":{unicodeBidi:`isolate`},".cm-announced":{position:`fixed`,top:`-10000px`},"@media print":{".cm-announced":{display:`none`}},"&light .cm-activeLine":{backgroundColor:`#cceeff44`},"&dark .cm-activeLine":{backgroundColor:`#99eeff33`},"&light .cm-specialChar":{color:`red`},"&dark .cm-specialChar":{color:`#f78`},".cm-gutters":{flexShrink:0,display:`flex`,height:`100%`,boxSizing:`border-box`,zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:`#f5f5f5`,color:`#6c6c6c`,border:`0px solid #ddd`,"&.cm-gutters-before":{borderRightWidth:`1px`},"&.cm-gutters-after":{borderLeftWidth:`1px`}},"&dark .cm-gutters":{backgroundColor:`#333338`,color:`#ccc`},".cm-gutter":{display:`flex !important`,flexDirection:`column`,flexShrink:0,boxSizing:`border-box`,minHeight:`100%`,overflow:`hidden`},".cm-gutterElement":{boxSizing:`border-box`},".cm-lineNumbers .cm-gutterElement":{padding:`0 3px 0 5px`,minWidth:`20px`,textAlign:`right`,whiteSpace:`nowrap`},"&light .cm-activeLineGutter":{backgroundColor:`#e2f2ff`},"&dark .cm-activeLineGutter":{backgroundColor:`#222227`},".cm-panels":{boxSizing:`border-box`,position:`sticky`,left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:`#f5f5f5`,color:`black`},"&light .cm-panels-top":{borderBottom:`1px solid #ddd`},"&light .cm-panels-bottom":{borderTop:`1px solid #ddd`},"&dark .cm-panels":{backgroundColor:`#333338`,color:`white`},".cm-dialog":{padding:`2px 19px 4px 6px`,position:`relative`,"& label":{fontSize:`80%`}},".cm-dialog-close":{position:`absolute`,top:`3px`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,fontSize:`14px`,padding:`0`},".cm-tab":{display:`inline-block`,overflow:`hidden`,verticalAlign:`bottom`},".cm-widgetBuffer":{verticalAlign:`text-top`,height:`1em`,width:0,display:`inline`},".cm-placeholder":{color:`#888`,display:`inline-block`,verticalAlign:`top`,userSelect:`none`},".cm-highlightSpace":{backgroundImage:`radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)`,backgroundPosition:`center`},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:`auto 100%`,backgroundPosition:`right 90%`,backgroundRepeat:`no-repeat`},".cm-trailingSpace":{backgroundColor:`#ff332255`},".cm-button":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,padding:`.2em 1em`,borderRadius:`1px`},"&light .cm-button":{backgroundImage:`linear-gradient(#eff1f5, #d9d9df)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#b4b4b4, #d0d3d6)`}},"&dark .cm-button":{backgroundImage:`linear-gradient(#393939, #111)`,border:`1px solid #888`,"&:active":{backgroundImage:`linear-gradient(#111, #333)`}},".cm-textfield":{verticalAlign:`middle`,color:`inherit`,fontSize:`70%`,border:`1px solid silver`,padding:`.2em .5em`},"&light .cm-textfield":{backgroundColor:`white`},"&dark .cm-textfield":{border:`1px solid #555`,backgroundColor:`inherit`}},xw),Cw={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ww=K.ie&&K.ie_version<=11,Tw=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new uS,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let e of t)this.queue.push(e);(K.ie&&K.ie_version<=11||K.ios&&e.composing)&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&K.android&&e.constructor.EDIT_CONTEXT!==!1&&!(K.chrome&&K.chrome_version<126)&&(this.editContext=new Ew(e),e.state.facet(BS)&&(e.contentDOM.editContext=this.editContext.editContext)),ww&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia(`print`)),typeof ResizeObserver==`function`&&(this.resizeScroll=new ResizeObserver(()=>{this.view.docView?.lastUpdate<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver==`function`&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent(`Event`)))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent(`Event`))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers(`scroll`,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type==`change`||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(BS)?n.root.activeElement!=this.dom:!Rv(this.dom,r))return;let i=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(K.ie&&K.ie_version<=11||K.android&&K.chrome)&&!n.state.selection.main.empty&&r.focusNode&&Bv(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Iv(e.root);if(!t)return!1;let n=K.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Bb(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=Rv(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&ey(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||=this.scrollTargets.slice(0,e),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);for(let e of this.scrollTargets=t)e.addEventListener(`scroll`,this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||=(this.observer.observe(this.dom,Cw),ww&&this.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),ww&&this.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){if(!this.delayedAndroidKey){let e=()=>{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&Qv(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}(!this.delayedAndroidKey||e==`Enter`)&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!this.delayedAndroidKey?.force})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let i of e){let e=this.readMutation(i);e&&(e.typeOver&&(r=!0),t==-1?{from:t,to:n}=e:(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&Rv(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new jC(this.view,e,t,n);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=Xy(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!nb(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type==`attributes`),e.type==`childList`){let n=Rb(t,e.previousSibling||e.target.previousSibling,-1),r=Rb(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else if(e.type==`characterData`)return{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue};else return null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener(`change`,this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener(`beforeprint`,this.onPrint),e.addEventListener(`scroll`,this.onScroll),e.document.addEventListener(`selectionchange`,this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener(`scroll`,this.onScroll),e.removeEventListener(`resize`,this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener(`change`,this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener(`beforeprint`,this.onPrint),e.document.removeEventListener(`selectionchange`,this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(BS)!=e.state.facet(BS)&&(e.view.contentDOM.editContext=e.state.facet(BS)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)==null||e.disconnect(),(t=this.gapIntersection)==null||t.disconnect(),(n=this.resizeScroll)==null||n.disconnect();for(let e of this.scrollTargets)e.removeEventListener(`scroll`,this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}},Ew=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:i,head:a}=r,o=this.toEditorPos(n.updateRangeStart),s=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:o,drifted:!1});let c=s-o>n.text.length;o==this.from&&i<this.from?o=i:s==this.to&&i>this.to&&(s=i);let l=$y(e.state.sliceDoc(o,s),n.text,(c?r.from:r.to)-o,c?`end`:null);if(!l){let t=U.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));nb(t,r)||e.dispatch({selection:t,userEvent:`select`});return}let u={from:l.from+o,to:l.toA+o,insert:h_.of(n.text.slice(l.from,l.toB).split(` +`))};if((K.mac||K.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:h_.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);Zy(e,u,U.single(this.toEditorPos(n.selectionStart,t),this.toEditorPos(n.selectionEnd,t)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),u.from<u.to&&!u.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(t.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],i=null;for(let t=this.toEditorPos(n.rangeStart),a=this.toEditorPos(n.rangeEnd);t<a;t++){let n=e.coordsForChar(t);i=n&&new DOMRect(n.left,n.top,n.right-n.left,n.bottom-n.top)||i||new DOMRect,r.push(i)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=t=>{let n=[];for(let e of t.getTextFormats()){let t=e.underlineStyle,r=e.underlineThickness;if(!/none/i.test(t)&&!/none/i.test(r)){let i=this.toEditorPos(e.rangeStart),a=this.toEditorPos(e.rangeEnd);if(i<a){let e=`text-decoration: underline ${/^[a-z]/.test(t)?t+` `:t==`Dashed`?`dashed `:t==`Squiggle`?`wavy `:``}${/thin/i.test(r)?1:2}px`;n.push(q.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:zS.of(q.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let e in this.handlers)t.addEventListener(e,this.handlers[e]);this.measureReq={read:e=>{this.editContext.updateControlBounds(e.contentDOM.getBoundingClientRect());let t=Iv(e.root);t&&t.rangeCount&&this.editContext.updateSelectionBounds(t.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,a,o,s,c)=>{if(n)return;let l=c.length-(a-i);if(r&&a>=r.to)if(r.from==i&&r.to==a&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=l,this.to+=l;return}else r=null,this.revertPending(e.state);if(i+=t,a+=t,a<=this.from)this.from+=l,this.to+=l;else if(i<this.to){if(i<this.from||a>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(a),c.toString()),this.to+=l}t+=l}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(e=>!e.isUserEvent(`input.type`)&&e.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},J=class e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement(`div`),this.scrollDOM=document.createElement(`div`),this.scrollDOM.tabIndex=-1,this.scrollDOM.className=`cm-scroller`,this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement(`div`),this.announceDOM.className=`cm-announced`,this.announceDOM.setAttribute(`aria-live`,`polite`),this.dom=document.createElement(`div`),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach(e=>t(e,this)))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||$v(e.parent)||document,this.viewState=new fw(this,e.state||$_.create(e)),e.scrollTo&&e.scrollTo.is(RS)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(HS).map(e=>new WS(e));for(let e of this.plugins)e.update(this);this.observer=new Tw(this),this.inputState=new MC(this),this.inputState.ensureHandlers(this.plugins),this.docView=new SC(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),document.fonts?.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=`refresh`,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof J_?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(t){if(this.updateState!=0)throw Error(`Calls to EditorView.update are not allowed while an update is in progress`);let n=!1,r=!1,i,a=this.state;for(let e of t){if(e.startState!=a)throw RangeError(`Trying to update state with a transaction that doesn't start from the previous state.`);a=e.state}if(this.destroyed){this.viewState.state=a;return}let o=this.hasFocus,s=0,c=null;t.some(e=>e.annotation(KC))?(this.inputState.notifiedFocused=o,s=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=xb(a,o),c||(s=1));let l=this.observer.delayedAndroidKey,u=null;if(l?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(u=null)):this.observer.clear(),a.facet($_.phrases)!=this.state.facet($_.phrases))return this.setState(a);i=tC.create(this,a,t),i.flags|=s;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let n of t){if(d&&=d.map(n.changes),n.scrollIntoView){let{main:t}=n.state.selection,{x:r,y:i}=this.state.facet(e.cursorScrollMargin);d=new LS(t.empty?t:U.cursor(t.head,t.head>t.anchor?-1:1),`nearest`,`nearest`,i,r)}for(let e of n.effects)e.is(RS)&&(d=e.value.clip(this.state))}this.viewState.update(i,d),this.bidiCache=kw.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet($S)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(e=>e.isUserEvent(`select.pointer`)))}finally{this.updateState=0}if(i.startState.facet(gw)!=i.state.facet(gw)&&(this.viewState.mustMeasureContent=!0),(n||r||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let e of this.state.facet(kS))try{e(i)}catch(e){gy(this.state,e,`update listener`)}(c||u)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),u&&!Xy(this,u)&&l.force&&Qv(this.contentDOM,l.key,l.keyCode)})}setState(e){if(this.updateState!=0)throw Error(`Calls to EditorView.setState are not allowed while an update is in progress`);if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new fw(this,e),this.plugins=e.facet(HS).map(e=>new WS(e)),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new SC(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(HS),n=e.state.facet(HS);if(t!=n){let r=[];for(let i of n){let n=t.indexOf(i);if(n<0)r.push(new WS(i));else{let t=this.plugins[n];t.mustUpdate=e,r.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e<this.plugins.length;e++)this.plugins[e].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(e){gy(this.state,e,`doc view update listener`)}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:i,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(a<0)if(ty(n||this.win))i=-1,a=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(r);i=e.from,a=e.top}this.updateState=1;let o=this.viewState.measure();if(!o&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(e>5){console.warn(this.measureRequests.length?`Measure loop restarted more than 5 times`:`Viewport failed to stabilize`);break}let s=[];o&4||([this.measureRequests,s]=[s,this.measureRequests]);let c=s.map(e=>{try{return e.read(this)}catch(e){return gy(this.state,e),Ow}}),l=tC.create(this,this.state,[]),u=!1;l.flags|=o,t?t.flags|=o:t=l,this.updateState=2,l.empty||(this.updatePlugins(l),this.inputState.update(l),this.updateAttrs(),u=this.docView.update(l),u&&this.docViewUpdate());for(let e=0;e<s.length;e++)if(c[e]!=Ow)try{let t=s[e];t.write&&t.write(c[e],this)}catch(e){gy(this.state,e)}if(u&&this.docView.updateSelection(!0),!l.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let e=((i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-a)/this.scaleY;if((e>1||e<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r+=e,n?n.scrollTop+=e:this.win.scrollBy(0,e),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let e of this.state.facet(kS))e(t)}get themeClasses(){return vw+` `+(this.state.facet(_w)?bw:yw)+` `+this.state.facet(gw)}updateAttrs(){let e=Vb(this,GS,{class:`cm-editor`+(this.hasFocus?` cm-focused `:` `)+this.themeClasses}),t={spellcheck:`false`,autocorrect:`off`,autocapitalize:`off`,writingsuggestions:`false`,translate:`no`,contenteditable:this.state.facet(BS)?`true`:`false`,class:`cm-content`,style:`${K.tabSize}: ${this.state.tabSize}`,role:`textbox`,"aria-multiline":`true`};this.state.readOnly&&(t[`aria-readonly`]=`true`),Vb(this,KS,t);let n=this.observer.ignore(()=>{let n=jv(this.contentDOM,this.contentAttrs,t),r=jv(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(t){let n=!0;for(let r of t)for(let t of r.effects)if(t.is(e.announce)){n&&(this.announceDOM.textContent=``),n=!1;let e=this.announceDOM.appendChild(document.createElement(`div`));e.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet($S);let t=this.state.facet(e.cspNonce);pv.mount(this.root,this.styleModules.concat(Sw).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw Error(`Reading the editor layout isn't allowed during an update`);this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(t=>t.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return Gy(this,e,By(this,e,t,n))}moveByGroup(e,t){return Gy(this,e,By(this,e,t,t=>Vy(this,e.head,t)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=n[t?n.length-1:0];return U.cursor(i.side(t,r)+e.from,i.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return zy(this,e,t,n)}moveVertically(e,t,n){return Gy(this,e,Hy(this,e,t,n))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let n=Ky(this,e,t);return n&&n.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Ky(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),a=i[SS.find(i,e-r.from,-1,t)];return Gv(n,a.dir==mS.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(PS)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Dw)return py(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||oy(r.isolates,n=_y(this,e))))return r.order;n||=_y(this,e);let r=fy(e.text,t,n);return this.bidiCache.push(new kw(e.from,e.to,t,n,!0,r)),r}get hasFocus(){return(this.dom.ownerDocument.hasFocus()||K.safari&&this.inputState?.lastContextMenu>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Xv(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return RS.of(new LS(typeof e==`number`?U.cursor(e):e,t.y??`nearest`,t.x??`nearest`,t.yMargin??5,t.xMargin??5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return RS.of(new LS(U.cursor(n.from),`start`,`start`,n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e==`boolean`?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return US.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return US.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=pv.newName(),r=[gw.of(n),$S.of(Lb(`.${n}`,e))];return t&&t.dark&&r.push(_w.of(!0)),r}static baseTheme(e){return N_.lowest($S.of(Lb(`.`+vw,e,xw)))}static findFromDOM(e){let t=e.querySelector(`.cm-content`);return(t&&rC.get(t)||rC.get(e))?.root?.view||null}},J.styleModule=$S,J.inputHandler=AS,J.clipboardInputFilter=MS,J.clipboardOutputFilter=NS,J.scrollHandler=IS,J.focusChangeEffect=jS,J.perLineTextDirection=PS,J.exceptionSink=OS,J.updateListener=kS,J.editable=BS,J.mouseSelectionStyle=DS,J.dragMovesSelection=ES,J.clickAddsSelectionRange=TS,J.decorations=qS,J.blockWrappers=JS,J.outerDecorations=YS,J.atomicRanges=XS,J.bidiIsolatedRanges=ZS,J.cursorScrollMargin=W.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r==`number`?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}}),J.scrollMargins=QS,J.darkTheme=_w,J.cspNonce=W.define({combine:e=>e.length?e[0]:``}),J.contentAttributes=KS,J.editorAttributes=GS,J.lineWrapping=J.contentAttributes.of({class:`cm-lineWrapping`}),J.announce=G.define(),Dw=4096,Ow={},kw=class e{constructor(e,t,n,r,i,a){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=i,this.order=a}static update(t,n){if(n.empty&&!t.some(e=>e.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:mS.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let o=t[a];o.dir==i&&!n.touchesRange(o.from,o.to)&&r.push(new e(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}},Aw=K.mac?`mac`:K.windows?`win`:K.linux?`linux`:`key`,jw=N_.default(J.domEventHandlers({keydown(e,t){return qb(Wb(t.state),e,t,`editor`)}})),Mw=W.define({enables:jw}),Nw=new WeakMap,Pw=null,Fw=4e3,Iw=null,Lw=class e{constructor(e,t,n,r,i){this.className=e,this.left=t,this.top=n,this.width=r,this.height=i}draw(){let e=document.createElement(`div`);return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className?(this.adjust(e),!0):!1}adjust(e){e.style.left=this.left+`px`,e.style.top=this.top+`px`,this.width!=null&&(e.style.width=this.width+`px`),e.style.height=this.height+`px`}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let a=Jb(t);return[new e(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return Xb(t,n,r)}},Rw=class{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement(`div`)),this.dom.classList.add(`cm-layer`),t.above&&this.dom.classList.add(`cm-layer-above`),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute(`aria-hidden`,`true`),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(zw)!=e.state.facet(zw)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(zw);for(;t<n.length&&n[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((e,t)=>!Zb(e,this.drawn[t]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e,K.webkit&&(this.dom.style.display=this.dom.firstChild?``:`none`)}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},zw=W.define(),Bw=W.define({combine(e){return n_(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}}),Vw=Qb({above:!0,markers(e){let{state:t}=e,n=t.facet(Bw),r=[];for(let i of t.selection.ranges){let a=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(a&&K.ios&&n.iosSelectionHandles)){let t=a?`cm-cursor cm-cursor-primary`:`cm-cursor cm-cursor-secondary`,n=i.empty?i:U.cursor(i.head,i.assoc);for(let i of Lw.forRange(e,t,n))r.push(i)}}return r},update(e,t){e.transactions.some(e=>e.selection)&&(t.style.animationName=t.style.animationName==`cm-blink`?`cm-blink2`:`cm-blink`);let n=tx(e);return n&&nx(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){nx(t.state,e)},class:`cm-cursorLayer`}),Hw=Qb({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let n of r)if(!n.empty)for(let r of Lw.forRange(e,`cm-selectionBackground`,n))t.push(r);if(K.ios&&!n.empty&&e.state.facet(Bw).iosSelectionHandles){for(let r of Lw.forRange(e,`cm-selectionHandle cm-selectionHandle-start`,U.cursor(n.from,1)))t.push(r);for(let r of Lw.forRange(e,`cm-selectionHandle cm-selectionHandle-end`,U.cursor(n.to,1)))t.push(r)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||tx(e)},class:`cm-selectionLayer`}),Uw=N_.highest(J.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:`transparent !important`},caretColor:`transparent !important`},".cm-content":{caretColor:`transparent !important`,"& :focus":{caretColor:`initial !important`,"&::selection, & ::selection":{backgroundColor:`Highlight !important`}}}})),Ww=G.define({map(e,t){return e==null?null:t.mapPos(e)}}),Gw=j_.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((e,t)=>t.is(Ww)?t.value:e,e)}}),Kw=US.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(Gw);n==null?this.cursor!=null&&((t=this.cursor)==null||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement(`div`)),this.cursor.className=`cm-dropCursor`),(e.startState.field(Gw)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Gw),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+`px`,this.cursor.style.top=e.top/n+`px`,this.cursor.style.height=e.height/n+`px`):this.cursor.style.left=`-100000px`}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Gw)!=e&&this.view.dispatch({effects:Ww.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}}),qw=class{constructor(e){let{regexp:t,decoration:n,decorate:r,boundary:i,maxLength:a=1e3}=e;if(!t.global)throw RangeError(`The regular expression given to MatchDecorator should have its 'g' flag set`);if(this.regexp=t,r)this.addMatch=(e,t,n,i)=>r(i,n,n+e[0].length,e,t);else if(typeof n==`function`)this.addMatch=(e,t,r,i)=>{let a=n(e,t,r);a&&i(r,r+e[0].length,a)};else if(n)this.addMatch=(e,t,r,i)=>i(r,r+e[0].length,n);else throw RangeError(`Either 'decorate' or 'decoration' should be provided to MatchDecorator`);this.boundary=i,this.maxLength=a}createDeco(e){let t=new iv,n=t.add.bind(t);for(let{from:t,to:r}of ax(e,this.maxLength))ix(e.state.doc,this.regexp,t,r,(t,r)=>this.addMatch(r,e,t,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((t,i,a,o)=>{o>=e.view.viewport.from&&a<=e.view.viewport.to&&(n=Math.min(a,n),r=Math.max(o,r))}),e.viewportMoved||r-n>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let i of e.visibleRanges){let a=Math.max(i.from,n),o=Math.min(i.to,r);if(o>=a){let n=e.state.doc.lineAt(a),r=n.to<o?e.state.doc.lineAt(o):n,s=Math.max(i.from,n.from),c=Math.min(i.to,r.to);if(this.boundary){for(;a>n.from;a--)if(this.boundary.test(n.text[a-1-n.from])){s=a;break}for(;o<r.to;o++)if(this.boundary.test(r.text[o-r.from])){c=o;break}}let l=[],u,d=(e,t,n)=>l.push(n.range(e,t));if(n==r)for(this.regexp.lastIndex=s-n.from;(u=this.regexp.exec(n.text))&&u.index<c-n.from;)this.addMatch(u,e,u.index+n.from,d);else ix(e.state.doc,this.regexp,s,c,(t,n)=>this.addMatch(n,e,t,d));t=t.update({filterFrom:s,filterTo:c,filter:(e,t)=>e<s||t>c,add:l})}}return t}},Jw=/x/.unicode==null?`g`:`gu`,Yw=RegExp(`[\0-\b +--\u2028\u2029-]`,Jw),Xw={0:`null`,7:`bell`,8:`backspace`,10:`newline`,11:`vertical tab`,13:`carriage return`,27:`escape`,8203:`zero width space`,8204:`zero width non-joiner`,8205:`zero width joiner`,8206:`left-to-right mark`,8207:`right-to-left mark`,8232:`line separator`,8237:`left-to-right override`,8238:`right-to-left override`,8294:`left-to-right isolate`,8295:`right-to-left isolate`,8297:`pop directional isolate`,8233:`paragraph separator`,65279:`zero width no-break space`,65532:`object replacement`},Zw=null,Qw=W.define({combine(e){let t=n_(e,{render:null,specialChars:Yw,addSpecialChars:null});return(t.replaceTabs=!ox())&&(t.specialChars=RegExp(` |`+t.specialChars.source,Jw)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,Jw)),t}}),$w=null,eT=`•`,tT=class extends iS{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=lx(this.code),n=e.state.phrase(`Control character`)+` `+(Xw[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},nT=class extends iS{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(`span`);return e.textContent=` `,e.className=`cm-tab`,e.style.width=this.width+`px`,e}ignoreEvent(){return!1}},rT=US.fromClass(class{constructor(){this.height=1e3,this.attrs={style:`padding-bottom: 1000px`}}update(e){let{view:t}=e,n=t.viewState.editorHeight-t.defaultLineHeight-t.documentPadding.top-.5;n>=0&&n!=this.height&&(this.height=n,this.attrs={style:`padding-bottom: ${n}px`})}}),iT=q.line({class:`cm-activeLine`}),aT=US.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(iT.range(i.from)),t=i.from)}return q.set(n)}},{decorations:e=>e.decorations}),oT=class extends iS{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement(`span`);return t.className=`cm-placeholder`,t.style.pointerEvents=`none`,t.appendChild(typeof this.content==`string`?document.createTextNode(this.content):typeof this.content==`function`?this.content(e):this.content.cloneNode(!0)),t.setAttribute(`aria-hidden`,`true`),t}coordsAt(e){let t=e.firstChild?zv(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),r=Gv(t[0],n.direction!=`rtl`),i=parseInt(n.lineHeight);return r.bottom-r.top>i*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+i}:r}ignoreEvent(){return!1}},sT=2e3,cT={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},lT={style:`cursor: crosshair`},uT=`-10000px`,dT=class{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(e=>e);let i=null;this.tooltipViews=this.tooltips.map(e=>i=n(e,i))}update(e,t){var n;let r=e.state.facet(this.facet),i=r.filter(e=>e);if(r===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let a=[],o=t?[]:null;for(let n=0;n<i.length;n++){let r=i[n],s=-1;if(r){for(let e=0;e<this.tooltips.length;e++){let t=this.tooltips[e];t&&t.create==r.create&&(s=e)}if(s<0)a[n]=this.createTooltipView(r,n?a[n-1]:null),o&&(o[n]=!!r.above);else{let r=a[n]=this.tooltipViews[s];o&&(o[n]=t[s]),r.update&&r.update(e)}}}for(let e of this.tooltipViews)a.indexOf(e)<0&&(this.removeTooltipView(e),(n=e.destroy)==null||n.call(e));return t&&(o.forEach((e,n)=>t[n]=e),t.length=o.length),this.input=r,this.tooltips=i,this.tooltipViews=a,!0}},fT=W.define({combine:e=>({position:K.ios?`absolute`:e.find(e=>e.position)?.position||`fixed`,parent:e.find(e=>e.parent)?.parent||null,tooltipSpace:e.find(e=>e.tooltipSpace)?.tooltipSpace||bx})}),pT=new WeakMap,mT=US.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(fT);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver==`function`?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new dT(e,_T,(e,t)=>this.createTooltip(e,t),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver==`function`?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener(`resize`,this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement(`div`),this.container.style.position=`relative`,this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(fT);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add(`cm-tooltip`),e.arrow&&!n.dom.querySelector(`.cm-tooltip > .cm-tooltip-arrow`)){let e=document.createElement(`div`);e.className=`cm-tooltip-arrow`,n.dom.appendChild(e)}return n.dom.style.position=this.position,n.dom.style.top=uT,n.dom.style.left=`0px`,this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener(`resize`,this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(e=t.destroy)==null||e.call(t);this.parent&&this.container.remove(),(t=this.resizeObserver)==null||t.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position==`fixed`&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(K.safari){let t=e.getBoundingClientRect();n=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}else n=!!e.offsetParent&&e.offsetParent!=this.container.ownerDocument.body}if(n||this.position==`absolute`)if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(e=n.width/this.parent.offsetWidth,t=n.height/this.parent.offsetHeight)}else ({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=vy(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(fT).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){if(e.makeAbsolute){this.madeAbsolute=!0,this.position=`absolute`;for(let e of this.manager.tooltipViews)e.dom.style.position=`absolute`}let{visible:t,space:n,scaleX:r,scaleY:i}=e,a=[];for(let o=0;o<this.manager.tooltips.length;o++){let s=this.manager.tooltips[o],c=this.manager.tooltipViews[o],{dom:l}=c,u=e.pos[o],d=e.size[o];if(!u||s.clip!==!1&&(u.bottom<=Math.max(t.top,n.top)||u.top>=Math.min(t.bottom,n.bottom)||u.right<Math.max(t.left,n.left)-.1||u.left>Math.min(t.right,n.right)+.1)){l.style.top=uT;continue}let f=s.arrow?c.dom.querySelector(`.cm-tooltip-arrow`):null,p=f?7:0,m=d.right-d.left,h=pT.get(c)??d.bottom-d.top,g=c.offset||gT,_=this.view.textDirection==mS.LTR,v=d.width>n.right-n.left?_?n.left:n.right-d.width:_?Math.max(n.left,Math.min(u.left-(f?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,u.left-m+(f?14:0)-g.x),n.right-m),y=this.above[o];!s.strictSide&&(y?u.top-h-p-g.y<n.top:u.bottom+h+p+g.y>n.bottom)&&y==n.bottom-u.bottom>u.top-n.top&&(y=this.above[o]=!y);let b=(y?u.top-n.top:n.bottom-u.bottom)-p;if(b<h&&c.resize!==!1){if(b<this.view.defaultLineHeight){l.style.top=uT;continue}pT.set(c,h),l.style.height=(h=b)/i+`px`}else l.style.height&&(l.style.height=``);let x=y?u.top-h-p-g.y:u.bottom+p+g.y,S=v+m;if(c.overlap!==!0)for(let e of a)e.left<S&&e.right>v&&e.top<x+h&&e.bottom>x&&(x=y?e.top-h-2-p:e.bottom+p+2);if(this.position==`absolute`?(l.style.top=(x-e.parent.top)/i+`px`,xx(l,(v-e.parent.left)/r)):(l.style.top=x/i+`px`,xx(l,v/r)),f){let e=u.left+(_?g.x:-g.x)-(v+14-7);f.style.left=e/r+`px`}c.overlap!==!0&&a.push({left:v,top:x,right:S,bottom:x+h}),l.classList.toggle(`cm-tooltip-above`,y),l.classList.toggle(`cm-tooltip-below`,!y),c.positioned&&c.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=uT}},{eventObservers:{scroll(){this.maybeMeasure()}}}),hT=J.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:`border-box`},"&light .cm-tooltip":{border:`1px solid #bbb`,backgroundColor:`#f5f5f5`},"&light .cm-tooltip-section:not(:first-child)":{borderTop:`1px solid #bbb`},"&dark .cm-tooltip":{backgroundColor:`#333338`,color:`white`},".cm-tooltip-arrow":{height:`7px`,width:`14px`,position:`absolute`,zIndex:-1,overflow:`hidden`,"&:before, &:after":{content:`''`,position:`absolute`,width:0,height:0,borderLeft:`7px solid transparent`,borderRight:`7px solid transparent`},".cm-tooltip-above &":{bottom:`-7px`,"&:before":{borderTop:`7px solid #bbb`},"&:after":{borderTop:`7px solid #f5f5f5`,bottom:`1px`}},".cm-tooltip-below &":{top:`-7px`,"&:before":{borderBottom:`7px solid #bbb`},"&:after":{borderBottom:`7px solid #f5f5f5`,top:`1px`}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:`#333338`,borderBottomColor:`#333338`},"&:after":{borderTopColor:`transparent`,borderBottomColor:`transparent`}}}),gT={x:0,y:0},_T=W.define({enables:[mT,hT]}),vT=W.define({combine:e=>e.reduce((e,t)=>e.concat(t),[])}),yT=class e{static create(t){return new e(t)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement(`div`),this.dom.classList.add(`cm-tooltip-hover`),this.manager=new dT(e,vT,(e,t)=>this.createHostedView(e,t),e=>e.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add(`cm-tooltip-section`),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)==null||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp(`offset`)}get getCoords(){return this.passProp(`getCoords`)}get overlap(){return this.passProp(`overlap`)}get resize(){return this.passProp(`resize`)}},bT=_T.compute([vT],e=>{let t=e.facet(vT);return t.length===0?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>e.end??e.pos)),create:yT.create,above:t[0].above,arrow:t.some(e=>e.arrow)}}),xT=class{constructor(e,t,n,r,i){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=i,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener(`mouseleave`,this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener(`mousemove`,this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,n=e.docView.tile.nearest(t.target);if(!n)return;let r,i=1;if(n.isWidget())r=n.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let n=e.coordsAtPos(r);if(!n||t.y<n.top||t.y>n.bottom||t.x<n.left-e.defaultCharacterWidth||t.x>n.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(e=>e.from<=r&&e.to>=r),o=a&&a.dir==mS.RTL?-1:1;i=t.x<n.left?-o:o}let a=this.source(e,r,i);if(a?.then){let t=this.pending={pos:r};a.then(n=>{this.pending==t&&(this.pending=null,n&&!(Array.isArray(n)&&!n.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])}))},t=>gy(e.state,t,`hover tooltip`))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(mT),t=e?e.manager.tooltips.findIndex(e=>e.create==yT.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:t,tooltip:n}=this;if(t.length&&n&&!Sx(n.dom,e)||this.pending){let{pos:n}=t[0]||this.pending,r=t[0]?.end??n;(n==r?this.view.posAtCoords(this.lastMove)!=n:!Cx(this.view,n,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener(`mouseleave`,t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener(`mouseleave`,t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener(`mouseleave`,this.mouseleave),this.view.dom.removeEventListener(`mousemove`,this.mousemove)}},ST=4,CT=G.define(),wT=CT.of(null),TT=W.define({combine(e){let t,n;for(let r of e)t||=r.topContainer,n||=r.bottomContainer;return{topContainer:t,bottomContainer:n}}}),ET=US.fromClass(class{constructor(e){this.input=e.state.facet(OT),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(t=>t(e));let t=e.state.facet(TT);this.top=new DT(e,!0,t.topContainer),this.bottom=new DT(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}update(e){let t=e.state.facet(TT);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new DT(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new DT(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(OT);if(n!=this.input){let t=n.filter(e=>e),r=[],i=[],a=[],o=[];for(let n of t){let t=this.specs.indexOf(n),s;t<0?(s=n(e.view),o.push(s)):(s=this.panels[t],s.update&&s.update(e)),r.push(s),(s.top?i:a).push(s)}this.specs=t,this.panels=r,this.top.sync(i),this.bottom.sync(a);for(let e of o)e.dom.classList.add(`cm-panel`),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>J.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),DT=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes=``,this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&=(this.dom.remove(),void 0);return}if(!this.dom){this.dom=document.createElement(`div`),this.dom.className=this.top?`cm-panels cm-panels-top`:`cm-panels cm-panels-bottom`,this.dom.style[this.top?`top`:`bottom`]=`0`;let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Ax(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Ax(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(` `))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(` `))e&&this.container.classList.add(e)}}},OT=W.define({enables:ET}),kT=j_.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(AT)?e=[n.value].concat(e):n.is(jT)&&(e=e.filter(e=>e!=n.value));return e},provide:e=>OT.computeN([e],t=>t.field(e))}),AT=G.define(),jT=G.define(),MT=class extends ev{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}},MT.prototype.elementClass=``,MT.prototype.toDOM=void 0,MT.prototype.mapMode=C_.TrackBefore,MT.prototype.startSide=MT.prototype.endSide=-1,MT.prototype.point=!0,NT=W.define(),PT=W.define(),FT={class:``,renderEmptyElements:!1,elementStyle:``,markers:()=>rv.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:`before`},IT=W.define(),LT=W.define({combine:e=>e.some(e=>e)}),RT=US.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement(`div`),this.dom.className=`cm-gutters cm-gutters-before`,this.dom.setAttribute(`aria-hidden`,`true`),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.gutters=e.state.facet(IT).map(t=>new BT(e,t)),this.fixed=!e.state.facet(LT);for(let e of this.gutters)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position=`sticky`),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement(`div`),this.domAfter.className=`cm-gutters cm-gutters-after`,this.domAfter.setAttribute(`aria-hidden`,`true`),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+`px`,this.domAfter.style.position=this.fixed?`sticky`:``,this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+`px`;this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(LT)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?`sticky`:``,this.domAfter&&(this.domAfter.style.position=this.fixed?`sticky`:``)),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=rv.iter(this.view.state.facet(NT),this.view.viewport.from),r=[],i=this.gutters.map(e=>new zT(e,this.view.viewport,-this.view.documentPadding.top));for(let e of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(e.type)){let t=!0;for(let a of e.type)if(a.type==aS.Text&&t){Lx(n,r,a.from);for(let e of i)e.line(this.view,a,r);t=!1}else if(a.widget)for(let e of i)e.widget(this.view,a)}else if(e.type==aS.Text){Lx(n,r,e.from);for(let t of i)t.line(this.view,e,r)}else if(e.widget)for(let t of i)t.widget(this.view,e);for(let e of i)e.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(IT),n=e.state.facet(IT),r=e.docChanged||e.heightChanged||e.viewportChanged||!rv.eq(e.startState.facet(NT),e.state.facet(NT),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let t of this.gutters)t.update(e)&&(r=!0);else{r=!0;let i=[];for(let r of n){let n=t.indexOf(r);n<0?i.push(new BT(this.view,r)):(this.gutters[n].update(e),i.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),i.indexOf(e)<0&&e.destroy();for(let e of i)e.config.side==`after`?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>J.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==mS.LTR?{left:r,right:i}:{right:r,left:i}})}),zT=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=rv.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,i=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let t=new VT(e,a,i,n);r.elements.push(t),r.dom.appendChild(t.dom)}else r.elements[this.i].update(e,a,i,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];Lx(this.cursor,r,t.from),n.length&&(r=r.concat(n));let i=this.gutter.config.lineMarker(e,t,r);i&&r.unshift(i);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let n of e.state.facet(PT)){let i=n(e,t.widget,t);i&&(r||=[]).push(i)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},BT=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement(`div`),this.dom.className=`cm-gutter`+(this.config.class?` `+this.config.class:``);for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let i=r.target,a;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();a=(e.top+e.bottom)/2}else a=r.clientY;let o=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[n](e,o,r)&&r.preventDefault()});this.markers=Ix(t.markers(e)),t.initialSpacer&&(this.spacer=new VT(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+=`visibility: hidden; pointer-events: none`)}update(e){let t=this.markers;if(this.markers=Ix(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!rv.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},VT=class{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement(`div`),this.dom.className=`cm-gutterElement`,this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+`px`),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+`px`:``),Rx(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n=`cm-gutterElement`,r=this.dom.firstChild;for(let i=0,a=0;;){let o=a,s=i<t.length?t[i++]:null,c=!1;if(s){let e=s.elementClass;e&&(n+=` `+e);for(let e=a;e<this.markers.length;e++)if(this.markers[e].compare(s)){o=e,c=!0;break}}else o=this.markers.length;for(;a<o;){let e=this.markers[a++];if(e.toDOM){e.destroy(r);let t=r.nextSibling;r.remove(),r=t}}if(!s)break;s.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(s.toDOM(e),r)),c&&a++}this.dom.className=n,this.markers=t}destroy(){this.setMarkers(null,[])}},HT=W.define(),UT=W.define(),WT=W.define({combine(e){return n_(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let e in t){let r=n[e],i=t[e];n[e]=r?(e,t,n)=>r(e,t,n)||i(e,t,n):i}return n}})}}),GT=class extends MT{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}},KT=IT.compute([WT],e=>({class:`cm-lineNumbers`,renderEmptyElements:!1,markers(e){return e.state.facet(HT)},lineMarker(e,t,n){return n.some(e=>e.toDOM)?null:new GT(zx(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(UT)){let i=r(e,t,n);if(i)return i}return null},lineMarkerChange:e=>e.startState.facet(WT)!=e.state.facet(WT),initialSpacer(e){return new GT(zx(e,Vx(e.state.doc.lines)))},updateSpacer(e,t){let n=zx(t.view,Vx(t.view.state.doc.lines));return n==e.number?e:new GT(n)},domEventHandlers:e.facet(WT).domEventHandlers,side:`before`})),qT=new class extends MT{constructor(){super(...arguments),this.elementClass=`cm-activeLineGutter`}},JT=NT.compute([`selection`],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(qT.range(i)))}return rv.of(t)}),YT=q.mark({class:`cm-highlightTab`}),XT=q.mark({class:`cm-highlightSpace`}),ZT=Ux(new qw({regexp:/\t| /g,decoration:e=>e[0]==` `?YT:XT,boundary:/\S/})),QT=Ux(new qw({regexp:/\s+$/g,decoration:q.mark({class:`cm-trailingSpace`})})),$T={HeightMap:tw,HeightOracle:XC,MeasuredHeights:ZC,QueryType:$C,ChangedRange:eC,computeOrder:fy,moveVisually:my,clearHeightChangeFlag:wb,getHeightChangeFlag:()=>YC}}));function tE(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function nE(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof EE&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:xE.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof EE&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}function rE(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function iE(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}function aE(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof EE&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new kE(i,n)}function oE(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof EE?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=hE.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new EE(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(nE(o,t,n,!1))}}return i?aE(i):r}function sE(e){return e.children.some(e=>e instanceof wE||!e.type.isAnonymous||sE(e))}function cE(e){let{buffer:t,nodeSet:n,maxBufferLength:r=dE,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new CE(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:ee,size:C}=o,te=l,ne=c;if(C<0)if(o.next(),C==-1){let t=i[x];_.push(t),v.push(S-e);return}else if(C==-3){c=x;return}else if(C==-4){l=x;return}else throw RangeError(`Unrecognized record size: ${C}`);let re=s[x],ie,ae,oe=S-e;if(ee-S<=r&&(ae=h(o.pos-t,y))){let t=new Uint16Array(ae.size-ae.skip),r=o.pos-ae.size,i=t.length;for(;o.pos>r;)i=g(ae.start,t,i);ie=new wE(t,ee-ae.start,n),oe=ae.start-e}else{let e=o.pos-C;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=ee;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,te,ne),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,te,ne),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(re,ne);ie=uE(re,t,n,0,t.length,0,ee-S,e,e)}else ie=m(re,t,n,ee-S,te-ee,ne)}_.push(ie),v.push(oe)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new wE(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof SE){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(mE.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[mE.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[mE.lookAhead,i];o=o?[e].concat(o):[e]}return new SE(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};scan:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0)if(n.size==-3||n.size==-4)d+=4;else break scan;else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new SE(s[e.topID],_.reverse(),v.reverse(),y)}function lE(e,t){if(!e.isAnonymous||t instanceof wE||t.type!=e)return 1;let n=jE.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof SE)){n=1;break}n+=lE(e,r)}jE.set(t,n)}return n}function uE(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=lE(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=lE(e,t[s]);for(s++;s<i;s++){let n=lE(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(uE(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var dE,fE,pE,mE,hE,gE,_E,vE,yE,bE,xE,SE,CE,wE,TE,EE,DE,OE,kE,AE,jE,ME,NE,PE,FE=n((()=>{dE=1024,fE=0,pE=class{constructor(e,t){this.from=e,this.to=t}},mE=class{constructor(e={}){this.id=fE++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=_E.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}},mE.closedBy=new mE({deserialize:e=>e.split(` `)}),mE.openedBy=new mE({deserialize:e=>e.split(` `)}),mE.group=new mE({deserialize:e=>e.split(` `)}),mE.isolate=new mE({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),mE.contextHash=new mE({perNode:!0}),mE.lookAhead=new mE({perNode:!0}),mE.mounted=new mE({perNode:!0}),hE=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[mE.mounted.id]}},gE=Object.create(null),_E=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):gE,r=!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e==`string`){if(this.name==e)return!0;let t=this.prop(mE.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(mE.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}},_E.none=new _E(``,Object.create(null),0,8),vE=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new _E(e.name,r,e.id,e.flags):e)}return new e(n)}},yE=new WeakMap,bE=new WeakMap,(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(xE||={}),SE=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=hE.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new AE(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new AE(yE.get(this)||this.topNode);return r.moveTo(e,t),yE.set(this,r._tree),r}get topNode(){return new EE(this,0,0,null)}resolve(e,t=0){let n=nE(yE.get(this)||this.topNode,e,t,!1);return yE.set(this,n),n}resolveInner(e,t=0){let n=nE(bE.get(this)||this.topNode,e,t,!0);return bE.set(this,n),n}resolveStack(e,t=0){return oE(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&xE.IncludeAnonymous)>0;for(let e=this.cursor(a|xE.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(t={}){return this.children.length<=8?this:uE(_E.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(_E.none,t,n,r)))}static build(e){return cE(e)}},SE.empty=new SE(_E.none,[],[],0),CE=class e{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new e(this.buffer,this.index)}},wE=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return _E.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(tE(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}},TE=class{cursor(e=0){return new AE(this,e)}getChild(e,t=null,n=null){let r=rE(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return rE(this,e,t,n)}resolve(e,t=0){return nE(this,e,t,!1)}resolveInner(e,t=0){return nE(this,e,t,!0)}matchContext(e){return iE(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},EE=class e extends TE{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from,d;if(!(!(a&xE.EnterBracketed&&l instanceof SE&&(d=hE.get(l))&&!d.overlay&&d.bracketed&&r>=u&&r<=u+l.length)&&!tE(i,r,u,u+l.length))){if(l instanceof wE){if(a&xE.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new OE(new DE(o,l,t,u),null,e)}else if(a&xE.IncludeAnonymous||!l.type.isAnonymous||sE(l)){let s;if(!(a&xE.IgnoreMounts)&&(s=hE.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&xE.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&xE.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let i;if(!(r&xE.IgnoreOverlays)&&(i=hE.get(this._tree))&&i.overlay){let a=t-this.from,o=r&xE.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}},DE=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},OE=class e extends TE{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&xE.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new SE(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}},kE=class{constructor(e,t){this.heads=e,this.node=t}get next(){return aE(this.heads)}},AE=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~xE.EnterBracketed,e instanceof EE)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof EE?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&xE.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xE.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&xE.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else ({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&xE.IncludeAnonymous||e instanceof wE||!e.type.isAnonymous||sE(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new OE(this.buffer,t,this.stack[e]);return this.bufferNode=new OE(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return iE(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return iE(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}},jE=new WeakMap,ME=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},NE=class{startParse(e,t,n){return typeof e==`string`&&(e=new PE(e)),n=n?n.length?n.map(e=>new pE(e.from,e.to)):[new pE(0,0)]:[new pE(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},PE=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}},new mE({perNode:!0})}));function IE(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function LE(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function RE(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new JE(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return qE.add(t)}function zE(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function BE(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function VE(e,t,n,r=0,i=e.length){let a=new YE(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}function HE(e){let t=e.type.prop(qE);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var UE,WE,GE,KE,qE,JE,YE,Y,XE,ZE,QE,$E,eD,tD,nD,rD,iD,aD,oD,sD,cD,lD,X,uD=n((()=>{FE(),UE=0,WE=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=UE++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new KE(e);return e=>e.modified.indexOf(t)>-1?e:KE.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},GE=0,KE=class e{constructor(e){this.name=e,this.instances=[],this.id=GE++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&IE(n,e.modified));if(r)return r;let i=[],a=new WE(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=LE(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}},qE=new mE({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new JE(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),JE=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}},JE.empty=new JE([],2,null),YE=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=``}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,i){let{type:a,from:o,to:s}=e;if(o>=n||s<=t)return;a.isTop&&(i=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,l=HE(e)||JE.empty,u=BE(i,l.tags);if(u&&(c&&(c+=` `),c+=u,l.mode==1&&(r+=(r?` `:``)+u)),this.startSpan(Math.max(t,o),c),l.opaque)return;let d=e.tree&&e.tree.prop(mE.mounted);if(d&&d.overlay){let a=e.node.enter(d.overlay[0].from+o,1),l=this.highlighters.filter(e=>!e.scope||e.scope(d.tree.type)),u=e.firstChild();for(let f=0,p=o;;f++){let m=f<d.overlay.length?d.overlay[f]:null,h=m?m.from+o:s,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,r,i),this.startSpan(Math.min(_,e.to),c),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+o,p>t&&(this.highlightRange(a.cursor(),Math.max(t,m.from+o),Math.min(n,p),``,l),this.startSpan(Math.min(n,p),c))}u&&e.parent()}else if(e.firstChild()){d&&(r=``);do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,i),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}},Y=WE.define,XE=Y(),ZE=Y(),QE=Y(ZE),$E=Y(ZE),eD=Y(),tD=Y(eD),nD=Y(eD),rD=Y(),iD=Y(rD),aD=Y(),oD=Y(),sD=Y(),cD=Y(sD),lD=Y(),X={comment:XE,lineComment:Y(XE),blockComment:Y(XE),docComment:Y(XE),name:ZE,variableName:Y(ZE),typeName:QE,tagName:Y(QE),propertyName:$E,attributeName:Y($E),className:Y(ZE),labelName:Y(ZE),namespace:Y(ZE),macroName:Y(ZE),literal:eD,string:tD,docString:Y(tD),character:Y(tD),attributeValue:Y(tD),number:nD,integer:Y(nD),float:Y(nD),bool:Y(eD),regexp:Y(eD),escape:Y(eD),color:Y(eD),url:Y(eD),keyword:aD,self:Y(aD),null:Y(aD),atom:Y(aD),unit:Y(aD),modifier:Y(aD),operatorKeyword:Y(aD),controlKeyword:Y(aD),definitionKeyword:Y(aD),moduleKeyword:Y(aD),operator:oD,derefOperator:Y(oD),arithmeticOperator:Y(oD),logicOperator:Y(oD),bitwiseOperator:Y(oD),compareOperator:Y(oD),updateOperator:Y(oD),definitionOperator:Y(oD),typeOperator:Y(oD),controlOperator:Y(oD),punctuation:sD,separator:Y(sD),bracket:cD,angleBracket:Y(cD),squareBracket:Y(cD),paren:Y(cD),brace:Y(cD),content:rD,heading:iD,heading1:Y(iD),heading2:Y(iD),heading3:Y(iD),heading4:Y(iD),heading5:Y(iD),heading6:Y(iD),contentSeparator:Y(rD),list:Y(rD),quote:Y(rD),emphasis:Y(rD),strong:Y(rD),link:Y(rD),monospace:Y(rD),strikethrough:Y(rD),inserted:Y(),deleted:Y(),changed:Y(),invalid:Y(),meta:lD,documentMeta:Y(lD),annotation:Y(lD),processingInstruction:Y(lD),definition:WE.defineModifier(`definition`),constant:WE.defineModifier(`constant`),function:WE.defineModifier(`function`),standard:WE.defineModifier(`standard`),local:WE.defineModifier(`local`),special:WE.defineModifier(`special`)};for(let e in X){let t=X[e];t instanceof WE&&(t.name=e)}zE([{tag:X.link,class:`tok-link`},{tag:X.heading,class:`tok-heading`},{tag:X.emphasis,class:`tok-emphasis`},{tag:X.strong,class:`tok-strong`},{tag:X.keyword,class:`tok-keyword`},{tag:X.atom,class:`tok-atom`},{tag:X.bool,class:`tok-bool`},{tag:X.url,class:`tok-url`},{tag:X.labelName,class:`tok-labelName`},{tag:X.inserted,class:`tok-inserted`},{tag:X.deleted,class:`tok-deleted`},{tag:X.literal,class:`tok-literal`},{tag:X.string,class:`tok-string`},{tag:X.number,class:`tok-number`},{tag:[X.regexp,X.escape,X.special(X.string)],class:`tok-string2`},{tag:X.variableName,class:`tok-variableName`},{tag:X.local(X.variableName),class:`tok-variableName tok-local`},{tag:X.definition(X.variableName),class:`tok-variableName tok-definition`},{tag:X.special(X.variableName),class:`tok-variableName2`},{tag:X.definition(X.propertyName),class:`tok-propertyName tok-definition`},{tag:X.typeName,class:`tok-typeName`},{tag:X.namespace,class:`tok-namespace`},{tag:X.className,class:`tok-className`},{tag:X.macroName,class:`tok-macroName`},{tag:X.propertyName,class:`tok-propertyName`},{tag:X.operator,class:`tok-operator`},{tag:X.comment,class:`tok-comment`},{tag:X.meta,class:`tok-meta`},{tag:X.invalid,class:`tok-invalid`},{tag:X.punctuation,class:`tok-punctuation`}])})),dD=i({DocInput:()=>OO,HighlightStyle:()=>lk,IndentContext:()=>BO,LRLanguage:()=>DO,Language:()=>EO,LanguageDescription:()=>LO,LanguageSupport:()=>IO,ParseContext:()=>AO,StreamLanguage:()=>Tk,StringStream:()=>Ck,TreeIndentContext:()=>HO,bidiIsolates:()=>xO,bracketMatching:()=>nO,bracketMatchingHandle:()=>Sk,codeFolding:()=>JD,continuedIndent:()=>ND,defaultHighlightStyle:()=>mk,defineLanguageFacet:()=>fD,delimitedIndent:()=>jD,ensureSyntaxTree:()=>hD,flatIndent:()=>UO,foldAll:()=>QO,foldCode:()=>XO,foldEffect:()=>qO,foldGutter:()=>XD,foldInside:()=>FD,foldKeymap:()=>tk,foldNodeProp:()=>KO,foldService:()=>GO,foldState:()=>YO,foldable:()=>RD,foldedRanges:()=>HD,forceParsing:()=>_D,getIndentUnit:()=>bD,getIndentation:()=>SD,highlightingFor:()=>$D,indentNodeProp:()=>VO,indentOnInput:()=>PD,indentRange:()=>CD,indentService:()=>RO,indentString:()=>xD,indentUnit:()=>zO,language:()=>FO,languageDataProp:()=>wO,matchBrackets:()=>aO,sublanguageProp:()=>TO,syntaxHighlighting:()=>QD,syntaxParserRunning:()=>vD,syntaxTree:()=>mD,syntaxTreeAvailable:()=>gD,toggleFold:()=>ek,unfoldAll:()=>$O,unfoldCode:()=>ZO,unfoldEffect:()=>JO});function fD(e){return W.define({combine:e?t=>t.concat(e):void 0})}function pD(e,t,n){let r=e.facet(FO),i=mD(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,xE.ExcludeBuffers|xE.EnterBracketed))e.type.isTop&&(i=e);return i}function mD(e){let t=e.field(EO.state,!1);return t?t.tree:SE.empty}function hD(e,t,n=50){let r=e.field(EO.state,!1)?.context;if(!r)return null;let i=r.viewport;r.updateViewport({from:0,to:t});let a=r.isDone(t)||r.work(n,t)?r.tree:null;return r.updateViewport(i),a}function gD(e,t=e.doc.length){return e.field(EO.state,!1)?.context.isDone(t)||!1}function _D(e,t=e.viewport.to,n=100){let r=hD(e.state,t,n);return r!=mD(e.state)&&e.dispatch({}),!!r}function vD(e){return e.plugin(PO)?.isWorking()||!1}function yD(e,t,n){return ME.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}function bD(e){let t=e.facet(zO);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function xD(e,t){let n=``,r=e.tabSize,i=e.facet(zO)[0];if(i==` `){for(;t>=r;)n+=` `,t-=r;i=` `}for(let e=0;e<t;e++)n+=i;return n}function SD(e,t){e instanceof $_&&(e=new BO(e));for(let n of e.state.facet(RO)){let r=n(e,t);if(r!==void 0)return r}let n=mD(e.state);return n.length>=t?wD(e,n,t):null}function CD(e,t,n){let r=Object.create(null),i=new BO(e,{overrideIndentation:e=>r[e]??-1}),a=[];for(let o=t;o<=n;){let t=e.doc.lineAt(o);o=t.to+1;let n=SD(i,t.from);if(n==null)continue;/\S/.test(t.text)||(n=0);let s=/^\s*/.exec(t.text)[0],c=xD(e,n);s!=c&&(r[t.from]=n,a.push({from:t.from,to:t.from+s.length,insert:c}))}return e.changes(a)}function wD(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t&&!(t.from<r.node.from||t.to>r.node.to||t.from==r.node.from&&t.type==r.node.type);t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return TD(r,e,n)}function TD(e,t,n){for(let r=e;r;r=r.next){let e=DD(r.node);if(e)return e(HO.create(t,n,r))}return 0}function ED(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function DD(e){let t=e.type.prop(VO);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(mE.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>MD(e,!0,1,void 0,n&&!ED(e)?t.from:void 0)}return e.parent==null?OD:null}function OD(){return 0}function kD(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function AD(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),o=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped){if(i.from>=o)return null;let e=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+e}}e=i.to}}function jD({closing:e,align:t=!0,units:n=1}){return r=>MD(r,t,n,e)}function MD(e,t,n,r,i){let a=e.textAfter,o=a.match(/^\s*/)[0].length,s=r&&a.slice(o,o+r.length)==r||i==e.pos+o,c=t?AD(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}function ND({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}function PD(){return $_.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent(`input.type`)&&!e.isUserEvent(`input.complete`))return e;let t=e.startState.languageDataAt(`indentOnInput`,e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+WO)return e;let a=n.sliceString(i.from,r);if(!t.some(e=>e.test(a)))return e;let{state:o}=e,s=-1,c=[];for(let{head:e}of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==s)continue;s=t.from;let n=SD(o,t.from);if(n==null)continue;let r=/^\s*/.exec(t.text)[0],i=xD(o,n);r!=i&&c.push({from:t.from,to:t.from+r.length,insert:i})}return c.length?[e,{changes:c,sequential:!0}]:e})}function FD(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function ID(e,t,n){let r=mD(e);if(r.length<n)return null;let i=r.resolveStack(n,1),a=null;for(let o=i;o;o=o.next){let i=o.node;if(i.to<=n||i.from>n)continue;if(a&&i.from<t)break;let s=i.type.prop(KO);if(s&&(i.to<r.length-50||r.length==e.doc.length||!LD(i))){let r=s(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(a=r)}}return a}function LD(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function RD(e,t,n){for(let r of e.facet(GO)){let i=r(e,t,n);if(i)return i}return ID(e,t,n)}function zD(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}function BD(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}function VD(e,t,n=t){let r=!1;return e.between(t,n,(e,i)=>{e<n&&i>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(e,r)=>e>=n||r<=t}):e}function HD(e){return e.field(YO,!1)||rv.empty}function UD(e,t,n){var r;let i=null;return(r=e.field(YO,!1))==null||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function WD(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}function GD(e,t){return e.field(YO,!1)?t:t.concat(G.appendConfig.of(JD()))}function KD(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return J.announce.of(`${e.state.phrase(n?`Folded lines`:`Unfolded lines`)} ${r} ${e.state.phrase(`to`)} ${i}.`)}function qD(e,t){for(let n=t;;){let r=RD(e.state,n.from,n.to);if(r&&r.to>t.from)return r;if(!n.from)return null;n=e.lineBlockAt(n.from-1)}}function JD(e){let t=[YO,ck];return e&&t.push(rk.of(e)),t}function YD(e,t){let{state:n}=e,r=n.facet(rk),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=UD(e.state,n.from,n.to);r&&e.dispatch({effects:JO.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let a=document.createElement(`span`);return a.textContent=r.placeholderText,a.setAttribute(`aria-label`,n.phrase(`folded code`)),a.title=n.phrase(`unfold`),a.className=`cm-foldPlaceholder`,a.onclick=i,a}function XD(e={}){let t={...ok,...e},n=new sk(t,!0),r=new sk(t,!1),i=US.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(FO)!=e.state.facet(FO)||e.startState.field(YO,!1)!=e.state.field(YO,!1)||mD(e.startState)!=mD(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new iv;for(let i of e.viewportLineBlocks){let a=UD(e.state,i.from,i.to)?r:RD(e.state,i.from,i.to)?n:null;a&&t.add(i.from,i.from,a)}return t.finish()}}),{domEventHandlers:a}=t;return[i,Px({class:`cm-foldGutter`,markers(e){return e.plugin(i)?.markers||rv.empty},initialSpacer(){return new sk(t,!1)},domEventHandlers:{...a,click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let r=UD(e.state,t.from,t.to);if(r)return e.dispatch({effects:JO.of(r)}),!0;let i=RD(e.state,t.from,t.to);return i?(e.dispatch({effects:qO.of(i)}),!0):!1}}}),JD()]}function ZD(e){let t=e.facet(uk);return t.length?t:e.facet(dk)}function QD(e,t){let n=[pk],r;return e instanceof lk&&(e.module&&n.push(J.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(dk.of(e)):r?n.push(uk.computeN([J.darkTheme],t=>t.facet(J.darkTheme)==(r==`dark`)?[e]:[])):n.push(uk.of(e)),n}function $D(e,t,n){let r=ZD(e),i=null;if(r){for(let e of r)if(!e.scope||n&&e.scope(n)){let n=e.style(t);n&&(i=i?i+` `+n:n)}}return i}function eO(e){let t=[],n=e.matched?yk:bk;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function tO(e){let t=[],n=e.facet(vk);for(let r of e.selection.ranges){if(!r.empty)continue;let i=aO(e,r.head,-1,n)||r.head>0&&aO(e,r.head-1,1,n)||n.afterCursor&&(aO(e,r.head,1,n)||r.head<e.doc.length&&aO(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return q.set(t,!0)}function nO(e={}){return[vk.of(e),xk]}function rO(e,t,n){let r=e.prop(t<0?mE.openedBy:mE.closedBy);if(r)return r;if(e.name.length==1){let r=n.indexOf(e.name);if(r>-1&&r%2==+(t<0))return[n[r+t]]}return null}function iO(e){let t=e.type.prop(Sk);return t?t(e.node):e}function aO(e,t,n,r={}){let i=r.maxScanDistance||gk,a=r.brackets||_k,o=mD(e),s=o.resolveInner(t,n);for(let r=s;r;r=r.parent){let i=rO(r.type,n,a);if(i&&r.from<r.to){let o=iO(r);if(o&&(n>0?t>=o.from&&t<o.to:t>o.from&&t<=o.to))return oO(e,t,n,r,o,i,a)}}return sO(e,t,n,o,s.type,i,a)}function oO(e,t,n,r,i,a,o){let s=r.parent,c={from:i.from,to:i.to},l=0,u=s?.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(l==0&&a.indexOf(u.type.name)>-1&&u.from<u.to){let e=iO(u);return{start:c,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}else if(rO(u.type,n,o))l++;else if(rO(u.type,-n,o)){if(l==0){let e=iO(u);return{start:c,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}l--}}while(n<0?u.prevSibling():u.nextSibling());return{start:c,matched:!1}}function sO(e,t,n,r,i,a,o){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=o.indexOf(s);if(c<0||c%2==0!=n>0)return null;let l={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=a;){let a=u.value;n<0&&(e+=a.length);let s=t+e*n;for(let e=n>0?0:a.length-1,t=n>0?a.length:-1;e!=t;e+=n){let t=o.indexOf(a[e]);if(!(t<0||r.resolveInner(s+e,1).type!=i))if(t%2==0==n>0)d++;else if(d==1)return{start:l,end:{from:s+e,to:s+e+1},matched:t>>1==c>>1};else d--}n>0&&(e+=a.length)}return u.done?{start:l,matched:!1}:null}function cO(e,t,n,r=0,i=0){t??(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));let a=i;for(let i=r;i<t;i++)e.charCodeAt(i)==9?a+=n-a%n:a++;return a}function lO(e){return{name:e.name||``,token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||uO,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||Dk,mergeTokens:e.mergeTokens!==!1}}function uO(e){if(typeof e!=`object`)return e;let t={};for(let n in e){let r=e[n];t[n]=r instanceof Array?r.slice():r}return t}function dO(e,t,n,r,i){let a=n>=r&&n+t.length<=i&&t.prop(e.stateAfter);if(a)return{state:e.streamParser.copyState(a),pos:n+t.length};for(let a=t.children.length-1;a>=0;a--){let o=t.children[a],s=n+t.positions[a],c=o instanceof SE&&s<i&&dO(e,o,s,r,i);if(c)return c}return null}function fO(e,t,n,r,i){if(i&&n<=0&&r>=t.length)return t;!i&&n==0&&t.type==e.topNode&&(i=!0);for(let a=t.children.length-1;a>=0;a--){let o=t.positions[a],s=t.children[a],c;if(o<r&&s instanceof SE){if(!(c=fO(e,s,n-o,r-o,i)))break;return i?new SE(t.type,t.children.slice(0,a).concat(c),t.positions.slice(0,a+1),o+c.length):c}}return null}function pO(e,t,n,r,i){for(let i of t){let t=i.from+(i.openStart?25:0),a=i.to-(i.openEnd?25:0),o=t<=n&&a>n&&dO(e,i.tree,0-i.offset,n,a),s;if(o&&o.pos<=r&&(s=fO(e,i.tree,n+i.offset,o.pos+i.offset,!1)))return{state:o.state,tree:s}}return{state:e.streamParser.startState(i?bD(i):4),tree:SE.empty}}function mO(e,t,n){t.start=t.pos;for(let r=0;r<10;r++){let r=e(t,n);if(t.pos>t.start)return r}throw Error(`Stream parser failed to advance stream.`)}function hO(e,t){Ak.indexOf(e)>-1||(Ak.push(e),console.warn(t))}function gO(e,t){let n=[];for(let r of t.split(` `)){let t=[];for(let n of r.split(`.`)){let r=e[n]||X[n];r?typeof r==`function`?t.length?t=t.map(r):hO(n,`Modifier ${n} used at start of tag`):t.length?hO(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:hO(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,`_`),i=r+` `+n.map(e=>e.id),a=jk[i];if(a)return a.id;let o=jk[i]=_E.define({id:Ok.length,name:r,props:[RE({[r]:n})]});return Ok.push(o),o.id}function _O(e,t){let n=_E.define({id:Ok.length,name:`Document`,props:[wO.add(()=>e),VO.add(()=>e=>t.getIndent(e))],top:!0});return Ok.push(n),n}function vO(e){return e.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(e)}function yO(e){for(let t=e.iter();!t.next().done;)if(vO(t.value))return!0;return!1}function bO(e){let t=!1;return e.iterChanges((e,n,r,i,a)=>{!t&&yO(a)&&(t=!0)}),t}function xO(e={}){let t=[Ik];return e.alwaysIsolate&&t.push(Fk.of(!0)),t}function SO(e,t,n){let r=new iv,i=e.visibleRanges;n||(i=CO(i,e.state.doc));for(let{from:e,to:n}of i)t.iterate({enter:e=>{let t=e.type.prop(mE.isolate);t&&r.add(e.from,e.to,Lk[t])},from:e,to:n});return r.finish()}function CO(e,t){let n=t.iter(),r=0,i=[],a=null;for(let{from:t,to:o}of e)if(!(a&&a.to>t&&(t=a.to,t>=o)))for(r+n.value.length<t&&(n.next(t-(r+n.value.length)),r=t);;){let e=r,t=r+n.value.length;if(!n.lineBreak&&vO(n.value)&&(a&&a.to>e-10?a.to=Math.min(o,t):i.push(a={from:e,to:Math.min(o,t)})),t>=o)break;r=t,n.next()}return i}var wO,TO,EO,DO,OO,kO,AO,jO,MO,NO,PO,FO,IO,LO,RO,zO,BO,VO,HO,UO,WO,GO,KO,qO,JO,YO,XO,ZO,QO,$O,ek,tk,nk,rk,ik,ak,ok,sk,ck,lk,uk,dk,fk,pk,mk,hk,gk,_k,vk,yk,bk,xk,Sk,Ck,wk,Tk,Ek,Dk,Ok,kk,Ak,jk,Mk,Nk,Pk,Fk,Ik,Lk,Rk=n((()=>{FE(),cv(),eE(),uD(),gv(),wO=new mE,TO=new mE,EO=class{constructor(e,t,n=[],r=``){this.data=e,this.name=r,$_.prototype.hasOwnProperty(`tree`)||Object.defineProperty($_.prototype,`tree`,{get(){return mD(this)}}),this.parser=t,this.extension=[FO.of(this),$_.languageData.of((e,t,n)=>{let r=pD(e,t,n),i=r.type.prop(wO);if(!i)return[];let a=e.facet(i),o=r.type.prop(TO);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,e)){let n=e.facet(t.facet);return t.type==`replace`?n:n.concat(a)}}return a})].concat(n)}isActiveAt(e,t,n=-1){return pD(e,t,n).type.prop(wO)==this.data}findRegions(e){let t=e.facet(FO);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(wO)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(mE.mounted);if(i){if(i.tree.prop(wO)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}else if(i.overlay){let e=n.length;if(r(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof SE&&r(i,e.positions[n]+t)}};return r(mD(e),0),n}get allowsNesting(){return!0}},EO.setState=G.define(),DO=class e extends EO{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(t){let n=fD(t.languageData);return new e(n,t.parser.configure({props:[wO.add(e=>e.isTop?n:void 0)]}),t.name)}configure(t,n){return new e(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}},OO=class{constructor(e){this.doc=e,this.cursorPos=0,this.string=``,this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},kO=null,AO=class e{constructor(e,t,n=[],r,i,a,o,s){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=a,this.skipped=o,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new e(t,n,[],SE.empty,0,r,[],null)}startParse(){return this.parser.startParse(new OO(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=SE.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{if(typeof e==`number`){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||=this.startParse(),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(ME.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=this.parse.stoppedAt??this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(ME.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=kO;kO=this;try{return e()}finally{kO=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=yD(e,t.from,t.to);return e}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:o,skipped:s}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})),r=ME.applyChanges(r,e),i=SE.empty,a=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){s=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);n<r&&s.push({from:n,to:r})}}}return new e(this.parser,n,r,i,a,o,s,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=yD(this.fragments,n,r),this.skipped.splice(t--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&=(this.takeTree(),null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends NE{createParse(t,n,r){let i=r[0].from,a=r[r.length-1].to;return{parsedPos:i,advance(){let t=kO;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=a,new SE(_E.none,[],[],a-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return kO}},jO=class e{constructor(e){this.context=e,this.tree=e.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new e(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=AO.create(t.facet(FO).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new e(r)}},EO.state=j_.define({create:jO.init,update(e,t){for(let e of t.effects)if(e.is(EO.setState))return e.value;return t.startState.facet(FO)==t.state.facet(FO)?e.apply(t):jO.init(t.state)}}),MO=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)},typeof requestIdleCallback<`u`&&(MO=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)}),NO=typeof navigator<`u`&&navigator.scheduling?.isInputPending?()=>navigator.scheduling.isInputPending():null,PO=US.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(EO.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(EO.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=MO(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:r}}=this.view,i=n.field(EO.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!NO?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,s=i.context.work(()=>NO&&NO()||Date.now()>a,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(s||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:EO.setState.of(new jO(i.context))})),this.chunkBudget>0&&!(s&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&=(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>gy(this.view.state,e)).then(()=>this.workScheduled--),null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),FO=W.define({combine(e){return e.length?e[0]:null},enables:e=>[EO.state,PO,J.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),IO=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}},LO=class e{constructor(e,t,n,r,i,a=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=i,this.support=a,this.loading=null}load(){return this.loading||=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e})}static of(t){let{load:n,support:r}=t;if(!n){if(!r)throw RangeError(`Must pass either 'load' or 'support' to LanguageDescription.of`);n=()=>Promise.resolve(r)}return new e(t.name,(t.alias||[]).concat(t.name).map(e=>e.toLowerCase()),t.extensions||[],t.filename,n,r)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let n=/\.([^.]+)$/.exec(t);if(n){for(let t of e)if(t.extensions.indexOf(n[1])>-1)return t}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some(e=>e==t))return n;if(n)for(let n of e)for(let e of n.alias){let r=t.indexOf(e);if(r>-1&&(e.length>2||!/\w/.test(t[r-1])&&!/\w/.test(t[r+e.length])))return n}return null}},RO=W.define(),zO=W.define({combine:e=>{if(!e.length)return` `;let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error(`Invalid indent unit: `+JSON.stringify(e[0]));return t}}),BO=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=bD(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=n.from&&r<=n.to?i&&r==e?{text:``,from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return``;let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(i+=a-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return p_(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},VO=new mE,HO=class e extends BO{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(t,n,r){return new e(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(kD(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return TD(this.context.next,this.base,this.pos)}},UO=e=>e.baseIndent,WO=200,GO=W.define(),KO=new mE,qO=G.define({map:zD}),JO=G.define({map:zD}),YO=j_.define({create(){return q.none},update(e,t){t.isUserEvent(`delete`)&&t.changes.iterChangedRanges((t,n)=>e=VD(e,t,n)),e=e.map(t.changes);for(let n of t.effects)if(n.is(qO)&&!WD(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(rk),i=r?q.replace({widget:new ak(r(t.state,n.value))}):ik;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(JO)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));return t.selection&&(e=VD(e,t.selection.main.head)),e},provide:e=>J.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError(`Invalid JSON for fold state`);let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid JSON for fold state`);t.push(ik.range(r,i))}return q.set(t,!0)}}),XO=e=>{for(let t of BD(e)){let n=RD(e.state,t.from,t.to);if(n)return e.dispatch({effects:GD(e.state,[qO.of(n),KD(e,n)])}),!0}return!1},ZO=e=>{if(!e.state.field(YO,!1))return!1;let t=[];for(let n of BD(e)){let r=UD(e.state,n.from,n.to);r&&t.push(JO.of(r),KD(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0},QO=e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=RD(t,i.from,i.to);a&&n.push(qO.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:GD(e.state,n)}),!!n.length},$O=e=>{let t=e.state.field(YO,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(JO.of({from:e,to:t}))}),e.dispatch({effects:n}),!0},ek=e=>{let t=[];for(let n of BD(e)){let r=UD(e.state,n.from,n.to);if(r)t.push(JO.of(r),KD(e,r,!1));else{let r=qD(e,n);r&&t.push(qO.of(r),KD(e,r))}}return t.length>0&&e.dispatch({effects:GD(e.state,t)}),!!t.length},tk=[{key:`Ctrl-Shift-[`,mac:`Cmd-Alt-[`,run:XO},{key:`Ctrl-Shift-]`,mac:`Cmd-Alt-]`,run:ZO},{key:`Ctrl-Alt-[`,run:QO},{key:`Ctrl-Alt-]`,run:$O}],nk={placeholderDOM:null,preparePlaceholder:null,placeholderText:`…`},rk=W.define({combine(e){return n_(e,nk)}}),ik=q.replace({widget:new class extends iS{toDOM(e){return YD(e,null)}}}),ak=class extends iS{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return YD(e,this.value)}},ok={openText:`⌄`,closedText:`›`,markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},sk=class extends MT{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement(`span`);return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?`Fold line`:`Unfold line`),t}},ck=J.baseTheme({".cm-foldPlaceholder":{backgroundColor:`#eee`,border:`1px solid #ddd`,color:`#888`,borderRadius:`.2em`,margin:`0 1px`,padding:`0 1px`,cursor:`pointer`},".cm-foldGutter span":{padding:`0 1px`,cursor:`pointer`}}),lk=class e{constructor(e,t){this.specs=e;let n;function r(e){let t=pv.newName();return(n||=Object.create(null))[`.`+t]=e,t}let i=typeof t.all==`string`?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof EO?e=>e.prop(wO)==a.data:a?e=>e==a:void 0,this.style=zE(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new pv(n):null,this.themeType=t.themeType}static define(t,n){return new e(t,n||{})}},uk=W.define(),dk=W.define({combine(e){return e.length?[e[0]]:null}}),fk=class{constructor(e){this.markCache=Object.create(null),this.tree=mD(e.state),this.decorations=this.buildDeco(e,ZD(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=mD(e.state),n=ZD(e.state),r=n!=ZD(e.startState),{viewport:i}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&a>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return q.none;let n=new iv;for(let{from:r,to:i}of e.visibleRanges)VE(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=q.mark({class:r})))},r,i);return n.finish()}},pk=N_.high(US.fromClass(fk,{decorations:e=>e.decorations})),mk=lk.define([{tag:X.meta,color:`#404740`},{tag:X.link,textDecoration:`underline`},{tag:X.heading,textDecoration:`underline`,fontWeight:`bold`},{tag:X.emphasis,fontStyle:`italic`},{tag:X.strong,fontWeight:`bold`},{tag:X.strikethrough,textDecoration:`line-through`},{tag:X.keyword,color:`#708`},{tag:[X.atom,X.bool,X.url,X.contentSeparator,X.labelName],color:`#219`},{tag:[X.literal,X.inserted],color:`#164`},{tag:[X.string,X.deleted],color:`#a11`},{tag:[X.regexp,X.escape,X.special(X.string)],color:`#e40`},{tag:X.definition(X.variableName),color:`#00f`},{tag:X.local(X.variableName),color:`#30a`},{tag:[X.typeName,X.namespace],color:`#085`},{tag:X.className,color:`#167`},{tag:[X.special(X.variableName),X.macroName],color:`#256`},{tag:X.definition(X.propertyName),color:`#00c`},{tag:X.comment,color:`#940`},{tag:X.invalid,color:`#f00`}]),hk=J.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:`#328c8252`},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bb555544`}}),gk=1e4,_k=`()[]{}`,vk=W.define({combine(e){return n_(e,{afterCursor:!0,brackets:_k,maxScanDistance:gk,renderMatch:eO})}}),yk=q.mark({class:`cm-matchingBracket`}),bk=q.mark({class:`cm-nonmatchingBracket`}),xk=[US.fromClass(class{constructor(e){this.paused=!1,this.decorations=tO(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=tO(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),hk],Sk=new mE,Ck=class{constructor(e,t,n,r){this.string=e,this.tabSize=t,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),n;if(n=typeof e==`string`?t==e:t&&(e instanceof RegExp?e.test(t):e(t)),n)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=cO(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){return this.overrideIndent??cO(this.string,null,this.tabSize)}match(e,t,n){if(typeof e==`string`){let r=e=>n?e.toLowerCase():e;return r(this.string.substr(this.pos,e.length))==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}},wk=new WeakMap,Tk=class e extends EO{constructor(e){let t=fD(e.languageData),n=lO(e),r,i=new class extends NE{createParse(e,t,n){return new Ek(r,e,t,n)}};super(t,i,[],e.name),this.topNode=_O(t,this),r=this,this.streamParser=n,this.stateAfter=new mE({perNode:!0}),this.tokenTable=e.tokenTable?new Nk(n.tokenTable):Pk}static define(t){return new e(t)}getIndent(e){let t,{overrideIndentation:n}=e.options;n&&(t=wk.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let r=dO(this,e.node.tree,e.node.from,e.node.from,t??e.pos),i,a;if(r?(a=r.state,i=r.pos+1):(a=this.streamParser.startState(e.unit),i=e.node.from),e.pos-i>1e4)return null;for(;i<e.pos;){let t=e.state.doc.lineAt(i),r=Math.min(e.pos,t.to);if(t.length){let i=n?n(t.from):-1,o=new Ck(t.text,e.state.tabSize,e.unit,i<0?void 0:i);for(;o.pos<r-t.from;)mO(this.streamParser.token,o,a)}else this.streamParser.blankLine(a,e.unit);if(r==e.pos)break;i=t.to+1}let o=e.lineAt(e.pos);return n&&t==null&&wk.set(e.state,o.from),this.streamParser.indent(a,/^\s*(.*)/.exec(o.text)[1],e)}get allowsNesting(){return!1}},Ek=class{constructor(e,t,n,r){this.lang=e,this.input=t,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let i=AO.get(),a=r[0].from,{state:o,tree:s}=pO(e,n,a,this.to,i?.state);this.state=o,this.parsedPos=this.chunkStart=a+s.length;for(let e=0;e<s.children.length;e++)this.chunks.push(s.children[e]),this.chunkPos.push(s.positions[e]);i&&this.parsedPos<i.viewport.from-1e5&&r.some(e=>e.from<=i.viewport.from&&e.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(bD(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let e=AO.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(t,this.chunkStart+512);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos<n;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` +`&&(t=``);else{let e=t.indexOf(` +`);e>-1&&(t=t.slice(0,e))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),n=e+t.length;for(let e=this.rangeIndex;;){let r=this.ranges[e].to;if(r>=n||(t=t.slice(0,r-(n-t.length)),e++,e==this.ranges.length))break;let i=this.ranges[e].from,a=this.lineAfter(i);t+=a,n=i+a.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,i=e+t;if(n>0?r>i:r>=i)break;let a=this.ranges[++this.rangeIndex].from;t+=a-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,n,r){let i=4;if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let e=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,i+=this.chunk.length-e}let a=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&i==4&&a>=0&&this.chunk[a]==e&&this.chunk[a+2]==t?this.chunk[a+2]=n:this.chunk.push(e,t,n,i),r}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:i}=this.lang,a=new Ck(t,e?e.state.tabSize:4,e?bD(e.state):2);if(a.eol())i.blankLine(this.state,a.indentUnit);else for(;!a.eol();){let e=mO(i.token,a,this.state);if(e&&(r=this.emitToken(this.lang.tokenTable.resolve(e),this.parsedPos+a.start,this.parsedPos+a.pos,r)),a.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=SE.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:kk,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new SE(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new SE(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}},Dk=Object.create(null),Ok=[_E.none],kk=new vE(Ok),Ak=[],jk=Object.create(null),Mk=Object.create(null);for(let[e,t]of[[`variable`,`variableName`],[`variable-2`,`variableName.special`],[`string-2`,`string.special`],[`def`,`variableName.definition`],[`tag`,`tagName`],[`attribute`,`attributeName`],[`type`,`typeName`],[`builtin`,`variableName.standard`],[`qualifier`,`modifier`],[`error`,`invalid`],[`header`,`heading`],[`property`,`propertyName`]])Mk[e]=gO(Dk,t);Nk=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Mk)}resolve(e){return e?this.table[e]||(this.table[e]=gO(this.extra,e)):0}},Pk=new Nk(Dk),Fk=W.define({combine:e=>e.some(e=>e)}),Ik=US.fromClass(class{constructor(e){this.always=e.state.facet(Fk)||e.textDirection!=mS.LTR||e.state.facet(J.perLineTextDirection),this.hasRTL=!this.always&&yO(e.state.doc),this.tree=mD(e.state),this.decorations=this.always||this.hasRTL?SO(e,this.tree,this.always):q.none}update(e){let t=e.state.facet(Fk)||e.view.textDirection!=mS.LTR||e.state.facet(J.perLineTextDirection);if(!t&&!this.hasRTL&&bO(e.changes)&&(this.hasRTL=!0),!t&&!this.hasRTL)return;let n=mD(e.state);(t!=this.always||n!=this.tree||e.docChanged||e.viewportChanged)&&(this.tree=n,this.always=t,this.decorations=SO(e.view,n,t))}},{provide:e=>{function t(t){return t.plugin(e)?.decorations??q.none}return[J.outerDecorations.of(t),N_.lowest(J.bidiIsolatedRanges.of(t))]}}),Lk={rtl:q.mark({class:`cm-iso`,inclusive:!0,attributes:{dir:`rtl`},bidiIsolate:mS.RTL}),ltr:q.mark({class:`cm-iso`,inclusive:!0,attributes:{dir:`ltr`},bidiIsolate:mS.LTR}),auto:q.mark({class:`cm-iso`,inclusive:!0,attributes:{dir:`auto`},bidiIsolate:null})}}));eE(),Rk(),uD();var zk=sg,Bk=cg(`gray`,1),Vk=cg(`yin`,3),Hk=cg(`gray`,1),Uk=cg(`gray`,6),Wk=cg(`yellow`,1),Gk=J.theme({"&":{backgroundColor:zk,color:Vk},"&.cm-focused":{outline:`none`},"&.cm-focused .cm-matchingBracket":{backgroundColor:cg(`gray`,1)},"&.cm-focused .cm-selectionBackground, ::selection":{backgroundColor:Wk},".cm-activeLine":{backgroundColor:cg(`gray`,1)},".cm-activeLineGutter":{backgroundColor:`transparent`,color:Vk},".cm-content":{padding:0},".cm-gutters":{backgroundColor:Hk,border:`none`,borderRight:`1px solid ${Bk}`,color:Uk},".cm-lineNumbers .cm-gutterElement":{padding:`0 5px 0 15px`},".cm-lintPoint::after":{borderBottomColor:cg(`red`,5)},".cm-matchingBracket":{backgroundColor:cg(`gray`,1),color:cg(`yin`,8),outline:`none`},".cm-scroller":{fontSize:`0.8rem`,lineHeight:1.3},".cm-selectionBackground, &.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{backgroundColor:Wk}},{dark:!1}),Kk=J.theme({"&":{caretColor:`transparent`},"& .cm-cursor":{borderLeftColor:cg(`blue`,5),borderLeftStyle:`solid`,borderLeftWidth:`1ch`,marginLeft:`0`},"& .cm-cursorLayer":{mixBlendMode:`hard-light`,zIndex:`auto`},"& .cm-scroller":{isolation:`isolate`}}),qk=lk.define([{color:cg(`yin`,8),tag:[X.atom,X.attributeName,X.bool,X.character,X.className,X.comment,X.deleted,X.documentMeta,X.keyword,X.heading,X.labelName,X.link,X.macroName,X.meta,X.name,X.null,X.operator,X.operatorKeyword,X.propertyName,X.tagName,X.typeName,X.variableName]},{backgroundColor:cg(`green`,1),color:cg(`green`,9),tag:[X.string,X.special(X.string)]},{color:cg(`purple`,4),tag:[X.number]},{fontStyle:`italic`,tag:[X.comment,X.emphasis]},{fontWeight:`bold`,tag:[X.strong]},{tag:X.strikethrough,textDecoration:`line-through`}]),Jk=[$b(),Gk,QD(qk),Kk],Yk=i({addCursorAbove:()=>EM,addCursorBelow:()=>DM,blockComment:()=>QA,blockUncomment:()=>$A,copyLineDown:()=>qM,copyLineUp:()=>KM,cursorCharBackward:()=>Cj,cursorCharBackwardLogical:()=>Tj,cursorCharForward:()=>Sj,cursorCharForwardLogical:()=>wj,cursorCharLeft:()=>bj,cursorCharRight:()=>xj,cursorDocEnd:()=>bM,cursorDocStart:()=>yM,cursorGroupBackward:()=>kj,cursorGroupForward:()=>Oj,cursorGroupForwardWin:()=>Aj,cursorGroupLeft:()=>Ej,cursorGroupRight:()=>Dj,cursorLineBoundaryBackward:()=>Vj,cursorLineBoundaryForward:()=>Bj,cursorLineBoundaryLeft:()=>Hj,cursorLineBoundaryRight:()=>Uj,cursorLineDown:()=>Lj,cursorLineEnd:()=>Gj,cursorLineStart:()=>Wj,cursorLineUp:()=>Ij,cursorMatchingBracket:()=>Kj,cursorPageDown:()=>zj,cursorPageUp:()=>Rj,cursorSubwordBackward:()=>Nj,cursorSubwordForward:()=>Mj,cursorSyntaxLeft:()=>Pj,cursorSyntaxRight:()=>Fj,defaultKeymap:()=>sN,deleteCharBackward:()=>AM,deleteCharBackwardStrict:()=>jM,deleteCharForward:()=>MM,deleteGroupBackward:()=>PM,deleteGroupForward:()=>FM,deleteGroupForwardWin:()=>IM,deleteLine:()=>JM,deleteLineBoundaryBackward:()=>zM,deleteLineBoundaryForward:()=>BM,deleteToLineEnd:()=>LM,deleteToLineStart:()=>RM,deleteTrailingWhitespace:()=>VM,emacsStyleKeymap:()=>aN,history:()=>nA,historyField:()=>sj,historyKeymap:()=>yj,indentLess:()=>tN,indentMore:()=>eN,indentSelection:()=>$M,indentWithTab:()=>cN,insertBlankLine:()=>QM,insertNewline:()=>YM,insertNewlineAndIndent:()=>ZM,insertNewlineKeepIndent:()=>XM,insertTab:()=>iN,invertedEffects:()=>ij,isolateHistory:()=>rj,lineComment:()=>YA,lineUncomment:()=>XA,moveLineDown:()=>GM,moveLineUp:()=>WM,redo:()=>lj,redoDepth:()=>pj,redoSelection:()=>dj,selectAll:()=>CM,selectCharBackward:()=>Zj,selectCharBackwardLogical:()=>$j,selectCharForward:()=>Xj,selectCharForwardLogical:()=>Qj,selectCharLeft:()=>Jj,selectCharRight:()=>Yj,selectDocEnd:()=>SM,selectDocStart:()=>xM,selectGroupBackward:()=>rM,selectGroupForward:()=>nM,selectGroupForwardWin:()=>iM,selectGroupLeft:()=>eM,selectGroupRight:()=>tM,selectLine:()=>wM,selectLineBoundaryBackward:()=>mM,selectLineBoundaryForward:()=>pM,selectLineBoundaryLeft:()=>hM,selectLineBoundaryRight:()=>gM,selectLineDown:()=>uM,selectLineEnd:()=>vM,selectLineStart:()=>_M,selectLineUp:()=>lM,selectMatchingBracket:()=>qj,selectPageDown:()=>fM,selectPageUp:()=>dM,selectParentSyntax:()=>TM,selectSubwordBackward:()=>oM,selectSubwordForward:()=>aM,selectSyntaxLeft:()=>sM,selectSyntaxRight:()=>cM,simplifySelection:()=>OM,splitLine:()=>HM,standardKeymap:()=>oN,temporarilySetTabFocusMode:()=>rN,toggleBlockComment:()=>ZA,toggleBlockCommentByLine:()=>ej,toggleComment:()=>qA,toggleLineComment:()=>JA,toggleTabFocusMode:()=>nN,transposeChars:()=>UM,undo:()=>cj,undoDepth:()=>fj,undoSelection:()=>uj});function Xk(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}function Zk(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}function Qk(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-tj,r),o=e.sliceDoc(i,i+tj),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*tj?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+tj),d=e.sliceDoc(i-tj,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function $k(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function eA(e,t,n=t.selection.ranges){let r=n.map(e=>Zk(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>Qk(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function tA(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=Zk(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}function nA(e={}){return[oj,aj.of(e),J.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?cj:e.inputType==`historyRedo`?lj:null;return n?(e.preventDefault(),n(t)):!1}})]}function rA(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(oj,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}function iA(e){return function(t){let n=t.field(oj,!1);if(!n)return 0;let r=e==0?n.done:n.undone;return r.length-(r.length&&!r[0].changes?1:0)}}function aA(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function oA(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function sA(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function cA(e,t){return e.length?t.length?e.concat(t):e:t}function lA(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-gj));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),aA(e,e.length-1,1e9,n.setSelAfter(r)))}else return[mj.selection([t])]}function uA(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function dA(e,t){if(!e.length)return e;let n=e.length,r=hj;for(;n;){let i=fA(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[mj.selection(r)]:hj}function fA(e,t,n){let r=cA(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):hj,n);if(!e.changes)return mj.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new mj(i,G.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}function pA(e,t){return U.create(e.ranges.map(t),e.mainIndex)}function mA(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function hA({state:e,dispatch:t},n){let r=pA(e.selection,n);return r.eq(e.selection,!0)?!1:(t(mA(e,r)),!0)}function gA(e,t){return U.cursor(t?e.to:e.from)}function _A(e,t){return hA(e,n=>n.empty?e.moveByChar(n,t):gA(n,t))}function vA(e){return e.textDirectionAt(e.state.selection.main.head)==mS.LTR}function yA(e,t,n){let r=t.head,i=e.doc.lineAt(r);return r=r==(n?i.to:i.from)?n?Math.min(e.doc.length,i.to+1):Math.max(0,i.from-1):i.from+Dg(i.text,r-i.from,n),U.cursor(r,n?-1:1)}function bA(e,t){return hA(e,n=>n.empty?yA(e.state,n,t):gA(n,t))}function xA(e,t){return hA(e,n=>n.empty?e.moveByGroup(n,t):gA(n,t))}function SA(e,t,n){let r=e.state.charCategorizer(t),i=r(n),a=i!=X_.Space;return e=>{let t=r(e);return t==X_.Space?(a=!1,!0):a&&t==i}}function CA(e,t,n){let r=e.state.charCategorizer(t.from),i=X_.Space,a=t.from,o=0,s=!1,c=!1,l=!1,u=t=>{if(s)return!1;a+=n?t.length:-t.length;let u=r(t),d;if(u==X_.Word&&t.charCodeAt(0)<128&&/[\W_]/.test(t)&&(u=-1),i==X_.Space&&(i=u),i!=u)return!1;if(i==X_.Word)if(t.toLowerCase()==t){if(!n&&c)return!1;l=!0}else if(l){if(n)return!1;s=!0}else{if(c&&n&&r(d=e.state.sliceDoc(a,a+1))==X_.Word&&d.toLowerCase()==d)return!1;c=!0}return o++,!0},d=e.moveByChar(t,n,e=>(u(e),u));if(jj&&i==X_.Word&&d.from==t.from+o*(n?1:-1)){let r=Math.min(t.head,d.head),i=Math.max(t.head,d.head),a=e.state.sliceDoc(r,i);if(a.length>1&&/[\u4E00-\uffff]/.test(a)){let e=Array.from(jj.segment(a));if(e.length>1)return n?U.cursor(t.head+e[1].index,-1):U.cursor(d.head+e[e.length-1].index,1)}}return d}function wA(e,t){return hA(e,n=>n.empty?CA(e,n,t):gA(n,t))}function TA(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function EA(e,t,n){let r=mD(e).resolveInner(t.head),i=n?mE.closedBy:mE.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;TA(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?aO(e,r.from,1):aO(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,U.cursor(s,n?-1:1)}function DA(e,t){return hA(e,n=>{if(!n.empty)return gA(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}function OA(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(J.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function kA(e,t){let n=OA(e),{state:r}=e,i=pA(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):gA(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=J.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(mA(r,i),{effects:a}),!0}function AA(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=U.cursor(r.from+n))}return i}function jA(e,t,n){let r=!1,i=pA(e.selection,t=>{let i=aO(e,t.head,-1)||aO(e,t.head,1)||t.head>0&&aO(e,t.head-1,1)||t.head<e.doc.length&&aO(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?U.range(t.anchor,a):U.cursor(a)});return r?(t(mA(e,i)),!0):!1}function MA(e,t){let n=pA(e.state.selection,e=>{let n=t(e);return U.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return n.eq(e.state.selection)?!1:(e.dispatch(mA(e.state,n)),!0)}function NA(e,t){return MA(e,n=>e.moveByChar(n,t))}function PA(e,t){return MA(e,n=>e.moveByGroup(n,t))}function FA(e,t){return MA(e,n=>CA(e,n,t))}function IA(e,t){return MA(e,n=>e.moveVertically(n,t))}function LA(e,t){return MA(e,n=>e.moveVertically(n,t,OA(e).height))}function RA(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(mA(n,U.create(i,i.length-1))),!0)}function zA(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=BA(e,o,!1)):o>i&&(n=`delete.forward`,o=BA(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=BA(e,i,!1),a=BA(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:U.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?J.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function BA(e,t,n){if(e instanceof J)for(let r of e.state.facet(J.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}function VA(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function HA(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of VA(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(U.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(U.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:U.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}function UA(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of VA(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}function WA(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=mD(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(mE.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}function GA(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&WA(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new BO(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=SD(s,r);for(c??=p_(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,xD(t,c)];return o&&l.push(xD(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:h_.of(l)},range:U.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function KA(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:U.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var qA,JA,YA,XA,ZA,QA,$A,ej,tj,nj,rj,ij,aj,oj,sj,cj,lj,uj,dj,fj,pj,mj,hj,gj,_j,vj,yj,bj,xj,Sj,Cj,wj,Tj,Ej,Dj,Oj,kj,Aj,jj,Mj,Nj,Pj,Fj,Ij,Lj,Rj,zj,Bj,Vj,Hj,Uj,Wj,Gj,Kj,qj,Jj,Yj,Xj,Zj,Qj,$j,eM,tM,nM,rM,iM,aM,oM,sM,cM,lM,uM,dM,fM,pM,mM,hM,gM,_M,vM,yM,bM,xM,SM,CM,wM,TM,EM,DM,OM,kM,AM,jM,MM,NM,PM,FM,IM,LM,RM,zM,BM,VM,HM,UM,WM,GM,KM,qM,JM,YM,XM,ZM,QM,$M,eN,tN,nN,rN,iN,aN,oN,sN,cN,lN=n((()=>{cv(),eE(),Rk(),FE(),qA=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Zk(e.state,n.from);return r.line?JA(e):r.block?ej(e):!1},JA=Xk(tA,0),YA=Xk(tA,1),XA=Xk(tA,2),ZA=Xk(eA,0),QA=Xk(eA,1),$A=Xk(eA,2),ej=Xk((e,t)=>eA(e,t,$k(t)),0),tj=50,nj=G_.define(),rj=G_.define(),ij=W.define(),aj=W.define({combine(e){return n_(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),oj=j_.define({create(){return vj.empty},update(e,t){let n=t.state.facet(aj),r=t.annotation(nj);if(r){let i=mj.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?aA(o,o.length,n.minDepth,i):lA(o,t.startState.selection),new vj(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(rj);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(J_.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=mj.fromTransaction(t),o=t.annotation(J_.time),s=t.annotation(J_.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new vj(e.done.map(mj.fromJSON),e.undone.map(mj.fromJSON))}}),sj=oj,cj=rA(0,!1),lj=rA(1,!1),uj=rA(0,!0),dj=rA(1,!0),fj=iA(0),pj=iA(1),mj=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&T_.fromJSON(t.changes),[],t.mapped&&w_.fromJSON(t.mapped),t.startSelection&&U.fromJSON(t.startSelection),t.selectionsAfter.map(U.fromJSON))}static fromTransaction(t,n){let r=hj;for(let e of t.startState.facet(ij)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,hj)}static selection(t){return new e(void 0,hj,void 0,void 0,t)}},hj=[],gj=200,_j=/^(input\.type|delete)($|\.)/,vj=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||_j.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,oA(s.changes,t.changes))||r==`input.type.compose`)?aA(o,o.length-1,i.minDepth,new mj(t.changes.compose(s.changes),cA(G.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,hj)):aA(o,o.length,i.minDepth,t),new e(o,hj,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:hj;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&sA(a[a.length-1],t)?this:new e(lA(this.done,t),this.undone,n,r)}addMapping(t){return new e(dA(this.done,t),dA(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:nj.of({side:e,rest:uA(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?hj:r.slice(0,r.length-1);return i.mapped&&(n=dA(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:nj.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}},vj.empty=new vj(hj,hj),yj=[{key:`Mod-z`,run:cj,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:lj,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:lj,preventDefault:!0},{key:`Mod-u`,run:uj,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:dj,preventDefault:!0}],bj=e=>_A(e,!vA(e)),xj=e=>_A(e,vA(e)),Sj=e=>_A(e,!0),Cj=e=>_A(e,!1),wj=e=>bA(e,!0),Tj=e=>bA(e,!1),Ej=e=>xA(e,!vA(e)),Dj=e=>xA(e,vA(e)),Oj=e=>xA(e,!0),kj=e=>xA(e,!1),Aj=e=>hA(e,t=>t.empty?e.moveByChar(t,!0,n=>SA(e,t.head,n)):gA(t,!0)),jj=typeof Intl<`u`&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:`word`}):null,Mj=e=>wA(e,!0),Nj=e=>wA(e,!1),Pj=e=>hA(e,t=>EA(e.state,t,!vA(e))),Fj=e=>hA(e,t=>EA(e.state,t,vA(e))),Ij=e=>DA(e,!1),Lj=e=>DA(e,!0),Rj=e=>kA(e,!1),zj=e=>kA(e,!0),Bj=e=>hA(e,t=>AA(e,t,!0)),Vj=e=>hA(e,t=>AA(e,t,!1)),Hj=e=>hA(e,t=>AA(e,t,!vA(e))),Uj=e=>hA(e,t=>AA(e,t,vA(e))),Wj=e=>hA(e,t=>U.cursor(e.lineBlockAt(t.head).from,1)),Gj=e=>hA(e,t=>U.cursor(e.lineBlockAt(t.head).to,-1)),Kj=({state:e,dispatch:t})=>jA(e,t,!1),qj=({state:e,dispatch:t})=>jA(e,t,!0),Jj=e=>NA(e,!vA(e)),Yj=e=>NA(e,vA(e)),Xj=e=>NA(e,!0),Zj=e=>NA(e,!1),Qj=e=>MA(e,t=>yA(e.state,t,!0)),$j=e=>MA(e,t=>yA(e.state,t,!1)),eM=e=>PA(e,!vA(e)),tM=e=>PA(e,vA(e)),nM=e=>PA(e,!0),rM=e=>PA(e,!1),iM=e=>MA(e,t=>e.moveByChar(t,!0,n=>SA(e,t.head,n))),aM=e=>FA(e,!0),oM=e=>FA(e,!1),sM=e=>MA(e,t=>EA(e.state,t,!vA(e))),cM=e=>MA(e,t=>EA(e.state,t,vA(e))),lM=e=>IA(e,!1),uM=e=>IA(e,!0),dM=e=>LA(e,!1),fM=e=>LA(e,!0),pM=e=>MA(e,t=>AA(e,t,!0)),mM=e=>MA(e,t=>AA(e,t,!1)),hM=e=>MA(e,t=>AA(e,t,!vA(e))),gM=e=>MA(e,t=>AA(e,t,vA(e))),_M=e=>MA(e,t=>U.cursor(e.lineBlockAt(t.head).from)),vM=e=>MA(e,t=>U.cursor(e.lineBlockAt(t.head).to)),yM=({state:e,dispatch:t})=>(t(mA(e,{anchor:0})),!0),bM=({state:e,dispatch:t})=>(t(mA(e,{anchor:e.doc.length})),!0),xM=({state:e,dispatch:t})=>(t(mA(e,{anchor:e.selection.main.anchor,head:0})),!0),SM=({state:e,dispatch:t})=>(t(mA(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),CM=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),wM=({state:e,dispatch:t})=>{let n=VA(e).map(({from:t,to:n})=>U.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:U.create(n),userEvent:`select`})),!0},TM=({state:e,dispatch:t})=>{let n=pA(e.selection,t=>{let n=mD(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return U.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(mA(e,n)),!0)},EM=e=>RA(e,!1),DM=e=>RA(e,!0),OM=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=U.create([n.main]):n.main.empty||(r=U.create([U.cursor(n.main.head)])),r?(t(mA(e,r)),!0):!1},kM=(e,t,n)=>zA(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=p_(s,a.tabSize)%bD(a)||bD(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=Dg(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=Dg(o.text,c-o.from,!1,!1)+o.from);return c}),AM=e=>kM(e,!1,!0),jM=e=>kM(e,!1,!1),MM=e=>kM(e,!0,!1),NM=(e,t)=>zA(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=Dg(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),PM=e=>NM(e,!1),FM=e=>NM(e,!0),IM=e=>zA(e,t=>e.moveByChar(t,!0,n=>SA(e,t.head,n)).head),LM=e=>zA(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),RM=e=>zA(e,t=>{let n=e.lineBlockAt(t.head).from;return t.head>n?n:Math.max(0,t.head-1)}),zM=e=>zA(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),BM=e=>zA(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),VM=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=[];for(let t=0,r=``,i=e.doc.iter();;){if(i.next(),i.lineBreak||i.done){let e=r.search(/\s+$/);if(e>-1&&n.push({from:t-(r.length-e),to:t}),i.done)break;r=``}else r=i.value;t+=i.value.length}return n.length?(t(e.update({changes:n,userEvent:`delete`})),!0):!1},HM=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:h_.of([``,``])},range:U.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},UM=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:Dg(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:Dg(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:U.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)},WM=({state:e,dispatch:t})=>HA(e,t,!1),GM=({state:e,dispatch:t})=>HA(e,t,!0),KM=({state:e,dispatch:t})=>UA(e,t,!1),qM=({state:e,dispatch:t})=>UA(e,t,!0),JM=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(VA(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=pA(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0},YM=({state:e,dispatch:t})=>(t(e.update(e.replaceSelection(e.lineBreak),{scrollIntoView:!0,userEvent:`input`})),!0),XM=({state:e,dispatch:t})=>(t(e.update(e.changeByRange(t=>{let n=/^\s*/.exec(e.doc.lineAt(t.from).text)[0];return{changes:{from:t.from,to:t.to,insert:e.lineBreak+n},range:U.cursor(t.from+n.length+1)}}),{scrollIntoView:!0,userEvent:`input`})),!0),ZM=GA(!1),QM=GA(!0),$M=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new BO(e,{overrideIndentation:e=>n[e]??-1}),i=KA(e,(t,i,a)=>{let o=SD(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=xD(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},eN=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(KA(e,(t,n)=>{n.push({from:t.from,insert:e.facet(zO)})}),{userEvent:`input.indent`})),!0),tN=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(KA(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=p_(r,e.tabSize),a=0,o=xD(e,Math.max(0,i-bD(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),nN=e=>(e.setTabFocusMode(),!0),rN=e=>(e.setTabFocusMode(2e3),!0),iN=({state:e,dispatch:t})=>e.selection.ranges.some(e=>!e.empty)?eN({state:e,dispatch:t}):(t(e.update(e.replaceSelection(` `),{scrollIntoView:!0,userEvent:`input`})),!0),aN=[{key:`Ctrl-b`,run:bj,shift:Jj,preventDefault:!0},{key:`Ctrl-f`,run:xj,shift:Yj},{key:`Ctrl-p`,run:Ij,shift:lM},{key:`Ctrl-n`,run:Lj,shift:uM},{key:`Ctrl-a`,run:Wj,shift:_M},{key:`Ctrl-e`,run:Gj,shift:vM},{key:`Ctrl-d`,run:MM},{key:`Ctrl-h`,run:AM},{key:`Ctrl-k`,run:LM},{key:`Ctrl-Alt-h`,run:PM},{key:`Ctrl-o`,run:HM},{key:`Ctrl-t`,run:UM},{key:`Ctrl-v`,run:zj}],oN=[{key:`ArrowLeft`,run:bj,shift:Jj,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:Ej,shift:eM,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:Hj,shift:hM,preventDefault:!0},{key:`ArrowRight`,run:xj,shift:Yj,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:Dj,shift:tM,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:Uj,shift:gM,preventDefault:!0},{key:`ArrowUp`,run:Ij,shift:lM,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:yM,shift:xM},{mac:`Ctrl-ArrowUp`,run:Rj,shift:dM},{key:`ArrowDown`,run:Lj,shift:uM,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:bM,shift:SM},{mac:`Ctrl-ArrowDown`,run:zj,shift:fM},{key:`PageUp`,run:Rj,shift:dM},{key:`PageDown`,run:zj,shift:fM},{key:`Home`,run:Vj,shift:mM,preventDefault:!0},{key:`Mod-Home`,run:yM,shift:xM},{key:`End`,run:Bj,shift:pM,preventDefault:!0},{key:`Mod-End`,run:bM,shift:SM},{key:`Enter`,run:ZM,shift:ZM},{key:`Mod-a`,run:CM},{key:`Backspace`,run:AM,shift:AM,preventDefault:!0},{key:`Delete`,run:MM,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:PM,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:FM,preventDefault:!0},{mac:`Mod-Backspace`,run:zM,preventDefault:!0},{mac:`Mod-Delete`,run:BM,preventDefault:!0}].concat(aN.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),sN=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:Pj,shift:sM},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:Fj,shift:cM},{key:`Alt-ArrowUp`,run:WM},{key:`Shift-Alt-ArrowUp`,run:KM},{key:`Alt-ArrowDown`,run:GM},{key:`Shift-Alt-ArrowDown`,run:qM},{key:`Mod-Alt-ArrowUp`,run:EM},{key:`Mod-Alt-ArrowDown`,run:DM},{key:`Escape`,run:OM},{key:`Mod-Enter`,run:QM},{key:`Alt-l`,mac:`Ctrl-l`,run:wM},{key:`Mod-i`,run:TM,preventDefault:!0},{key:`Mod-[`,run:tN},{key:`Mod-]`,run:eN},{key:`Mod-Alt-\\`,run:$M},{key:`Shift-Mod-k`,run:JM},{key:`Shift-Mod-\\`,run:Kj},{key:`Mod-/`,run:qA},{key:`Alt-A`,run:ZA},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:nN}].concat(oN),cN={key:`Tab`,run:eN,shift:tN}})),uN=i({CompletionContext:()=>uP,acceptCompletion:()=>jP,autocompletion:()=>iP,clearSnippet:()=>XP,closeBrackets:()=>GN,closeBracketsKeymap:()=>pF,closeCompletion:()=>NP,completeAnyWord:()=>iF,completeFromList:()=>pN,completionKeymap:()=>mF,completionStatus:()=>aP,currentCompletions:()=>oP,deleteBracketPair:()=>fF,hasNextSnippetField:()=>LN,hasPrevSnippetField:()=>RN,ifIn:()=>mN,ifNotIn:()=>hN,insertBracket:()=>JN,insertCompletionText:()=>vN,moveCompletionSelection:()=>NN,nextSnippetField:()=>ZP,pickedCompletion:()=>fP,prevSnippetField:()=>QP,selectedCompletion:()=>sP,selectedCompletionIndex:()=>cP,setSelectedCompletion:()=>lP,snippet:()=>FN,snippetCompletion:()=>zN,snippetKeymap:()=>eF,startCompletion:()=>MP});function dN(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function fN(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=dN(t)+dN(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function pN(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:fN(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function mN(e,t){return n=>{for(let r=mD(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(e.indexOf(r.name)>-1)return t(n);if(r.type.isTop)break}return null}}function hN(e,t){return n=>{for(let t=mD(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}function gN(e){return e.selection.main.from}function _N(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}function vN(e,t,n,r){let{main:i}=e.selection,a=n-i.from,o=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+o)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+o,insert:c},range:U.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:`input.complete`}}function yN(e){if(!Array.isArray(e))return e;let t=pP.get(e);return t||pP.set(e,t=pN(e)),t}function bN(e,t){return e?t?e+` `+t:e:t}function xN(e,t,n,r,i,a){let o=e.textDirection==mS.RTL,s=o,c=!1,l=`top`,u,d,f=t.left-i.left,p=i.right-t.right,m=r.right-r.left,h=r.bottom-r.top;if(s&&f<Math.min(m,p)?s=!1:!s&&p<Math.min(m,f)&&(s=!0),m<=(s?f:p))u=Math.max(i.top,Math.min(n.top,i.bottom-h))-t.top,d=Math.min(400,s?f:p);else{c=!0,d=Math.min(400,(o?t.right:i.right-t.left)-30);let e=i.bottom-t.bottom;e>=h||e>t.top?u=n.bottom-t.top:(l=`bottom`,u=t.bottom-n.top)}let g=(t.bottom-t.top)/a.offsetHeight,_=(t.right-t.left)/a.offsetWidth;return{style:`${l}: ${u/g}px; max-width: ${d/_}px`,class:`cm-completionInfo-`+(c?o?`left-narrow`:`right-narrow`:s?`left`:`right`)}}function SN(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement(`div`);return t.classList.add(`cm-completionIcon`),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>`cm-completionIcon-`+e)),t.setAttribute(`aria-hidden`,`true`),t},position:20}),t.push({render(e,t,n,r){let i=document.createElement(`span`);i.className=`cm-completionLabel`;let a=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(a.slice(o,t)));let s=i.appendChild(document.createElement(`span`));s.appendChild(document.createTextNode(a.slice(t,n))),s.className=`cm-completionMatchedText`,o=n}return o<a.length&&i.appendChild(document.createTextNode(a.slice(o))),i},position:50},{render(e){if(!e.detail)return null;let t=document.createElement(`span`);return t.className=`cm-completionDetail`,t.textContent=e.detail,t},position:80}),t.sort((e,t)=>e.position-t.position).map(e=>e.render)}function CN(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}function wN(e,t){return n=>new bP(n,e,t)}function TN(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function EN(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+ +!!e.type}function DN(e,t){let n=[],r=null,i=null,a=e=>{n.push(e);let{section:t}=e.completion;if(t){r||=[];let e=typeof t==`string`?t:t.name;r.some(t=>t.name==e)||r.push(typeof t==`string`?{name:e}:t)}},o=t.facet(vP);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(r.result.filter===!1)for(let t of r.result.options)a(new dP(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),s,c=o.filterStrict?new _P(n):new gP(n);for(let t of r.result.options)if(s=c.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched,o=s.score+(t.boost||0);if(a(new dP(t,r.source,n,o)),typeof t.section==`object`&&t.section.rank===`dynamic`){let{name:e}=t.section;i||=Object.create(null),i[e]=Math.max(o,i[e]||-1e9)}}}}if(r){let e=Object.create(null),t=0,a=(e,t)=>(e.rank===`dynamic`&&t.rank===`dynamic`?i[t.name]-i[e.name]:0)||(typeof e.rank==`number`?e.rank:1e9)-(typeof t.rank==`number`?t.rank:1e9)||(e.name<t.name?-1:1);for(let n of r.sort(a))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e[typeof n==`string`?n:n.name])}}let s=[],c=null,l=o.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||l(e.completion,t.completion))){let t=e.completion;!c||c.label!=t.label||c.detail!=t.detail||c.type!=null&&t.type!=null&&c.type!=t.type||c.apply!=t.apply||c.boost!=t.boost?s.push(e):EN(e.completion)>EN(c)&&(s[s.length-1]=e),c=e.completion}return s}function ON(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}function kN(e,t){let n={"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"aria-controls":e};return t>-1&&(n[`aria-activedescendant`]=e+`-`+t),n}function AN(e,t){if(e.isUserEvent(`input.complete`)){let n=e.annotation(fP);if(n&&t.activateOnCompletion(n))return 12}let n=e.isUserEvent(`input.type`);return n&&t.activateOnTyping?5:n?1:e.isUserEvent(`delete.backward`)?2:e.selection?8:e.docChanged?16:0}function jN(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e==`function`?e(i,n,r,t):_N(e,!0).test(i)}function MN(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(kP).active.find(e=>e.source==t.source);return r instanceof DP?(typeof n==`string`?e.dispatch({...vN(e.state,n,r.from,r.to),annotations:fP.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}function NN(e,t=`option`){return n=>{let r=n.state.field(kP,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(vP).interactionDelay)return!1;let i=1,a;t==`page`&&(a=Tx(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector(`li`).offsetHeight)-1));let{length:o}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:o-1;return s<0?s=t==`page`?0:o-1:s>=o&&(s=t==`page`?o-1:0),n.dispatch({effects:yP.of(s)}),!0}}function PN(e,t){return U.create(e.filter(e=>e.field==t).map(e=>U.range(e.from,e.to)))}function FN(e){let t=UP.parse(e);return(e,n,r,i)=>{let{text:a,ranges:o}=t.instantiate(e.state,r),{main:s}=e.state.selection,c={changes:{from:r,to:i==s.from?s.to:i,insert:h_.of(a)},scrollIntoView:!0,annotations:n?[fP.of(n),J_.userEvent.of(`input.complete`)]:void 0};if(o.length&&(c.selection=PN(o,0)),o.some(e=>e.field>0)){let t=new KP(o,0),n=c.effects=[qP.of(t)];e.state.field(YP,!1)===void 0&&n.push(G.appendConfig.of([YP,tF,nF,BP]))}e.dispatch(e.state.update(c))}}function IN(e){return({state:t,dispatch:n})=>{let r=t.field(YP,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:PN(r.ranges,i),effects:qP.of(a?null:new KP(r.ranges,i)),scrollIntoView:!0})),!0}}function LN(e){let t=e.field(YP,!1);return!!(t&&t.ranges.some(e=>e.field==t.active+1))}function RN(e){let t=e.field(YP,!1);return!!(t&&t.active>0)}function zN(e,t){return{...t,apply:FN(e)}}function BN(e){let t=e.replace(/[\]\-\\]/g,`\\$&`);try{return RegExp(`[\\p{Alphabetic}\\p{Number}_${t}]+`,`ug`)}catch{return RegExp(`[\w${t}]`,`g`)}}function VN(e,t){return new RegExp(t(e.source),e.unicode?`u`:``)}function HN(e){return rF[e]||(rF[e]=new WeakMap)}function UN(e,t,n,r,i){for(let a=e.iterLines(),o=0;!a.next().done;){let{value:e}=a,s;for(t.lastIndex=0;s=t.exec(e);)if(!r[s[0]]&&o+s.index!=i&&(n.push({type:`text`,label:s[0]}),r[s[0]]=!0,n.length>=2e3))return;o+=e.length+1}}function WN(e,t,n,r,i){let a=e.length>=1e3,o=a&&t.get(e);if(o)return o;let s=[],c=Object.create(null);if(e.children){let a=0;for(let o of e.children){if(o.length>=1e3)for(let e of WN(o,t,n,r-a,i-a))c[e.label]||(c[e.label]=!0,s.push(e));else UN(o,n,s,c,i-a);a+=o.length+1}}else UN(e,n,s,c,i);return a&&s.length<2e3&&t.set(e,s),s}function GN(){return[dF,cF]}function KN(e){for(let t=0;t<16;t+=2)if(lF.charCodeAt(t)==e)return lF.charAt(t+1);return jg(e<128?e:e+1)}function qN(e,t){return e.languageDataAt(`closeBrackets`,t)[0]||aF}function JN(e,t){let n=qN(e,e.selection.main.head),r=n.brackets||aF.brackets;for(let i of r){let a=KN(Ag(i,0));if(t==i)return a==i?eP(e,i,r.indexOf(i+i+i)>-1,n):QN(e,i,a,n.before||aF.before);if(t==a&&YN(e,e.selection.main.from))return $N(e,i,a)}return null}function YN(e,t){let n=!1;return e.field(cF).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function XN(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Mg(Ag(n,0)))}function ZN(e,t){let n=e.sliceString(t-2,t);return Mg(Ag(n,0))==n.length?n:n.slice(1)}function QN(e,t,n,r){let i=null,a=e.changeByRange(a=>{if(!a.empty)return{changes:[{insert:t,from:a.from},{insert:n,from:a.to}],effects:oF.of(a.to+t.length),range:U.range(a.anchor+t.length,a.head+t.length)};let o=XN(e.doc,a.head);return!o||/\s/.test(o)||r.indexOf(o)>-1?{changes:{insert:t+n,from:a.head},effects:oF.of(a.head+t.length),range:U.cursor(a.head+t.length)}:{range:i=a}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:`input.type`})}function $N(e,t,n){let r=null,i=e.changeByRange(t=>t.empty&&XN(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:U.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(i,{scrollIntoView:!0,userEvent:`input.type`})}function eP(e,t,n,r){let i=r.stringPrefixes||aF.stringPrefixes,a=null,o=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:oF.of(r.to+t.length),range:U.range(r.anchor+t.length,r.head+t.length)};let o=r.head,s=XN(e.doc,o),c;if(s==t){if(tP(e,o))return{changes:{insert:t+t,from:o},effects:oF.of(o+t.length),range:U.cursor(o+t.length)};if(YN(e,o)){let r=n&&e.sliceDoc(o,o+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:o,to:o+r.length,insert:r},range:U.cursor(o+r.length)}}}else if(n&&e.sliceDoc(o-2*t.length,o)==t+t&&(c=rP(e,o-2*t.length,i))>-1&&tP(e,c))return{changes:{insert:t+t+t+t,from:o},effects:oF.of(o+t.length),range:U.cursor(o+t.length)};else if(e.charCategorizer(o)(s)!=X_.Word&&rP(e,o,i)>-1&&!nP(e,o,t,i))return{changes:{insert:t+t,from:o},effects:oF.of(o+t.length),range:U.cursor(o+t.length)};return{range:a=r}});return a?null:e.update(o,{scrollIntoView:!0,userEvent:`input.type`})}function tP(e,t){let n=mD(e).resolveInner(t+1);return n.parent&&n.from==t}function nP(e,t,n,r){let i=mD(e).resolveInner(t,-1),a=r.reduce((e,t)=>Math.max(e,t.length),0);for(let o=0;o<5;o++){let o=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),s=o.indexOf(n);if(!s||s>-1&&r.indexOf(o.slice(0,s))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+s;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let c=i.to==t&&i.parent;if(!c)break;i=c}return!1}function rP(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=X_.Word)return t;for(let i of n){let n=t-i.length;if(e.sliceDoc(n,t)==i&&r(e.sliceDoc(n-1,n))!=X_.Word)return n}return-1}function iP(e={}){return[zP,kP,vP.of(e),LP,hF,BP]}function aP(e){let t=e.field(kP,!1);return t&&t.active.some(e=>e.isPending)?`pending`:t&&t.active.some(e=>e.state!=0)?`active`:null}function oP(e){let t=e.field(kP,!1)?.open;if(!t||t.disabled)return[];let n=gF.get(t.options);return n||gF.set(t.options,n=t.options.map(e=>e.completion)),n}function sP(e){let t=e.field(kP,!1)?.open;return t&&!t.disabled&&t.selected>=0?t.options[t.selected].completion:null}function cP(e){let t=e.field(kP,!1)?.open;return t&&!t.disabled&&t.selected>=0?t.selected:null}function lP(e){return yP.of(e)}var uP,dP,fP,pP,mP,hP,gP,_P,vP,yP,bP,xP,SP,CP,wP,TP,EP,DP,OP,kP,AP,jP,MP,NP,PP,FP,IP,LP,RP,zP,BP,VP,HP,UP,WP,GP,KP,qP,JP,YP,XP,ZP,QP,$P,eF,tF,nF,rF,iF,aF,oF,sF,cF,lF,uF,dF,fF,pF,mF,hF,gF,_F=n((()=>{cv(),eE(),Rk(),uP=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=mD(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(_N(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}},dP=class{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}},fP=G_.define(),pP=new WeakMap,mP=G.define(),hP=G.define(),gP=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=Ag(e,t),r=Mg(n);this.chars.push(n);let i=e.slice(t,t+r),a=i.toUpperCase();this.folded.push(Ag(a==i?i.toLowerCase():a,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:i,byWord:a}=this;if(t.length==1){let r=Ag(e,0),i=Mg(r),a=i==e.length?0:-100;if(r!=t[0])if(r==n[0])a+=-200;else return null;return this.ret(a,[0,i])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let s=t.length,c=0;if(o<0){for(let i=0,a=Math.min(e.length,200);i<a&&c<s;){let a=Ag(e,i);(a==t[c]||a==n[c])&&(r[c++]=i),i+=Mg(a)}if(c<s)return null}let l=0,u=0,d=!1,f=0,p=-1,m=-1,h=/[a-z]/.test(e),g=!0;for(let r=0,c=Math.min(e.length,200),_=0;r<c&&u<s;){let c=Ag(e,r);o<0&&(l<s&&c==t[l]&&(i[l++]=r),f<s&&(c==t[f]||c==n[f]?(f==0&&(p=r),m=r+1,f++):f=0));let v,y=c<255?c>=48&&c<=57||c>=97&&c<=122?2:+(c>=65&&c<=90):(v=jg(c))==v.toLowerCase()?v==v.toUpperCase()?0:2:1;(!r||y==1&&h||_==0&&y!=0)&&(t[u]==c||n[u]==c&&(d=!0)?a[u++]=r:a.length&&(g=!1)),_=y,r+=Mg(c)}return u==s&&a[0]==0&&g?this.result(-100+(d?-200:0),a,e):f==s&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):f==s?this.ret(-900-e.length,[p,m]):u==s?this.result(-100+(d?-200:0)+-700+(g?0:-1100),a,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],i=0;for(let e of t){let t=e+(this.astral?Mg(Ag(n,e)):1);i&&r[i-1]==e?r[i-1]=t:(r[i++]=e,r[i++]=t)}return this.ret(e-n.length,r)}},_P=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},vP=W.define({combine(e){return n_(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>``,optionClass:()=>``,aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:xN,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>bN(e(n),t(n)),optionClass:(e,t)=>n=>bN(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}}),yP=G.define(),bP=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass=``;let r=e.state.field(t),{options:i,selected:a}=r.open,o=e.state.facet(vP);this.optionContent=SN(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=CN(i.length,a,o.maxRenderedOptions),this.dom=document.createElement(`div`),this.dom.className=`cm-tooltip-autocomplete`,this.updateTooltipClass(e.state),this.dom.addEventListener(`mousedown`,n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if(t.nodeName==`LI`&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}if(n.target==this.list){let t=this.list.classList.contains(`cm-completionListIncompleteTop`)&&n.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains(`cm-completionListIncompleteBottom`)&&n.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;t!=null&&(e.dispatch({effects:yP.of(t)}),n.preventDefault())}}),this.dom.addEventListener(`focusout`,t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(vP).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:hP.of(null)})}),this.showOptions(i,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener(`scroll`,()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:r,selected:i,disabled:a}=t.open;(!n.open||n.open.options!=r)&&(this.range=CN(r.length,i,e.state.facet(vP).maxRenderedOptions),this.showOptions(r,t.id)),this.updateSel(),a!=n.open?.disabled&&this.dom.classList.toggle(`cm-tooltip-autocomplete-disabled`,!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(` `))e&&this.dom.classList.remove(e);for(let e of t.split(` `))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=CN(t.options.length,t.selected,this.view.state.facet(vP).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let a=typeof i==`string`?document.createTextNode(i):i(r);if(!a)return;`then`in a?a.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,r)}).catch(e=>gy(this.view.state,e,`completion info`)):(this.addInfoPane(a,r),n.setAttribute(`aria-describedby`,this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement(`div`);if(n.className=`cm-tooltip cm-completionInfo`,n.id=`cm-completionInfo-`+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!=`LI`||!n.id?r--:r==e?n.hasAttribute(`aria-selected`)||(n.setAttribute(`aria-selected`,`true`),t=n):n.hasAttribute(`aria-selected`)&&(n.removeAttribute(`aria-selected`),n.removeAttribute(`aria-describedby`));return t&&TN(this.list,t),t}measureInfo(){let e=this.dom.querySelector(`[aria-selected]`);if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.documentElement;i={left:0,top:0,right:e.clientWidth,bottom:e.clientHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(vP).positionInfo(this.view,t,r,n,i,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className=`cm-tooltip cm-completionInfo `+(e.class||``)):this.info.style.cssText=`top: -1e6px`)}createListBox(e,t,n){let r=document.createElement(`ul`);r.id=t,r.setAttribute(`role`,`listbox`),r.setAttribute(`aria-expanded`,`true`),r.setAttribute(`aria-label`,this.view.state.phrase(`Completions`)),r.addEventListener(`mousedown`,e=>{e.target==r&&e.preventDefault()});let i=null;for(let a=n.from;a<n.to;a++){let{completion:o,match:s}=e[a],{section:c}=o;if(c){let e=typeof c==`string`?c:c.name;if(e!=i&&(a>n.from||n.from==0))if(i=e,typeof c!=`string`&&c.header)r.appendChild(c.header(c));else{let t=r.appendChild(document.createElement(`completion-section`));t.textContent=e}}let l=r.appendChild(document.createElement(`li`));l.id=t+`-`+a,l.setAttribute(`role`,`option`);let u=this.optionClass(o);u&&(l.className=u);for(let e of this.optionContent){let t=e(o,this.view.state,this.view,s);t&&l.appendChild(t)}}return n.from&&r.classList.add(`cm-completionListIncompleteTop`),n.to<e.length&&r.classList.add(`cm-completionListIncompleteBottom`),r}destroyInfo(){this.info&&=(this.infoDestroy&&this.infoDestroy(),this.info.remove(),null)}destroy(){this.destroyInfo()}},xP=class e{constructor(e,t,n,r,i,a){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=a}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new e(this.options,kN(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,o){if(i&&!o&&t.some(e=>e.isPending))return i.setDisabled();let s=DN(t,n);if(!s.length)return i&&t.some(e=>e.isPending)?i.setDisabled():null;let c=n.facet(vP).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){c=t;break}}return new e(s,kN(r,c),{pos:t.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:AP,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new e(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new e(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},SP=class e{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new e(TP,`cm-ac-`+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(vP),i=(r.override||n.languageDataAt(`autocomplete`,gN(n)).map(yN)).map(e=>(this.active.find(t=>t.source==e)||new EP(e,+!!this.active.some(e=>e.state!=0))).update(t,r));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let a=this.open,o=t.effects.some(e=>e.is(OP));a&&t.docChanged&&(a=a.map(t.changes)),t.selection||i.some(e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to))||!ON(i,this.active)||o?a=xP.build(i,n,this.id,a,r,o):a&&a.disabled&&!i.some(e=>e.isPending)&&(a=null),!a&&i.every(e=>!e.isPending)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new EP(e.source,0):e));for(let e of t.effects)e.is(yP)&&(a&&=a.setSelected(e.value,this.id));return i==this.active&&a==this.open?this:new e(i,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?CP:wP}},CP={"aria-autocomplete":`list`},wP={},TP=[],EP=class e{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=AN(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new e(i.source,0)),r&4&&i.state==0&&(i=new e(this.source,1)),i=i.updateFor(t,r);for(let n of t.effects)if(n.is(mP))i=new e(i.source,1,n.value);else if(n.is(hP))i=new e(i.source,0);else if(n.is(OP))for(let e of n.value)e.source==i.source&&(i=e);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(gN(e.state))}},DP=class e extends EP{constructor(e,t,n,r,i,a){super(e,3,t),this.limit=n,this.result=r,this.from=i,this.to=a}hasResult(){return!0}updateFor(t,n){if(!(n&3))return this.map(t.changes);let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let i=t.changes.mapPos(this.from),a=t.changes.mapPos(this.to,1),o=gN(t.state);if(o>a||!r||n&2&&(gN(t.startState)==this.from||o<this.limit))return new EP(this.source,n&4?1:0);let s=t.changes.mapPos(this.limit);return jN(r.validFor,t.state,i,a)?new e(this.source,this.explicit,s,r,i,a):r.update&&(r=r.update(r,i,a,new uP(t.state,o,!1)))?new e(this.source,this.explicit,s,r,r.from,r.to??gN(t.state)):new EP(this.source,1,this.explicit)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new e(this.source,this.explicit,t.mapPos(this.limit),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new EP(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}},OP=G.define({map(e,t){return e.map(e=>e.map(t))}}),kP=j_.define({create(){return SP.start()},update(e,t){return e.update(t)},provide:e=>[_T.from(e,e=>e.tooltip),J.contentAttributes.from(e,e=>e.attrs)]}),AP=wN(kP,MN),jP=e=>{let t=e.state.field(kP,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(vP).interactionDelay?!1:MN(e,t.open.options[t.open.selected])},MP=e=>e.state.field(kP,!1)?(e.dispatch({effects:mP.of(!0)}),!0):!1,NP=e=>{let t=e.state.field(kP,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(e.dispatch({effects:hP.of(null)}),!0)},PP=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},FP=50,IP=1e3,LP=US.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(kP).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(kP),n=e.state.facet(vP);if(!e.selectionSet&&!e.docChanged&&e.startState.field(kP)==t)return;let r=e.transactions.some(e=>{let t=AN(e,n);return t&8||(e.selection||e.docChanged)&&!(t&3)});for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.context.abortOnDocChange&&e.docChanged||n.updates.length+e.transactions.length>FP&&Date.now()-n.time>IP){for(let e of n.context.abortListeners)try{e()}catch(e){gy(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(mP)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>e.isPending&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let t of e.transactions)t.isUserEvent(`input.type`)?this.composing=2:this.composing==2&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(kP);for(let e of t.active)e.isPending&&!this.running.some(t=>t.active.source==e.source)&&this.startQuery(e);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(vP).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=new uP(t,gN(t),e.explicit,this.view),r=new PP(e,n);this.running.push(r),Promise.resolve(e.source(n)).then(e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:hP.of(null)}),gy(this.view.state,e)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(vP).updateSyncTime))}accept(){this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(vP),n=this.view.state.field(kP);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let n=gN(i.updates.length?i.updates[0].startState:this.view.state),r=Math.min(n,i.done.from+ +!i.active.explicit),a=new DP(i.active.source,i.active.explicit,r,i.done,i.done.from,i.done.to??n);for(let e of i.updates)a=a.update(e,t);if(a.hasResult()){e.push(a);continue}}let a=n.active.find(e=>e.source==i.active.source);if(a&&a.isPending)if(i.done==null){let n=new EP(i.active.source,0);for(let e of i.updates)n=n.update(e,t);n.isPending||e.push(n)}else this.startQuery(a)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:OP.of(e)})}},{eventHandlers:{blur(e){let t=this.view.state.field(kP,!1);if(t&&t.tooltip&&this.view.state.facet(vP).closeOnBlur){let n=t.open&&Tx(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:hP.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:mP.of(!1)}),20),this.composing=0}}}),RP=typeof navigator==`object`&&/Win/.test(navigator.platform),zP=N_.highest(J.domEventHandlers({keydown(e,t){let n=t.state.field(kP,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(RP&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&MN(t,r),!1}})),BP=J.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),VP=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},HP=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,C_.TrackDel),r=t.mapPos(this.to,1,C_.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},UP=class e{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],i=e.doc.lineAt(t),a=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=a,o=/^\t*/.exec(i)[0].length;for(let t=0;t<o;t++)n+=e.facet(zO);r.push(t+n.length-o),i=n+i.slice(o)}n.push(i),t+=i.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new HP(e.field,r[e.line]+e.from,r[e.line]+e.to))}}static parse(t){let n=[],r=[],i=[],a;for(let e of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);){let t=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1,c=o.replace(/\\[{}]/g,e=>e[1]);for(let e=0;e<n.length;e++)(t==null?c&&n[e].name==c:n[e].seq==t)&&(s=e);if(s<0){let e=0;for(;e<n.length&&(t==null||n[e].seq!=null&&n[e].seq<t);)e++;n.splice(e,0,{seq:t,name:c}),s=e;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new VP(s,r.length,a.index,a.index+c.length)),e=e.slice(0,a.index)+o+e.slice(a.index+a[0].length)}e=e.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(e)}return new e(r,i)}},WP=q.widget({widget:new class extends iS{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),GP=q.mark({class:`cm-snippetField`}),KP=class e{constructor(e,t){this.ranges=e,this.active=t,this.deco=q.set(e.map(e=>(e.from==e.to?WP:GP).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}},qP=G.define({map(e,t){return e&&e.map(t)}}),JP=G.define(),YP=j_.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(qP))return n.value;if(n.is(JP)&&e)return new KP(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>J.decorations.from(e,e=>e?e.deco:q.none)}),XP=({state:e,dispatch:t})=>e.field(YP,!1)?(t(e.update({effects:qP.of(null)})),!0):!1,ZP=IN(1),QP=IN(-1),$P=[{key:`Tab`,run:ZP,shift:QP},{key:`Escape`,run:XP}],eF=W.define({combine(e){return e.length?e[0]:$P}}),tF=N_.highest(Mw.compute([eF],e=>e.facet(eF))),nF=J.domEventHandlers({mousedown(e,t){let n=t.state.field(YP,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:PN(n.ranges,i.field),effects:qP.of(n.ranges.some(e=>e.field>i.field)?new KP(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),rF=Object.create(null),iF=e=>{let t=e.state.languageDataAt(`wordChars`,e.pos)[0]??``,n=BN(t),r=e.matchBefore(VN(n,e=>e+`$`));if(!r&&!e.explicit)return null;let i=r?r.from:e.pos;return{from:i,options:WN(e.state.doc,HN(t),n,5e4,i),validFor:VN(n,e=>`^`+e)}},aF={brackets:[`(`,`[`,`{`,`'`,`"`],before:`)]}:;>`,stringPrefixes:[]},oF=G.define({map(e,t){return t.mapPos(e,-1,C_.TrackAfter)??void 0}}),sF=new class extends ev{},sF.startSide=1,sF.endSide=-1,cF=j_.define({create(){return rv.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(oF)&&(e=e.update({add:[sF.range(n.value,n.value+1)]}));return e}}),lF=`()[]{}<>«»»«[]{}`,uF=typeof navigator==`object`&&/Android\b/.test(navigator.userAgent),dF=J.inputHandler.of((e,t,n,r)=>{if((uF?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&Mg(Ag(r,0))==1||t!=i.from||n!=i.to)return!1;let a=JN(e.state,r);return a?(e.dispatch(a),!0):!1}),fF=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=qN(e,e.selection.main.head).brackets||aF.brackets,r=null,i=e.changeByRange(t=>{if(t.empty){let r=ZN(e.doc,t.head);for(let i of n)if(i==r&&XN(e.doc,t.head)==KN(Ag(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:U.cursor(t.head-i.length)}}return{range:r=t}});return r||t(e.update(i,{scrollIntoView:!0,userEvent:`delete.backward`})),!r},pF=[{key:`Backspace`,run:fF}],mF=[{key:`Ctrl-Space`,run:MP},{mac:"Alt-`",run:MP},{mac:`Alt-i`,run:MP},{key:`Escape`,run:NP},{key:`ArrowDown`,run:NN(!0)},{key:`ArrowUp`,run:NN(!1)},{key:`PageDown`,run:NN(!0,`page`)},{key:`PageUp`,run:NN(!1,`page`)},{key:`Enter`,run:jP}],hF=N_.highest(Mw.computeN([vP],e=>e.facet(vP).defaultKeymap?[mF]:[])),gF=new WeakMap}));function vF(e){let t=Object.keys(e),n=t.length,r=Array(n);for(let i=0;i<n;++i)r[i]=e[t[i]];return r}function yF(e,t){return bF(t,SF(e.string))}function bF(e,t){return!t||t.trim()===``||t.trim()===`:`||t.trim()===`{`?xF(e,e=>!e.isDeprecated):xF(xF(e.map(e=>({proximity:CF(SF(e.label),t),entry:e})),e=>e.proximity<=2),e=>!e.entry.isDeprecated).sort((e,t)=>!!e.entry.isDeprecated-+!!t.entry.isDeprecated||e.proximity-t.proximity||e.entry.label.length-t.entry.label.length).map(e=>e.entry)}function xF(e,t){let n=e.filter(t);return n.length===0?e:n}function SF(e){return e.toLowerCase().replaceAll(/\W/g,``)}function CF(e,t){let n=wF(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=e.indexOf(t)===0?0:.5),n}function wF(e,t){let n,r,i=[],a=e.length,o=t.length;for(n=0;n<=a;n++)i[n]=[n];for(r=1;r<=o;r++)i[0][r]=r;for(n=1;n<=a;n++)for(r=1;r<=o;r++){let a=e[n-1]===t[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+a),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+a))}return i[a][o]}var TF,EF,DF,OF,kF=n((()=>{kh(),TF=e=>` {\n $${e??1}\n}`,EF=(e,t,n)=>{if(!t)return n??e;let r=Xs(t);return B(r)||Os(r)||As(r)||Vs(r)?e+TF():n??e},DF=(e,t,n)=>As(t)?e+`[${EF(``,Xs(t.ofType),`$1`)}]`:EF(e,t,n),OF=e=>{let t=e.args.filter(e=>e.type.toString().endsWith(`!`));if(t.length)return e.name+`(${t.map((e,t)=>`${e.name}: $${t+1}`)}) ${EF(``,e.type,` +`)}`}})),AF,jF,MF,NF,PF,FF,IF,LF,RF,zF,BF,VF,HF,UF,WF,GF,KF,qF,JF,YF,XF,ZF,QF,$F,eI,tI,nI,rI,iI,aI,oI,sI,cI,lI,uI,dI,fI,pI,mI,hI,gI,_I,vI,yI,bI,xI,SI,CI,wI,TI,EI,DI,OI,kI,AI,jI,MI,NI,PI,FI,II,LI,RI,zI,BI,VI,HI,UI,WI,GI,KI,qI,JI,YI,XI,ZI,QI,$I,eL,tL,Z,nL=n((()=>{(function(e){function t(e){return typeof e==`string`}e.is=t})(AF||={}),(function(e){function t(e){return typeof e==`string`}e.is=t})(jF||={}),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.is=t})(MF||={}),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.is=t})(NF||={}),(function(e){function t(e,t){return e===Number.MAX_VALUE&&(e=NF.MAX_VALUE),t===Number.MAX_VALUE&&(t=NF.MAX_VALUE),{line:e,character:t}}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&Z.uinteger(t.line)&&Z.uinteger(t.character)}e.is=n})(PF||={}),(function(e){function t(e,t,n,r){if(Z.uinteger(e)&&Z.uinteger(t)&&Z.uinteger(n)&&Z.uinteger(r))return{start:PF.create(e,t),end:PF.create(n,r)};if(PF.is(e)&&PF.is(t))return{start:e,end:t};throw Error(`Range#create called with invalid arguments[${e}, ${t}, ${n}, ${r}]`)}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&PF.is(t.start)&&PF.is(t.end)}e.is=n})(FF||={}),(function(e){function t(e,t){return{uri:e,range:t}}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&FF.is(t.range)&&(Z.string(t.uri)||Z.undefined(t.uri))}e.is=n})(IF||={}),(function(e){function t(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&FF.is(t.targetRange)&&Z.string(t.targetUri)&&FF.is(t.targetSelectionRange)&&(FF.is(t.originSelectionRange)||Z.undefined(t.originSelectionRange))}e.is=n})(LF||={}),(function(e){function t(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&Z.numberRange(t.red,0,1)&&Z.numberRange(t.green,0,1)&&Z.numberRange(t.blue,0,1)&&Z.numberRange(t.alpha,0,1)}e.is=n})(RF||={}),(function(e){function t(e,t){return{range:e,color:t}}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&FF.is(t.range)&&RF.is(t.color)}e.is=n})(zF||={}),(function(e){function t(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&Z.string(t.label)&&(Z.undefined(t.textEdit)||YF.is(t))&&(Z.undefined(t.additionalTextEdits)||Z.typedArray(t.additionalTextEdits,YF.is))}e.is=n})(BF||={}),(function(e){e.Comment=`comment`,e.Imports=`imports`,e.Region=`region`})(VF||={}),(function(e){function t(e,t,n,r,i,a){let o={startLine:e,endLine:t};return Z.defined(n)&&(o.startCharacter=n),Z.defined(r)&&(o.endCharacter=r),Z.defined(i)&&(o.kind=i),Z.defined(a)&&(o.collapsedText=a),o}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&Z.uinteger(t.startLine)&&Z.uinteger(t.startLine)&&(Z.undefined(t.startCharacter)||Z.uinteger(t.startCharacter))&&(Z.undefined(t.endCharacter)||Z.uinteger(t.endCharacter))&&(Z.undefined(t.kind)||Z.string(t.kind))}e.is=n})(HF||={}),(function(e){function t(e,t){return{location:e,message:t}}e.create=t;function n(e){let t=e;return Z.defined(t)&&IF.is(t.location)&&Z.string(t.message)}e.is=n})(UF||={}),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(WF||={}),(function(e){e.Unnecessary=1,e.Deprecated=2})(GF||={}),(function(e){function t(e){let t=e;return Z.objectLiteral(t)&&Z.string(t.href)}e.is=t})(KF||={}),(function(e){function t(e,t,n,r,i,a){let o={range:e,message:t};return Z.defined(n)&&(o.severity=n),Z.defined(r)&&(o.code=r),Z.defined(i)&&(o.source=i),Z.defined(a)&&(o.relatedInformation=a),o}e.create=t;function n(e){let t=e;return Z.defined(t)&&FF.is(t.range)&&Z.string(t.message)&&(Z.number(t.severity)||Z.undefined(t.severity))&&(Z.integer(t.code)||Z.string(t.code)||Z.undefined(t.code))&&(Z.undefined(t.codeDescription)||Z.string(t.codeDescription?.href))&&(Z.string(t.source)||Z.undefined(t.source))&&(Z.undefined(t.relatedInformation)||Z.typedArray(t.relatedInformation,UF.is))}e.is=n})(qF||={}),(function(e){function t(e,t,...n){let r={title:e,command:t};return Z.defined(n)&&n.length>0&&(r.arguments=n),r}e.create=t;function n(e){let t=e;return Z.defined(t)&&Z.string(t.title)&&Z.string(t.command)}e.is=n})(JF||={}),(function(e){function t(e,t){return{range:e,newText:t}}e.replace=t;function n(e,t){return{range:{start:e,end:e},newText:t}}e.insert=n;function r(e){return{range:e,newText:``}}e.del=r;function i(e){let t=e;return Z.objectLiteral(t)&&Z.string(t.newText)&&FF.is(t.range)}e.is=i})(YF||={}),(function(e){function t(e,t,n){let r={label:e};return t!==void 0&&(r.needsConfirmation=t),n!==void 0&&(r.description=n),r}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&Z.string(t.label)&&(Z.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(Z.string(t.description)||t.description===void 0)}e.is=n})(XF||={}),(function(e){function t(e){let t=e;return Z.string(t)}e.is=t})(ZF||={}),(function(e){function t(e,t,n){return{range:e,newText:t,annotationId:n}}e.replace=t;function n(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}}e.insert=n;function r(e,t){return{range:e,newText:``,annotationId:t}}e.del=r;function i(e){let t=e;return YF.is(t)&&(XF.is(t.annotationId)||ZF.is(t.annotationId))}e.is=i})(QF||={}),(function(e){function t(e,t){return{textDocument:e,edits:t}}e.create=t;function n(e){let t=e;return Z.defined(t)&&oI.is(t.textDocument)&&Array.isArray(t.edits)}e.is=n})($F||={}),(function(e){function t(e,t,n){let r={kind:`create`,uri:e};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r}e.create=t;function n(e){let t=e;return t&&t.kind===`create`&&Z.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||Z.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||Z.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||ZF.is(t.annotationId))}e.is=n})(eI||={}),(function(e){function t(e,t,n,r){let i={kind:`rename`,oldUri:e,newUri:t};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(i.options=n),r!==void 0&&(i.annotationId=r),i}e.create=t;function n(e){let t=e;return t&&t.kind===`rename`&&Z.string(t.oldUri)&&Z.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||Z.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||Z.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||ZF.is(t.annotationId))}e.is=n})(tI||={}),(function(e){function t(e,t,n){let r={kind:`delete`,uri:e};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r}e.create=t;function n(e){let t=e;return t&&t.kind===`delete`&&Z.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||Z.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||Z.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||ZF.is(t.annotationId))}e.is=n})(nI||={}),(function(e){function t(e){let t=e;return t&&(t.changes!==void 0||t.documentChanges!==void 0)&&(t.documentChanges===void 0||t.documentChanges.every(e=>Z.string(e.kind)?eI.is(e)||tI.is(e)||nI.is(e):$F.is(e)))}e.is=t})(rI||={}),(function(e){function t(e){return{uri:e}}e.create=t;function n(e){let t=e;return Z.defined(t)&&Z.string(t.uri)}e.is=n})(iI||={}),(function(e){function t(e,t){return{uri:e,version:t}}e.create=t;function n(e){let t=e;return Z.defined(t)&&Z.string(t.uri)&&Z.integer(t.version)}e.is=n})(aI||={}),(function(e){function t(e,t){return{uri:e,version:t}}e.create=t;function n(e){let t=e;return Z.defined(t)&&Z.string(t.uri)&&(t.version===null||Z.integer(t.version))}e.is=n})(oI||={}),(function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}e.create=t;function n(e){let t=e;return Z.defined(t)&&Z.string(t.uri)&&Z.string(t.languageId)&&Z.integer(t.version)&&Z.string(t.text)}e.is=n})(sI||={}),(function(e){e.PlainText=`plaintext`,e.Markdown=`markdown`;function t(t){let n=t;return n===e.PlainText||n===e.Markdown}e.is=t})(cI||={}),(function(e){function t(e){let t=e;return Z.objectLiteral(e)&&cI.is(t.kind)&&Z.string(t.value)}e.is=t})(lI||={}),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(uI||={}),(function(e){e.PlainText=1,e.Snippet=2})(dI||={}),(function(e){e.Deprecated=1})(fI||={}),(function(e){function t(e,t,n){return{newText:e,insert:t,replace:n}}e.create=t;function n(e){let t=e;return t&&Z.string(t.newText)&&FF.is(t.insert)&&FF.is(t.replace)}e.is=n})(pI||={}),(function(e){e.asIs=1,e.adjustIndentation=2})(mI||={}),(function(e){function t(e){let t=e;return t&&(Z.string(t.detail)||t.detail===void 0)&&(Z.string(t.description)||t.description===void 0)}e.is=t})(hI||={}),(function(e){function t(e){return{label:e}}e.create=t})(gI||={}),(function(e){function t(e,t){return{items:e||[],isIncomplete:!!t}}e.create=t})(_I||={}),(function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,`\\$&`)}e.fromPlainText=t;function n(e){let t=e;return Z.string(t)||Z.objectLiteral(t)&&Z.string(t.language)&&Z.string(t.value)}e.is=n})(vI||={}),(function(e){function t(e){let t=e;return!!t&&Z.objectLiteral(t)&&(lI.is(t.contents)||vI.is(t.contents)||Z.typedArray(t.contents,vI.is))&&(e.range===void 0||FF.is(e.range))}e.is=t})(yI||={}),(function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}e.create=t})(bI||={}),(function(e){function t(e,t,...n){let r={label:e};return Z.defined(t)&&(r.documentation=t),Z.defined(n)?r.parameters=n:r.parameters=[],r}e.create=t})(xI||={}),(function(e){e.Text=1,e.Read=2,e.Write=3})(SI||={}),(function(e){function t(e,t){let n={range:e};return Z.number(t)&&(n.kind=t),n}e.create=t})(CI||={}),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(wI||={}),(function(e){e.Deprecated=1})(TI||={}),(function(e){function t(e,t,n,r,i){let a={name:e,kind:t,location:{uri:r,range:n}};return i&&(a.containerName=i),a}e.create=t})(EI||={}),(function(e){function t(e,t,n,r){return r===void 0?{name:e,kind:t,location:{uri:n}}:{name:e,kind:t,location:{uri:n,range:r}}}e.create=t})(DI||={}),(function(e){function t(e,t,n,r,i,a){let o={name:e,detail:t,kind:n,range:r,selectionRange:i};return a!==void 0&&(o.children=a),o}e.create=t;function n(e){let t=e;return t&&Z.string(t.name)&&Z.number(t.kind)&&FF.is(t.range)&&FF.is(t.selectionRange)&&(t.detail===void 0||Z.string(t.detail))&&(t.deprecated===void 0||Z.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}e.is=n})(OI||={}),(function(e){e.Empty=``,e.QuickFix=`quickfix`,e.Refactor=`refactor`,e.RefactorExtract=`refactor.extract`,e.RefactorInline=`refactor.inline`,e.RefactorRewrite=`refactor.rewrite`,e.Source=`source`,e.SourceOrganizeImports=`source.organizeImports`,e.SourceFixAll=`source.fixAll`})(kI||={}),(function(e){e.Invoked=1,e.Automatic=2})(AI||={}),(function(e){function t(e,t,n){let r={diagnostics:e};return t!=null&&(r.only=t),n!=null&&(r.triggerKind=n),r}e.create=t;function n(e){let t=e;return Z.defined(t)&&Z.typedArray(t.diagnostics,qF.is)&&(t.only===void 0||Z.typedArray(t.only,Z.string))&&(t.triggerKind===void 0||t.triggerKind===AI.Invoked||t.triggerKind===AI.Automatic)}e.is=n})(jI||={}),(function(e){function t(e,t,n){let r={title:e},i=!0;return typeof t==`string`?(i=!1,r.kind=t):JF.is(t)?r.command=t:r.edit=t,i&&n!==void 0&&(r.kind=n),r}e.create=t;function n(e){let t=e;return t&&Z.string(t.title)&&(t.diagnostics===void 0||Z.typedArray(t.diagnostics,qF.is))&&(t.kind===void 0||Z.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||JF.is(t.command))&&(t.isPreferred===void 0||Z.boolean(t.isPreferred))&&(t.edit===void 0||rI.is(t.edit))}e.is=n})(MI||={}),(function(e){function t(e,t){let n={range:e};return Z.defined(t)&&(n.data=t),n}e.create=t;function n(e){let t=e;return Z.defined(t)&&FF.is(t.range)&&(Z.undefined(t.command)||JF.is(t.command))}e.is=n})(NI||={}),(function(e){function t(e,t){return{tabSize:e,insertSpaces:t}}e.create=t;function n(e){let t=e;return Z.defined(t)&&Z.uinteger(t.tabSize)&&Z.boolean(t.insertSpaces)}e.is=n})(PI||={}),(function(e){function t(e,t,n){return{range:e,target:t,data:n}}e.create=t;function n(e){let t=e;return Z.defined(t)&&FF.is(t.range)&&(Z.undefined(t.target)||Z.string(t.target))}e.is=n})(FI||={}),(function(e){function t(e,t){return{range:e,parent:t}}e.create=t;function n(t){let n=t;return Z.objectLiteral(n)&&FF.is(n.range)&&(n.parent===void 0||e.is(n.parent))}e.is=n})(II||={}),(function(e){e.namespace=`namespace`,e.type=`type`,e.class=`class`,e.enum=`enum`,e.interface=`interface`,e.struct=`struct`,e.typeParameter=`typeParameter`,e.parameter=`parameter`,e.variable=`variable`,e.property=`property`,e.enumMember=`enumMember`,e.event=`event`,e.function=`function`,e.method=`method`,e.macro=`macro`,e.keyword=`keyword`,e.modifier=`modifier`,e.comment=`comment`,e.string=`string`,e.number=`number`,e.regexp=`regexp`,e.operator=`operator`,e.decorator=`decorator`})(LI||={}),(function(e){e.declaration=`declaration`,e.definition=`definition`,e.readonly=`readonly`,e.static=`static`,e.deprecated=`deprecated`,e.abstract=`abstract`,e.async=`async`,e.modification=`modification`,e.documentation=`documentation`,e.defaultLibrary=`defaultLibrary`})(RI||={}),(function(e){function t(e){let t=e;return Z.objectLiteral(t)&&(t.resultId===void 0||typeof t.resultId==`string`)&&Array.isArray(t.data)&&(t.data.length===0||typeof t.data[0]==`number`)}e.is=t})(zI||={}),(function(e){function t(e,t){return{range:e,text:t}}e.create=t;function n(e){let t=e;return t!=null&&FF.is(t.range)&&Z.string(t.text)}e.is=n})(BI||={}),(function(e){function t(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}}e.create=t;function n(e){let t=e;return t!=null&&FF.is(t.range)&&Z.boolean(t.caseSensitiveLookup)&&(Z.string(t.variableName)||t.variableName===void 0)}e.is=n})(VI||={}),(function(e){function t(e,t){return{range:e,expression:t}}e.create=t;function n(e){let t=e;return t!=null&&FF.is(t.range)&&(Z.string(t.expression)||t.expression===void 0)}e.is=n})(HI||={}),(function(e){function t(e,t){return{frameId:e,stoppedLocation:t}}e.create=t;function n(e){let t=e;return Z.defined(t)&&FF.is(e.stoppedLocation)}e.is=n})(UI||={}),(function(e){e.Type=1,e.Parameter=2;function t(e){return e===1||e===2}e.is=t})(WI||={}),(function(e){function t(e){return{value:e}}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&(t.tooltip===void 0||Z.string(t.tooltip)||lI.is(t.tooltip))&&(t.location===void 0||IF.is(t.location))&&(t.command===void 0||JF.is(t.command))}e.is=n})(GI||={}),(function(e){function t(e,t,n){let r={position:e,label:t};return n!==void 0&&(r.kind=n),r}e.create=t;function n(e){let t=e;return Z.objectLiteral(t)&&PF.is(t.position)&&(Z.string(t.label)||Z.typedArray(t.label,GI.is))&&(t.kind===void 0||WI.is(t.kind))&&t.textEdits===void 0||Z.typedArray(t.textEdits,YF.is)&&(t.tooltip===void 0||Z.string(t.tooltip)||lI.is(t.tooltip))&&(t.paddingLeft===void 0||Z.boolean(t.paddingLeft))&&(t.paddingRight===void 0||Z.boolean(t.paddingRight))}e.is=n})(KI||={}),(function(e){function t(e){return{kind:`snippet`,value:e}}e.createSnippet=t})(qI||={}),(function(e){function t(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}e.create=t})(JI||={}),(function(e){function t(e){return{items:e}}e.create=t})(YI||={}),(function(e){e.Invoked=0,e.Automatic=1})(XI||={}),(function(e){function t(e,t){return{range:e,text:t}}e.create=t})(ZI||={}),(function(e){function t(e,t){return{triggerKind:e,selectedCompletionInfo:t}}e.create=t})(QI||={}),(function(e){function t(e){let t=e;return Z.objectLiteral(t)&&jF.is(t.uri)&&Z.string(t.name)}e.is=t})($I||={}),(function(e){function t(e,t,n,r){return new tL(e,t,n,r)}e.create=t;function n(e){let t=e;return!!(Z.defined(t)&&Z.string(t.uri)&&(Z.undefined(t.languageId)||Z.string(t.languageId))&&Z.uinteger(t.lineCount)&&Z.func(t.getText)&&Z.func(t.positionAt)&&Z.func(t.offsetAt))}e.is=n;function r(e,t){let n=e.getText(),r=i(t,(e,t)=>{let n=e.range.start.line-t.range.start.line;return n===0?e.range.start.character-t.range.start.character:n}),a=n.length;for(let t=r.length-1;t>=0;t--){let i=r[t],o=e.offsetAt(i.range.start),s=e.offsetAt(i.range.end);if(s<=a)n=n.substring(0,o)+i.newText+n.substring(s,n.length);else throw Error(`Overlapping edit`);a=o}return n}e.applyEdits=r;function i(e,t){if(e.length<=1)return e;let n=e.length/2|0,r=e.slice(0,n),a=e.slice(n);i(r,t),i(a,t);let o=0,s=0,c=0;for(;o<r.length&&s<a.length;)t(r[o],a[s])<=0?e[c++]=r[o++]:e[c++]=a[s++];for(;o<r.length;)e[c++]=r[o++];for(;s<a.length;)e[c++]=a[s++];return e}})(eL||={}),tL=class{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let r=0;r<t.length;r++){n&&=(e.push(r),!1);let i=t.charAt(r);n=i===`\r`||i===` +`,i===`\r`&&r+1<t.length&&t.charAt(r+1)===` +`&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return PF.create(0,e);for(;n<r;){let i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}let i=n-1;return PF.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)}get lineCount(){return this.getLineOffsets().length}},(function(e){let t=Object.prototype.toString;function n(e){return e!==void 0}e.defined=n;function r(e){return e===void 0}e.undefined=r;function i(e){return e===!0||e===!1}e.boolean=i;function a(e){return t.call(e)===`[object String]`}e.string=a;function o(e){return t.call(e)===`[object Number]`}e.number=o;function s(e,n,r){return t.call(e)===`[object Number]`&&n<=e&&e<=r}e.numberRange=s;function c(e){return t.call(e)===`[object Number]`&&-2147483648<=e&&e<=2147483647}e.integer=c;function l(e){return t.call(e)===`[object Number]`&&0<=e&&e<=2147483647}e.uinteger=l;function u(e){return t.call(e)===`[object Function]`}e.func=u;function d(e){return typeof e==`object`&&!!e}e.objectLiteral=d;function f(e,t){return Array.isArray(e)&&e.every(t)}e.typedArray=f})(Z||={})})),rL,iL=n((()=>{rL=class{constructor(e){this._start=0,this._pos=0,this.getStartOfToken=()=>this._start,this.getCurrentPosition=()=>this._pos,this.eol=()=>this._sourceText.length===this._pos,this.sol=()=>this._pos===0,this.peek=()=>this._sourceText.charAt(this._pos)||null,this.next=()=>{let e=this._sourceText.charAt(this._pos);return this._pos++,e},this.eat=e=>{if(this._testNextCharacter(e))return this._start=this._pos,this._pos++,this._sourceText.charAt(this._pos-1)},this.eatWhile=e=>{let t=this._testNextCharacter(e),n=!1;for(t&&(n=t,this._start=this._pos);t;)this._pos++,t=this._testNextCharacter(e),n=!0;return n},this.eatSpace=()=>this.eatWhile(/[\s\u00a0]/),this.skipToEnd=()=>{this._pos=this._sourceText.length},this.skipTo=e=>{this._pos=e},this.match=(e,t=!0,n=!1)=>{let r=null,i=null;return typeof e==`string`?(i=new RegExp(e,n?`i`:`g`).test(this._sourceText.slice(this._pos,this._pos+e.length)),r=e):e instanceof RegExp&&(i=this._sourceText.slice(this._pos).match(e),r=i?.[0]),i!=null&&(typeof e==`string`||i instanceof Array&&this._sourceText.startsWith(i[0],this._pos))?(t&&(this._start=this._pos,r&&r.length&&(this._pos+=r.length)),i):!1},this.backUp=e=>{this._pos-=e},this.column=()=>this._pos,this.indentation=()=>{let e=this._sourceText.match(/\s*/),t=0;if(e&&e.length!==0){let n=e[0],r=0;for(;n.length>r;)n.charCodeAt(r)===9?t+=2:t++,r++}return t},this.current=()=>this._sourceText.slice(this._start,this._pos),this._sourceText=e}_testNextCharacter(e){let t=this._sourceText.charAt(this._pos),n=!1;return n=typeof e==`string`?t===e:e instanceof RegExp?e.test(t):e(t),n}}}));function aL(e){return{ofRule:e}}function oL(e,t){return{ofRule:e,isList:!0,separator:t}}function sL(e,t){let n=e.match;return e.match=e=>{let r=!1;return n&&(r=n(e)),r&&t.every(t=>t.match&&!t.match(e))},e}function cL(e,t){return{style:t,match:t=>t.kind===e}}function Q(e,t){return{style:t||`punctuation`,match:t=>t.kind===`Punctuation`&&t.value===e}}var lL=n((()=>{}));function uL(e){return{style:`keyword`,match:t=>t.kind===`Name`&&t.value===e}}function dL(e){return{style:e,match:e=>e.kind===`Name`,update(e,t){e.name=t.value}}}function fL(e){return{style:e,match:e=>e.kind===`Name`,update(e,t){e.prevState?.prevState&&(e.name=t.value,e.prevState.prevState.type=t.value)}}}var pL,mL,hL,gL=n((()=>{lL(),kh(),pL=e=>e===` `||e===` `||e===`,`||e===` +`||e===`\r`||e===``||e===`\xA0`,mL={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/,Comment:/^#.*/},hL={Document:[oL(`Definition`)],Definition(e){switch(e.value){case`{`:return`ShortQuery`;case`query`:return`Query`;case`mutation`:return`Mutation`;case`subscription`:return`Subscription`;case`fragment`:return F.FRAGMENT_DEFINITION;case`schema`:return`SchemaDef`;case`scalar`:return`ScalarDef`;case`type`:return`ObjectTypeDef`;case`interface`:return`InterfaceDef`;case`union`:return`UnionDef`;case`enum`:return`EnumDef`;case`input`:return`InputDef`;case`extend`:return`ExtendDef`;case`directive`:return`DirectiveDef`}},ShortQuery:[`SelectionSet`],Query:[uL(`query`),aL(dL(`def`)),aL(`VariableDefinitions`),oL(`Directive`),`SelectionSet`],Mutation:[uL(`mutation`),aL(dL(`def`)),aL(`VariableDefinitions`),oL(`Directive`),`SelectionSet`],Subscription:[uL(`subscription`),aL(dL(`def`)),aL(`VariableDefinitions`),oL(`Directive`),`SelectionSet`],VariableDefinitions:[Q(`(`),oL(`VariableDefinition`),Q(`)`)],VariableDefinition:[`Variable`,Q(`:`),`Type`,aL(`DefaultValue`)],Variable:[Q(`$`,`variable`),dL(`variable`)],DefaultValue:[Q(`=`),`Value`],SelectionSet:[Q(`{`),oL(`Selection`),Q(`}`)],Selection(e,t){return e.value===`...`?t.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?`InlineFragment`:`FragmentSpread`:t.match(/[\s\u00a0,]*:/,!1)?`AliasedField`:`Field`},AliasedField:[dL(`property`),Q(`:`),dL(`qualifier`),aL(`Arguments`),oL(`Directive`),aL(`SelectionSet`)],Field:[dL(`property`),aL(`Arguments`),oL(`Directive`),aL(`SelectionSet`)],Arguments:[Q(`(`),oL(`Argument`),Q(`)`)],Argument:[dL(`attribute`),Q(`:`),`Value`],FragmentSpread:[Q(`...`),dL(`def`),oL(`Directive`)],InlineFragment:[Q(`...`),aL(`TypeCondition`),oL(`Directive`),`SelectionSet`],FragmentDefinition:[uL(`fragment`),aL(sL(dL(`def`),[uL(`on`)])),`TypeCondition`,oL(`Directive`),`SelectionSet`],TypeCondition:[uL(`on`),`NamedType`],Value(e){switch(e.kind){case`Number`:return`NumberValue`;case`String`:return`StringValue`;case`Punctuation`:switch(e.value){case`[`:return`ListValue`;case`{`:return`ObjectValue`;case`$`:return`Variable`;case`&`:return`NamedType`}return null;case`Name`:switch(e.value){case`true`:case`false`:return`BooleanValue`}return e.value===`null`?`NullValue`:`EnumValue`}},NumberValue:[cL(`Number`,`number`)],StringValue:[{style:`string`,match:e=>e.kind===`String`,update(e,t){t.value.startsWith(`"""`)&&(e.inBlockstring=!t.value.slice(3).endsWith(`"""`))}}],BooleanValue:[cL(`Name`,`builtin`)],NullValue:[cL(`Name`,`keyword`)],EnumValue:[dL(`string-2`)],ListValue:[Q(`[`),oL(`Value`),Q(`]`)],ObjectValue:[Q(`{`),oL(`ObjectField`),Q(`}`)],ObjectField:[dL(`attribute`),Q(`:`),`Value`],Type(e){return e.value===`[`?`ListType`:`NonNullType`},ListType:[Q(`[`),`Type`,Q(`]`),aL(Q(`!`))],NonNullType:[`NamedType`,aL(Q(`!`))],NamedType:[fL(`atom`)],Directive:[Q(`@`,`meta`),dL(`meta`),aL(`Arguments`)],DirectiveDef:[uL(`directive`),Q(`@`,`meta`),dL(`meta`),aL(`ArgumentsDef`),uL(`on`),oL(`DirectiveLocation`,Q(`|`))],InterfaceDef:[uL(`interface`),dL(`atom`),aL(`Implements`),oL(`Directive`),Q(`{`),oL(`FieldDef`),Q(`}`)],Implements:[uL(`implements`),oL(`NamedType`,Q(`&`))],DirectiveLocation:[dL(`string-2`)],SchemaDef:[uL(`schema`),oL(`Directive`),Q(`{`),oL(`OperationTypeDef`),Q(`}`)],OperationTypeDef:[dL(`keyword`),Q(`:`),dL(`atom`)],ScalarDef:[uL(`scalar`),dL(`atom`),oL(`Directive`)],ObjectTypeDef:[uL(`type`),dL(`atom`),aL(`Implements`),oL(`Directive`),Q(`{`),oL(`FieldDef`),Q(`}`)],FieldDef:[dL(`property`),aL(`ArgumentsDef`),Q(`:`),`Type`,oL(`Directive`)],ArgumentsDef:[Q(`(`),oL(`InputValueDef`),Q(`)`)],InputValueDef:[dL(`attribute`),Q(`:`),`Type`,aL(`DefaultValue`),oL(`Directive`)],UnionDef:[uL(`union`),dL(`atom`),oL(`Directive`),Q(`=`),oL(`UnionMember`,Q(`|`))],UnionMember:[`NamedType`],EnumDef:[uL(`enum`),dL(`atom`),oL(`Directive`),Q(`{`),oL(`EnumValueDef`),Q(`}`)],EnumValueDef:[dL(`string-2`),oL(`Directive`)],InputDef:[uL(`input`),dL(`atom`),oL(`Directive`),Q(`{`),oL(`InputValueDef`),Q(`}`)],ExtendDef:[uL(`extend`),`ExtensionDefinition`],ExtensionDefinition(e){switch(e.value){case`schema`:return F.SCHEMA_EXTENSION;case`scalar`:return F.SCALAR_TYPE_EXTENSION;case`type`:return F.OBJECT_TYPE_EXTENSION;case`interface`:return F.INTERFACE_TYPE_EXTENSION;case`union`:return F.UNION_TYPE_EXTENSION;case`enum`:return F.ENUM_TYPE_EXTENSION;case`input`:return F.INPUT_OBJECT_TYPE_EXTENSION}},[F.SCHEMA_EXTENSION]:[`SchemaDef`],[F.SCALAR_TYPE_EXTENSION]:[`ScalarDef`],[F.OBJECT_TYPE_EXTENSION]:[`ObjectTypeDef`],[F.INTERFACE_TYPE_EXTENSION]:[`InterfaceDef`],[F.UNION_TYPE_EXTENSION]:[`UnionDef`],[F.ENUM_TYPE_EXTENSION]:[`EnumDef`],[F.INPUT_OBJECT_TYPE_EXTENSION]:[`InputDef`]}}));function _L(e={eatWhitespace:e=>e.eatWhile(pL),lexRules:mL,parseRules:hL,editorConfig:{}}){return{startState(){let t={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeparator:!1,prevState:null};return bL(e.parseRules,t,F.DOCUMENT),t},token(t,n){return vL(t,n,e)}}}function vL(e,t,n){if(t.inBlockstring)return e.match(/.*"""/)?(t.inBlockstring=!1,`string`):(e.skipToEnd(),`string`);let{lexRules:r,parseRules:i,eatWhitespace:a,editorConfig:o}=n;if(t.rule&&t.rule.length===0?xL(t):t.needsAdvance&&(t.needsAdvance=!1,SL(t,!0)),e.sol()){let n=o?.tabSize||2;t.indentLevel=Math.floor(e.indentation()/n)}if(a(e))return`ws`;let s=TL(r,e);if(!s)return e.match(/\S+/)||e.match(/\s/),bL(EL,t,`Invalid`),`invalidchar`;if(s.kind===`Comment`)return bL(EL,t,`Comment`),`comment`;let c=yL({},t);if(s.kind===`Punctuation`){if(/^[{([]/.test(s.value))t.indentLevel!==void 0&&(t.levels=(t.levels||[]).concat(t.indentLevel+1));else if(/^[})\]]/.test(s.value)){let e=t.levels=(t.levels||[]).slice(0,-1);t.indentLevel&&e.length>0&&e.at(-1)<t.indentLevel&&(t.indentLevel=e.at(-1))}}for(;t.rule;){let n=typeof t.rule==`function`?t.step===0?t.rule(s,e):null:t.rule[t.step];if(t.needsSeparator&&(n=n?.separator),n){if(n.ofRule&&(n=n.ofRule),typeof n==`string`){bL(i,t,n);continue}if(n.match?.call(n,s))return n.update&&n.update(t,s),s.kind===`Punctuation`?SL(t,!0):t.needsAdvance=!0,n.style}wL(t)}return yL(t,c),bL(EL,t,`Invalid`),`invalidchar`}function yL(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r++)e[n[r]]=t[n[r]];return e}function bL(e,t,n){if(!e[n])throw TypeError(`Unknown rule: `+n);t.prevState=Object.assign({},t),t.kind=n,t.name=null,t.type=null,t.rule=e[n],t.step=0,t.needsSeparator=!1}function xL(e){e.prevState&&=(e.kind=e.prevState.kind,e.name=e.prevState.name,e.type=e.prevState.type,e.rule=e.prevState.rule,e.step=e.prevState.step,e.needsSeparator=e.prevState.needsSeparator,e.prevState.prevState)}function SL(e,t){if(CL(e)&&e.rule){let n=e.rule[e.step];if(n.separator){let{separator:t}=n;if(e.needsSeparator=!e.needsSeparator,!e.needsSeparator&&t.ofRule)return}if(t)return}for(e.needsSeparator=!1,e.step++;e.rule&&!(Array.isArray(e.rule)&&e.step<e.rule.length);)xL(e),e.rule&&(CL(e)?e.rule?.[e.step].separator&&(e.needsSeparator=!e.needsSeparator):(e.needsSeparator=!1,e.step++))}function CL(e){let t=Array.isArray(e.rule)&&typeof e.rule[e.step]!=`string`&&e.rule[e.step];return t&&t.isList}function wL(e){for(;e.rule&&!(Array.isArray(e.rule)&&e.rule[e.step].ofRule);)xL(e);e.rule&&SL(e,!1)}function TL(e,t){let n=Object.keys(e);for(let r=0;r<n.length;r++){let i=t.match(e[n[r]]);if(i&&i instanceof Array)return{kind:n[r],value:i[0]}}}var EL,DL=n((()=>{gL(),kh(),EL={Invalid:[],Comment:[]}}));function OL(e,t){let n=e.split(` +`),r=_L(),i=r.startState(),a=``,o=new rL(``);for(let e=0;e<n.length;e++){for(o=new rL(n[e]);!o.eol()&&(a=r.token(o,i),t(o,i,a,e)!==`BREAK`););t(o,i,a,e),i.kind||(i=r.startState())}return{start:o.getStartOfToken(),end:o.getCurrentPosition(),string:o.current(),state:i,style:a}}function kL(e,t){return t?.endsWith(`.graphqls`)?ML.TYPE_SYSTEM:PL(e)}function AL(e,t,n=0){let r=null,i=null,a=null,o=OL(e,(e,o,s,c)=>{if(!(c!==t.line||e.getCurrentPosition()+n<t.character+1))return r=s,i=Object.assign({},o),a=e.current(),`BREAK`});return{start:o.start,end:o.end,string:a||o.string,state:i||o.state,style:r||o.style}}function jL(e,t,n,r,i){let a=r||AL(e,t,1);if(!a)return null;let o=a.state.kind===`Invalid`?a.state.prevState:a.state;return o?{token:a,state:o,typeInfo:zL(n,a.state),mode:i?.mode||kL(e,i?.uri)}:null}var ML,NL,PL,FL=n((()=>{UL(),kh(),(function(e){e.TYPE_SYSTEM=`TYPE_SYSTEM`,e.EXECUTABLE=`EXECUTABLE`,e.UNKNOWN=`UNKNOWN`})(ML||={}),NL=[F.SCHEMA_DEFINITION,F.OPERATION_TYPE_DEFINITION,F.SCALAR_TYPE_DEFINITION,F.OBJECT_TYPE_DEFINITION,F.INTERFACE_TYPE_DEFINITION,F.UNION_TYPE_DEFINITION,F.ENUM_TYPE_DEFINITION,F.INPUT_OBJECT_TYPE_DEFINITION,F.DIRECTIVE_DEFINITION,F.SCHEMA_EXTENSION,F.SCALAR_TYPE_EXTENSION,F.OBJECT_TYPE_EXTENSION,F.INTERFACE_TYPE_EXTENSION,F.UNION_TYPE_EXTENSION,F.ENUM_TYPE_EXTENSION,F.INPUT_OBJECT_TYPE_EXTENSION],PL=e=>{let t=ML.UNKNOWN;if(e)try{$o(_o(e),{enter(e){if(e.kind===`Document`){t=ML.EXECUTABLE;return}return NL.includes(e.kind)?(t=ML.TYPE_SYSTEM,rs):!1}})}catch{return t}return t}}));function IL(e,t,n){return n===cl.name&&e.getQueryType()===t?cl:n===ll.name&&e.getQueryType()===t?ll:n===ul.name&&zs(t)?ul:`getFields`in t?t.getFields()[n]:null}function LL(e,t){let n=[],r=e;for(;r?.kind;)n.push(r),r=r.prevState;for(let e=n.length-1;e>=0;e--)t(n[e])}function RL(e){let t;return LL(e,e=>{switch(e.kind){case`Query`:case`ShortQuery`:case`Mutation`:case`Subscription`:case`FragmentDefinition`:t=e;break}}),t}function zL(e,t){let n,r,i,a,o,s,c,l,u,d,f;return LL(t,t=>{switch(t.kind){case $.QUERY:case`ShortQuery`:d=e.getQueryType();break;case $.MUTATION:d=e.getMutationType();break;case $.SUBSCRIPTION:d=e.getSubscriptionType();break;case $.INLINE_FRAGMENT:case $.FRAGMENT_DEFINITION:t.type&&(d=e.getType(t.type));break;case $.FIELD:case $.ALIASED_FIELD:!d||!t.name?o=null:(o=u?IL(e,u,t.name):null,d=o?o.type:null);break;case $.SELECTION_SET:u=Xs(d);break;case $.DIRECTIVE:i=t.name?e.getDirective(t.name):null;break;case $.INTERFACE_DEF:t.name&&(c=null,f=new hc({name:t.name,interfaces:[],fields:{}}));break;case $.OBJECT_TYPE_DEF:t.name&&(f=null,c=new mc({name:t.name,interfaces:[],fields:{}}));break;case $.ARGUMENTS:if(t.prevState)switch(t.prevState.kind){case $.FIELD:r=o&&o.args;break;case $.DIRECTIVE:r=i&&i.args;break;case $.ALIASED_FIELD:{let n=t.prevState?.name;if(!n){r=null;break}let i=u?IL(e,u,n):null;if(!i){r=null;break}r=i.args;break}default:r=null;break}else r=null;break;case $.ARGUMENT:if(r){for(let e=0;e<r.length;e++)if(r[e].name===t.name){n=r[e];break}}s=n?.type;break;case $.VARIABLE_DEFINITION:case $.VARIABLE:d=s;break;case $.ENUM_VALUE:let p=Xs(s);a=p instanceof _c?p.getValues().find(e=>e.value===t.name):null;break;case $.LIST_VALUE:let m=qs(s);s=m instanceof dc?m.ofType:null;break;case $.OBJECT_VALUE:let h=Xs(s);l=h instanceof vc?h.getFields():null;break;case $.OBJECT_FIELD:let g=t.name&&l?l[t.name]:null;s=g?.type,o=g,d=o?o.type:null;break;case $.NAMED_TYPE:t.name&&(d=e.getType(t.name));break}}),{argDef:n,argDefs:r,directiveDef:i,enumValue:a,fieldDef:o,inputType:s,objectFieldDefs:l,parentType:u,type:d,interfaceDef:f,objectTypeDef:c}}var BL=n((()=>{kh(),UL()})),VL,$,HL=n((()=>{kh(),VL={ALIASED_FIELD:`AliasedField`,ARGUMENTS:`Arguments`,SHORT_QUERY:`ShortQuery`,QUERY:`Query`,MUTATION:`Mutation`,SUBSCRIPTION:`Subscription`,TYPE_CONDITION:`TypeCondition`,INVALID:`Invalid`,COMMENT:`Comment`,SCHEMA_DEF:`SchemaDef`,SCALAR_DEF:`ScalarDef`,OBJECT_TYPE_DEF:`ObjectTypeDef`,OBJECT_VALUE:`ObjectValue`,LIST_VALUE:`ListValue`,INTERFACE_DEF:`InterfaceDef`,UNION_DEF:`UnionDef`,ENUM_DEF:`EnumDef`,ENUM_VALUE:`EnumValue`,FIELD_DEF:`FieldDef`,INPUT_DEF:`InputDef`,INPUT_VALUE_DEF:`InputValueDef`,ARGUMENTS_DEF:`ArgumentsDef`,EXTEND_DEF:`ExtendDef`,EXTENSION_DEFINITION:`ExtensionDefinition`,DIRECTIVE_DEF:`DirectiveDef`,IMPLEMENTS:`Implements`,VARIABLE_DEFINITIONS:`VariableDefinitions`,TYPE:`Type`,VARIABLE:`Variable`},$=Object.assign(Object.assign({},F),VL)})),UL=n((()=>{iL(),gL(),lL(),DL(),FL(),BL(),HL()})),WL,GL=n((()=>{nL(),UL(),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(WL||={})}));function KL(e,t,n,r,i,a){let o=Object.assign(Object.assign({},a),{schema:e}),s=jL(t,n,e,r,a);if(!s)return[];let{state:c,typeInfo:l,mode:u,token:d}=s,{kind:f,step:p,prevState:m}=c;if(f===$.DOCUMENT)return u===ML.TYPE_SYSTEM?qL(d):u===ML.EXECUTABLE?JL(d):YL(d);if(f===$.EXTEND_DEF)return XL(d);if(m?.prevState?.kind===$.EXTENSION_DEFINITION&&c.name)return yF(d,[]);if(m?.kind===F.SCALAR_TYPE_EXTENSION)return yF(d,Object.values(e.getTypeMap()).filter(ys).map(e=>({label:e.name,kind:WL.Function})));if(m?.kind===F.OBJECT_TYPE_EXTENSION)return yF(d,Object.values(e.getTypeMap()).filter(e=>B(e)&&!e.name.startsWith(`__`)).map(e=>({label:e.name,kind:WL.Function})));if(m?.kind===F.INTERFACE_TYPE_EXTENSION)return yF(d,Object.values(e.getTypeMap()).filter(Ss).map(e=>({label:e.name,kind:WL.Function})));if(m?.kind===F.UNION_TYPE_EXTENSION)return yF(d,Object.values(e.getTypeMap()).filter(ws).map(e=>({label:e.name,kind:WL.Function})));if(m?.kind===F.ENUM_TYPE_EXTENSION)return yF(d,Object.values(e.getTypeMap()).filter(e=>Es(e)&&!e.name.startsWith(`__`)).map(e=>({label:e.name,kind:WL.Function})));if(m?.kind===F.INPUT_OBJECT_TYPE_EXTENSION)return yF(d,Object.values(e.getTypeMap()).filter(Os).map(e=>({label:e.name,kind:WL.Function})));if(f===$.IMPLEMENTS||f===$.NAMED_TYPE&&m?.kind===$.IMPLEMENTS)return $L(d,c,e,t,l);if(f===$.SELECTION_SET||f===$.FIELD||f===$.ALIASED_FIELD)return ZL(d,l,o);if(f===$.ARGUMENTS||f===$.ARGUMENT&&p===0){let{argDefs:e}=l;if(e)return yF(d,e.map(e=>({label:e.name,insertText:DF(e.name+`: `,e.type),insertTextMode:mI.adjustIndentation,insertTextFormat:dI.Snippet,command:lR,labelDetails:{detail:` `+String(e.type)},documentation:e.description??void 0,kind:WL.Variable,type:e.type})))}if((f===$.OBJECT_VALUE||f===$.OBJECT_FIELD&&p===0)&&l.objectFieldDefs){let e=vF(l.objectFieldDefs),t=f===$.OBJECT_VALUE?WL.Value:WL.Field;return yF(d,e.map(e=>({label:e.name,detail:String(e.type),documentation:e?.description??void 0,kind:t,type:e.type,insertText:DF(e.name+`: `,e.type),insertTextMode:mI.adjustIndentation,insertTextFormat:dI.Snippet,command:lR})))}if(f===$.ENUM_VALUE||f===$.LIST_VALUE&&p===1||f===$.OBJECT_FIELD&&p===2||f===$.ARGUMENT&&p===2)return QL(d,l,t,e);if(f===$.VARIABLE&&p===1){let n=Xs(l.inputType);return yF(d,nR(t,e,d).filter(e=>e.detail===n?.name))}if(f===$.TYPE_CONDITION&&p===1||f===$.NAMED_TYPE&&m!=null&&m.kind===$.TYPE_CONDITION)return eR(d,l,e,f);if(f===$.FRAGMENT_SPREAD&&p===1)return tR(d,l,e,t,Array.isArray(i)?i:uR(i));let h=cR(c);return h.kind===$.FIELD_DEF?yF(d,Object.values(e.getTypeMap()).filter(e=>Fs(e)&&!e.name.startsWith(`__`)).map(e=>({label:e.name,kind:WL.Function,insertText:a?.fillLeafsOnComplete?e.name+` +`:e.name,insertTextMode:mI.adjustIndentation}))):h.kind===$.INPUT_VALUE_DEF&&p===2?yF(d,Object.values(e.getTypeMap()).filter(e=>Ns(e)&&!e.name.startsWith(`__`)).map(e=>({label:e.name,kind:WL.Function,insertText:a?.fillLeafsOnComplete?e.name+` +$1`:e.name,insertTextMode:mI.adjustIndentation,insertTextFormat:dI.Snippet}))):f===$.VARIABLE_DEFINITION&&p===2||f===$.LIST_TYPE&&p===1||f===$.NAMED_TYPE&&m&&(m.kind===$.VARIABLE_DEFINITION||m.kind===$.LIST_TYPE||m.kind===$.NON_NULL_TYPE)?iR(d,e,f):f===$.DIRECTIVE?aR(d,c,e,f):f===$.DIRECTIVE_DEF?oR(d,c,e,f):[]}function qL(e){return yF(e,[{label:`extend`,kind:WL.Function},...dR])}function JL(e){return yF(e,fR)}function YL(e){return yF(e,[{label:`extend`,kind:WL.Function},...fR,...dR])}function XL(e){return yF(e,dR)}function ZL(e,t,n){if(t.parentType){let{parentType:r}=t,i=[];return`getFields`in r&&(i=vF(r.getFields())),zs(r)&&i.push(ul),r===(n?.schema)?.getQueryType()&&i.push(cl,ll),yF(e,i.map((t,r)=>{let i={sortText:String(r)+t.name,label:t.name,detail:String(t.type),documentation:t.description??void 0,deprecated:!!t.deprecationReason,isDeprecated:!!t.deprecationReason,deprecationReason:t.deprecationReason,kind:WL.Field,labelDetails:{detail:` `+t.type.toString()},type:t.type};return n?.fillLeafsOnComplete&&(i.insertText=OF(t),i.insertText||=EF(t.name,t.type,t.name+(e.state.needsAdvance?``:` +`)),i.insertText&&(i.insertTextFormat=dI.Snippet,i.insertTextMode=mI.adjustIndentation,i.command=lR)),i}))}return[]}function QL(e,t,n,r){let i=Xs(t.inputType),a=nR(n,r,e).filter(e=>e.detail===i?.name);return i instanceof _c?yF(e,i.getValues().map(e=>({label:e.name,detail:String(i),documentation:e.description??void 0,deprecated:!!e.deprecationReason,isDeprecated:!!e.deprecationReason,deprecationReason:e.deprecationReason,kind:WL.EnumMember,type:i})).concat(a)):i===jc?yF(e,a.concat([{label:`true`,detail:String(jc),documentation:`Not false.`,kind:WL.Variable,type:jc},{label:`false`,detail:String(jc),documentation:`Not true.`,kind:WL.Variable,type:jc}])):a}function $L(e,t,n,r,i){if(t.needsSeparator)return[];let a=vF(n.getTypeMap()).filter(Ss),o=a.map(({name:e})=>e),s=new Set;OL(r,(e,t)=>{if(t.name&&(t.kind===$.INTERFACE_DEF&&!o.includes(t.name)&&s.add(t.name),t.kind===$.NAMED_TYPE&&t.prevState?.kind===$.IMPLEMENTS)){if(i.interfaceDef){if(i.interfaceDef?.getInterfaces().find(({name:e})=>e===t.name))return;let e=n.getType(t.name),r=i.interfaceDef?.toConfig();i.interfaceDef=new hc(Object.assign(Object.assign({},r),{interfaces:[...r.interfaces,e||new hc({name:t.name,fields:{}})]}))}else if(i.objectTypeDef){if(i.objectTypeDef?.getInterfaces().find(({name:e})=>e===t.name))return;let e=n.getType(t.name),r=i.objectTypeDef?.toConfig();i.objectTypeDef=new mc(Object.assign(Object.assign({},r),{interfaces:[...r.interfaces,e||new hc({name:t.name,fields:{}})]}))}}});let c=i.interfaceDef||i.objectTypeDef,l=(c?.getInterfaces()||[]).map(({name:e})=>e);return yF(e,a.concat([...s].map(e=>({name:e}))).filter(({name:e})=>e!==c?.name&&!l.includes(e)).map(e=>{let t={label:e.name,kind:WL.Interface,type:e};return e?.description&&(t.documentation=e.description),t}))}function eR(e,t,n,r){let i;if(t.parentType)if(Vs(t.parentType)){let e=Hs(t.parentType),r=n.getPossibleTypes(e),a=Object.create(null);for(let e of r)for(let t of e.getInterfaces())a[t.name]=t;i=r.concat(vF(a))}else i=[t.parentType];else i=vF(n.getTypeMap()).filter(e=>zs(e)&&!e.name.startsWith(`__`));return yF(e,i.map(e=>{let t=Xs(e);return{label:String(e),documentation:t?.description||``,kind:WL.Field}}))}function tR(e,t,n,r,i){if(!r)return[];let a=n.getTypeMap(),o=RL(e.state),s=rR(r);return i&&i.length>0&&s.push(...i),yF(e,s.filter(e=>a[e.typeCondition.name.value]&&!(o&&o.kind===$.FRAGMENT_DEFINITION&&o.name===e.name.value)&&zs(t.parentType)&&zs(a[e.typeCondition.name.value])&&Sc(n,t.parentType,a[e.typeCondition.name.value])).map(e=>({label:e.name.value,detail:String(a[e.typeCondition.name.value]),documentation:`fragment ${e.name.value} on ${e.typeCondition.name.value}`,labelDetails:{detail:`fragment ${e.name.value} on ${e.typeCondition.name.value}`},kind:WL.Field,type:a[e.typeCondition.name.value]})))}function nR(e,t,n){let r=null,i,a=Object.create({});return OL(e,(e,o)=>{if(o?.kind===$.VARIABLE&&o.name&&(r=o.name),o?.kind===$.NAMED_TYPE&&r){let e=pR(o,$.TYPE);e?.type&&(i=t.getType(e?.type))}if(r&&i&&!a[r]){let e=n.string===`$`||n?.state?.kind===`Variable`?r:`$`+r;a[r]={detail:i.toString(),insertText:e,label:`$`+r,rawInsert:e,type:i,kind:WL.Variable},r=null,i=null}}),vF(a)}function rR(e){let t=[];return OL(e,(e,n)=>{n.kind===$.FRAGMENT_DEFINITION&&n.name&&n.type&&t.push({kind:$.FRAGMENT_DEFINITION,name:{kind:F.NAME,value:n.name},selectionSet:{kind:$.SELECTION_SET,selections:[]},typeCondition:{kind:$.NAMED_TYPE,name:{kind:F.NAME,value:n.type}}})}),t}function iR(e,t,n){return yF(e,vF(t.getTypeMap()).filter(Ns).map(e=>({label:e.name,documentation:e?.description||``,kind:WL.Variable})))}function aR(e,t,n,r){return t.prevState?.kind?yF(e,n.getDirectives().filter(e=>sR(t.prevState,e)).map(e=>({label:e.name,documentation:e?.description||``,kind:WL.Function}))):[]}function oR(e,t,n,r){return yF(e,n.getDirectives().find(e=>e.name===t.name)?.args.map(e=>({label:e.name,documentation:e.description||``,kind:WL.Field}))||[])}function sR(e,t){if(!e?.kind)return!1;let{kind:n,prevState:r}=e,{locations:i}=t;switch(n){case $.QUERY:return i.includes(P.QUERY);case $.MUTATION:return i.includes(P.MUTATION);case $.SUBSCRIPTION:return i.includes(P.SUBSCRIPTION);case $.FIELD:case $.ALIASED_FIELD:return i.includes(P.FIELD);case $.FRAGMENT_DEFINITION:return i.includes(P.FRAGMENT_DEFINITION);case $.FRAGMENT_SPREAD:return i.includes(P.FRAGMENT_SPREAD);case $.INLINE_FRAGMENT:return i.includes(P.INLINE_FRAGMENT);case $.SCHEMA_DEF:return i.includes(P.SCHEMA);case $.SCALAR_DEF:return i.includes(P.SCALAR);case $.OBJECT_TYPE_DEF:return i.includes(P.OBJECT);case $.FIELD_DEF:return i.includes(P.FIELD_DEFINITION);case $.INTERFACE_DEF:return i.includes(P.INTERFACE);case $.UNION_DEF:return i.includes(P.UNION);case $.ENUM_DEF:return i.includes(P.ENUM);case $.ENUM_VALUE:return i.includes(P.ENUM_VALUE);case $.INPUT_DEF:return i.includes(P.INPUT_OBJECT);case $.INPUT_VALUE_DEF:switch(r?.kind){case $.ARGUMENTS_DEF:return i.includes(P.ARGUMENT_DEFINITION);case $.INPUT_DEF:return i.includes(P.INPUT_FIELD_DEFINITION)}}return!1}function cR(e){return e.prevState&&e.kind&&[$.NAMED_TYPE,$.LIST_TYPE,$.TYPE,$.NON_NULL_TYPE].includes(e.kind)?cR(e.prevState):e}var lR,uR,dR,fR,pR,mR=n((()=>{kh(),GL(),UL(),kF(),nL(),lR={command:`editor.action.triggerSuggest`,title:`Suggestions`},uR=e=>{let t=[];if(e)try{$o(_o(e),{FragmentDefinition(e){t.push(e)}})}catch{return[]}return t},dR=[{label:`type`,kind:WL.Function},{label:`interface`,kind:WL.Function},{label:`union`,kind:WL.Function},{label:`input`,kind:WL.Function},{label:`scalar`,kind:WL.Function},{label:`schema`,kind:WL.Function}],fR=[{label:`query`,kind:WL.Function},{label:`mutation`,kind:WL.Function},{label:`subscription`,kind:WL.Function},{label:`fragment`,kind:WL.Function},{label:`{`,kind:WL.Constructor}],pR=(e,t)=>{if(e.prevState?.kind===t)return e.prevState;if(e.prevState?.prevState?.kind===t)return e.prevState.prevState;if(e.prevState?.prevState?.prevState?.kind===t)return e.prevState.prevState.prevState;if(e.prevState?.prevState?.prevState?.prevState?.kind===t)return e.prevState.prevState.prevState.prevState}})),hR=r(((e,t)=>{function n(e,t){if(e!=null)return e;var n=Error(t===void 0?`Got unexpected `+e:t);throw n.framesToPop=1,n}t.exports=n,t.exports.default=n,Object.defineProperty(t.exports,`__esModule`,{value:!0})})),gR=n((()=>{hR()})),_R,vR,yR=n((()=>{_R=class{constructor(e,t){this.containsPosition=e=>this.start.line===e.line?this.start.character<=e.character:this.end.line===e.line?this.end.character>=e.character:this.start.line<=e.line&&this.end.line>=e.line,this.start=e,this.end=t}setStart(e,t){this.start=new vR(e,t)}setEnd(e,t){this.end=new vR(e,t)}},vR=class{constructor(e,t){this.lessThanOrEqualTo=e=>this.line<e.line||this.line===e.line&&this.character<=e.character,this.line=e,this.character=t}setLine(e){this.line=e}setCharacter(e){this.character=e}}}));function bR(e,t,n,r,i){let a=Mf.filter(e=>!(e===Fu||e===ru||r&&e===vu));return n&&Array.prototype.push.apply(a,n),i&&Array.prototype.push.apply(a,xR),zf(e,t,a).filter(e=>{if(e.message.includes(`Unknown directive`)&&e.nodes){let t=e.nodes[0];if(t&&t.kind===F.DIRECTIVE){let e=t.name.value;if(e===`arguments`||e===`argumentDefinitions`)return!1}}return!0})}var xR,SR=n((()=>{kh(),xR=[Eu,gf,vf,af,sf,ef,bu,mu,nf,ud,Qd,ff,bf,lu,hd]})),CR=n((()=>{gR(),kh(),yR(),SR()})),wR=n((()=>{CR()}));function TR(e,t=null,n,r,i){let a=null,o=``;i&&(o=typeof i==`string`?i:i.reduce((e,t)=>e+as(t)+` + +`,``));let s=o?`${e}\n\n${o}`:e;try{a=_o(s)}catch(e){if(e instanceof M){let t=OR(e.locations?.[0]??{line:0,column:0},s);return[{severity:jR.Error,message:e.message,source:`GraphQL: Syntax`,range:t}]}throw e}return ER(a,t,n,r)}function ER(e,t=null,n,r){if(!t)return[];let i=bR(t,e,n,r).flatMap(e=>DR(e,jR.Error,`Validation`)),a=zf(t,e,[Up]).flatMap(e=>DR(e,jR.Warning,`Deprecation`));return i.concat(a)}function DR(e,t,n){if(!e.nodes)return[];let r=[];for(let[i,a]of e.nodes.entries()){let o=a.kind!==`Variable`&&`name`in a&&a.name!==void 0?a.name:`variable`in a&&a.variable!==void 0?a.variable:a;if(o){MR(e.locations,`GraphQL validation error requires locations.`);let a=e.locations[i],s=kR(o),c=a.column+(s.end-s.start);r.push({source:`GraphQL: ${n}`,message:e.message,severity:t,range:new _R(new vR(a.line-1,a.column-1),new vR(a.line-1,c))})}}return r}function OR(e,t){let n=_L(),r=n.startState(),i=t.split(` +`);MR(i.length>=e.line,`Query text must have more lines than where the error happened`);let a=null;for(let t=0;t<e.line;t++)for(a=new rL(i[t]);!a.eol()&&n.token(a,r)!==`invalidchar`;);MR(a,`Expected Parser stream to be available.`);let o=e.line-1,s=a.getStartOfToken(),c=a.getCurrentPosition();return new _R(new vR(o,s),new vR(o,c))}function kR(e){let t=e.loc;return MR(t,`Expected ASTNode to have a location.`),t}var AR,jR,MR,NR=n((()=>{kh(),UL(),CR(),AR={Error:`Error`,Warning:`Warning`,Information:`Information`,Hint:`Hint`},jR={[AR.Error]:1,[AR.Warning]:2,[AR.Information]:3,[AR.Hint]:4},MR=(e,t)=>{if(!e)throw Error(t)}})),PR=n((()=>{CR()})),FR=n((()=>{UL()})),IR=n((()=>{kF(),mR(),wR(),NR(),PR(),FR()})),LR=n((()=>{IR(),UL(),GL(),CR()}));function RR(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}function zR(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||VR(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function BR(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function VR(e,t,n,r){let i=BR(n,r,t);return i<0||BR(n,r,e)<i}function HR(e,t,n){let r=e.cursor(xE.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}function UR(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}function WR(e,t){return e[t]|e[t+1]<<16}function GR(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function KR(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}var qR,JR,YR,XR,ZR,QR,$R,ez,tz,nz,rz,iz,az,oz,sz,cz,lz=n((()=>{FE(),qR=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new JR(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new YR(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216))if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new JR(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},JR=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},YR=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},XR=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}},ZR=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},QR=new ZR,$R=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=QR,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=QR,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},ez=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;zR(this.data,e,t,this.id,n.data,n.tokenPrecTable)}},ez.prototype.contextual=ez.prototype.fallback=ez.prototype.extend=!1,tz=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?RR(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(zR(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}},tz.prototype.contextual=ez.prototype.fallback=ez.prototype.extend=!1,nz=typeof process<`u`&&process.env&&/\bparse\b/.test(process.env.LOG),rz=null,iz=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?HR(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?HR(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof SE){if(a==e){if(a<this.safeFrom)return null;let e=a+i.length;if(e<=this.safeTo){let t=i.prop(mE.lookAhead);if(!t||e+t<this.fragment.to)return i}}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},az=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new ZR)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if(!(n&&!c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new ZR,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new ZR,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535)if(o[s+1]==1)s=WR(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(WR(o,s+2),t,n,r));break}o[s]==t&&(r=this.putAction(WR(o,s+1),t,n,r))}return r}},oz=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new $R(t,r),this.tokens=new az(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[qR.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new iz(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&GR(r);if(e)return nz&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw nz&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return nz&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=nz?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(r);o;){let r=this.parser.nodeSet.types[o.type.id]==o.type?i.getGoto(e.state,o.type.id):-1;if(r>-1&&o.length&&(!t||(o.prop(mE.contextHash)||0)==n))return e.useNode(o,r),nz&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(o.type.id)})`),!0;if(!(o instanceof SE)||o.children.length==0||o.positions[0]>0)break;let s=o.children[0];if(s instanceof SE&&o.positions[0]==0)o=s;else break}}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),nz&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),nz&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return UR(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=nz?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),nz&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(nz&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)nz&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))nz&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),nz&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),UR(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),SE.build({buffer:XR.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(rz||=new WeakMap).get(e);return t||rz.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}},sz=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},cz=class e extends NE{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=mE[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new vE(t.map((t,i)=>_E.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=dE;let a=RR(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(KR),this.states=RR(e.states,Uint32Array),this.data=RR(e.stateData),this.goto=RR(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new ez(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new oz(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535)if(n[i+1]==1)a=n[i=WR(n,i+2)];else if(n[i+1]==2)return WR(n,i+2);else break;if(a==t||a==0)return WR(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=WR(this.data,n+2);else break;r=t(WR(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=WR(this.data,n+2);else break;if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=KR(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new sz(e,n,r)}static deserialize(t){return new e(t)}}}));function uz(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new Tz(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new Tz(r.from,n,r.diagnostic)}),r}function dz(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(Pz).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(Dz))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function fz(e,t){return e.field(Az,!1)?t:t.concat(G.appendConfig.of(zz))}function pz(e,t){return{effects:fz(e,[Dz.of(t)])}}function mz(e,t,n){let{diagnostics:r}=e.state.field(Az),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(Pz).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:hz(e,i)}}}:null}function hz(e,t){return wv(`ul`,{class:`cm-tooltip-lint`},t.map(t=>bz(e,t,!1)))}function gz(e,t,n){let r=[],i=-1;for(let a of e)a.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}function _z(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function vz(e,t={}){return[Pz.of({source:e,config:t}),Nz,zz]}function yz(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function bz(e,t,n){let r=n?yz(t.actions):[];return wv(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},wv(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=uz(e.state.field(Az).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),wv(`u`,s.slice(c,c+1)),s.slice(c+1)];return wv(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&wv(`div`,{class:`cm-diagnosticSource`},t.source))}function xz(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function Sz(e){return xz(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}function Cz(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function wz(e){let t=`hint`,n=1;for(let r of e){let e=Cz(r.severity);e>n&&(n=e,t=r.severity)}return t}var Tz,Ez,Dz,Oz,kz,Az,jz,Mz,Nz,Pz,Fz,Iz,Lz,Rz,zz,Bz=n((()=>{eE(),cv(),Ev(),Tz=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},Ez=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(Pz).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new iv,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=wz(s);if(i)o.add(n,n,q.widget({widget:new Fz(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,q.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,uz(f))}},Dz=G.define(),Oz=G.define(),kz=G.define(),Az=j_.define({create(){return new Ez(q.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=uz(n,e.selected.diagnostic,i)||uz(n,null,i)}!n.size&&i&&t.state.facet(Pz).autoPanel&&(i=null),e=new Ez(n,i,r)}for(let n of t.effects)if(n.is(Dz)){let r=t.state.facet(Pz).autoPanel?n.value.length?Lz.open:null:e.panel;e=Ez.init(n.value,r,t.state)}else n.is(Oz)?e=new Ez(e.diagnostics,n.value?Lz.open:null,e.selected):n.is(kz)&&(e=new Ez(e.diagnostics,e.panel,n.value));return e},provide:e=>[OT.from(e,e=>e.panel),J.decorations.from(e,e=>e.diagnostics)]}),jz=q.mark({class:`cm-lintRange cm-lintRange-active`}),Mz=e=>{let t=e.state.field(Az,!1);return!t||!t.panel?!1:(e.dispatch({effects:Oz.of(!1)}),!0)},Nz=US.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(Pz);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(Pz);t.length&&gz(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(pz(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{gy(this.view.state,e)})}}update(e){let t=e.state.facet(Pz);(e.docChanged||t!=e.startState.facet(Pz)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Pz=W.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...n_(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:_z,tooltipFilter:_z,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}}),Fz=class extends iS{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return wv(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},Iz=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=bz(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},Lz=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)Mz(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=yz(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=uz(this.view.state.field(Az).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=wv(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=wv(`div`,{class:`cm-panel-lint`},this.list,wv(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>Mz(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(Az).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Az),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new Iz(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new Iz(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=uz(this.view.state.field(Az).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:kz.of(t)})}static open(t){return new e(t)}},Rz=J.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:Sz(`#d11`)},".cm-lintRange-warning":{backgroundImage:Sz(`orange`)},".cm-lintRange-info":{backgroundImage:Sz(`#999`)},".cm-lintRange-hint":{backgroundImage:Sz(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}}),zz=[Az,J.decorations.compute([Az],e=>{let{selected:t,panel:n}=e.field(Az);return!t||!n||t.from==t.to?q.none:q.set([jz.range(t.from,t.to)])}),wx(mz,{hideOn:dz}),Rz]})),Vz=i({Position:()=>Kz,completion:()=>mB,fillAllFieldsCommands:()=>aB,getOpts:()=>nB,getSchema:()=>tB,graphql:()=>Gz,graphqlLanguage:()=>fB,graphqlLanguageSupport:()=>Wz,isMetaKeyPressed:()=>Jz,jump:()=>hB,lint:()=>_B,offsetToPos:()=>Uz,optionsStateField:()=>Qz,posToOffset:()=>Hz,schemaStateField:()=>Xz,showInDocsCommand:()=>oB,stateExtensions:()=>iB,updateOpts:()=>eB,updateSchema:()=>$z});function Hz(e,t){return e.line(t.line+1).from+t.character}function Uz(e,t){let n=e.lineAt(t);return new Kz(n.number-1,t-n.from)}function Wz(){return new IO(fB)}function Gz(e,t){return[Wz(),mB,_B,hB,iB(e,t)]}var Kz,qz,Jz,Yz,Xz,Zz,Qz,$z,eB,tB,nB,rB,iB,aB,oB,sB,cB,lB,uB,dB,fB,pB,mB,hB,gB,_B,vB=n((()=>{LR(),cv(),lz(),Rk(),uD(),eE(),Bz(),kh(),Kz=class{constructor(e,t){this.line=e,this.character=t}setLine(e){this.line=e}setCharacter(e){this.character=e}lessThanOrEqualTo(e){return this.line<e.line||this.line===e.line&&this.character<=e.character}},qz=()=>navigator.userAgent.includes(`Mac`),Jz=e=>qz()?e.metaKey:e.ctrlKey,Yz=G.define(),Xz=j_.define({create(){},update(e,t){for(let e of t.effects)if(e.is(Yz))return e.value;return e}}),Zz=G.define(),Qz=j_.define({create(){},update(e,t){for(let e of t.effects)if(e.is(Zz))return e.value;return e}}),$z=(e,t)=>{e.dispatch({effects:Yz.of(t)})},eB=(e,t)=>{e.dispatch({effects:Zz.of(t)})},tB=e=>e.field(Xz),nB=e=>e.field(Qz),rB={showErrorOnInvalidSchema:!0},iB=(e,t)=>[Xz.init(()=>e),Qz.init(()=>Object.assign(Object.assign({},rB),t))],aB=e=>{let t=tB(e.state);if(!t)return!0;let n=nB(e.state),r=e.state.selection.main.head,i=Uz(e.state.doc,r),a=AL(e.state.doc.toString(),i);return t&&n?.onFillAllFields&&n.onFillAllFields(e,t,e.state.doc.toString(),i,a),!0},oB=e=>{let t=tB(e.state);if(!t)return!0;let n=nB(e.state),r=e.state.selection.main.head,i=Uz(e.state.doc,r),a=AL(e.state.doc.toString(),i);if(t&&n?.onShowInDocs){let e=zL(t,a.state);n.onShowInDocs(e.fieldDef?.name,e.type?.toString(),e.parentType?.toString())}return!0},sB={__proto__:null,query:241,mutation:243,subscription:245,on:86,fragment:92,schema:102,scalar:114,type:120,implements:126,interface:140,union:146,enum:154,input:164,directive:172,repeatable:176,extend:192},cB=cz.deserialize({version:14,states:"LWOYQPOOO!WQPO'#C}O!`QPO'#C_OOQO'#C_'#C_O!iQPO'#DYOOQO'#Ev'#EvOOQO'#D_'#D_O!nQPO'#D^O#_QPO'#D^O!iQPO'#DhO!iQPO'#DrO!iQPO'#DuO!iQPO'#DyO!iQPO'#EOOOQO'#Dd'#DdO#fQPO'#ESOOQO'#D]'#D]O!vQPO'#E^OOQO'#Ea'#EaOOQO'#E]'#E]OOQO'#FT'#FTOOQO'#Eu'#EuOOQO'#Eh'#EhQYQPOOOOQO'#C`'#C`OOQO'#DZ'#DZOOQO'#D`'#D`OOQO'#Di'#DiOOQO'#Ds'#DsOOQO'#Dv'#DvOOQO'#Dz'#DzOOQO'#EP'#EPOOQO'#ET'#ETOOQO'#E_'#E_O#kQPO'#CaO$VQPO'#DQO$[QPO'#DPO$sQPO'#DPO$xQPO'#DSO%WQPO'#DOOOQO'#En'#EnO%fQPO,59iOOQO'#Ca'#CaO%qQPO'#CxOOQO'#El'#ElO'hQPO'#CwO)[QPO'#CdOOQO,58y,58yO)aQPO,58yO)fQPO,58yO)nQPO,58yOOQO'#DT'#DTO)yQPO,59tO{QPO'#FUOOQO'#Db'#DbOOQO,59x,59xO*OQPO,59xO!nQPO,59xO!iQPO,5:PO!iQPO,5:SO!iQPO,5:^O!iQPO,5:aO!iQPO,5:eO!iQPO,5:jO*TQPO,5:nOOQO'#Df'#DfO*YQPO,5:SO+aQPO,5:^O,hQPO,5:aO-oQPO,5:eO.sQPO,5:jO/wQPO,5:nO!nQPO,5:xO!iQPO,5:|O!iQPO,5:}O!iQPO,5;OO!iQPO,5;PO!iQPO,5;QO!iQPO,5;ROOQO-E8f-E8fOOQO,59l,59lO0VQPO'#CzOOQO,59k,59kO0[QPO,59kO0mQPO,59kOOQO'#DR'#DRO0tQPO,59kO1OQPO,59nO!iQPO'#DVOOQO,59p,59pO)aQPO,59pO)fQPO,59pOOQO'#DW'#DWOOQO,59j,59jOOQO-E8l-E8lOOQO1G/T1G/TOOQO,59d,59dOOQO-E8j-E8jO1aQPO'#CeOOQO'#Ei'#EiO1fQPO,59OOOQO1G.e1G.eO)aQPO1G.eO)fQPO1G.eO)fQPO1G/`O1nQPO'#DcO1sQPO,5;pOOQO1G/d1G/dO*OQPO1G/dO1xQPO1G/kO4QQPO1G/nO5]QPO1G/xO6hQPO1G/{O7pQPO1G0PO8xQPO1G0UO/wQPO1G0YO9PQPO1G/nO9WQPO'#DkO9`QPO'#FWOOQO'#Dn'#DnOOQO1G/n1G/nO9hQPO1G/nOOQO'#Dl'#DlO:iQPO1G/xOOQO1G/x1G/xO:pQPO1G/xO;qQPO1G/{O;xQPO'#DxO5dQPO1G/{O<QQQO'#FYOOQO'#D|'#D|OOQO1G0P1G0PO6oQPO1G0PO9`QPO'#FZOOQO'#ER'#EROOQO1G0U1G0UO7wQPO1G0UO<YQPO'#DqO!iQPO'#DqOOQO'#Ep'#EpO<_QPO'#DpO<pQSO1G0YO)yQPO1G0YO>QQPO1G0YOOQO'#EV'#EVOOQO1G0d1G0dO>YQPO1G0dO!qQPO1G0hO?ZQPO1G0iO?ZQPO1G0jO?fQPO1G0kO?nQPO1G0lO?vQPO1G0mOOQO'#C|'#C|O@OQPO'#C{OOQO'#Em'#EmO@TQPO,59fOOQO1G/V1G/VO@]QPO1G/VO@nQPO1G/VOOQO1G/Y1G/YOOQO'#Cg'#CgOOQO,59q,59qOOQO1G/[1G/[O)aQPO1G/[O@uQPO,59POOQO-E8g-E8gOOQO1G.j1G.jOOQO7+$P7+$PO)aQPO7+$POOQO7+$z7+$zO)aQPO7+$zO!iQPO,59}OOQO1G1[1G1[OOQO7+%O7+%OOOQO7+%V7+%VOBOQPO7+%YOOQO7+%Y7+%YO@}QPO7+%YOCZQPO7+%dOOQO7+%d7+%dOBYQPO7+%dODfQPO7+%gODmQPO7+%gOOQO7+%k7+%kODtQPO7+%kOOQO7+%p7+%pOEuQPO7+%pO<pQSO7+%tO)yQPO7+%tO>QQPO7+%tO!iQPO,5:VOOQO,5:V,5:VOFvQPO'#DoO!iQPO'#DoOOQO'#Eo'#EoOGRQPO,5;rO!iQPO,5:dOOQO,5:d,5:dOG^QQO'#D}OGlQQO'#D}OOQO'#Eq'#EqOGqQQO,5;tOG|QPO,5;uO@uQPO,5:]OHXQPO,5:]OOQO-E8n-E8nOOQO'#EZ'#EZOOQO'#E['#E[OOQO'#EY'#EYOH^QPO7+%tOOQO'#EX'#EXO<sQSO'#EXOOQO7+&O7+&OOOQO7+&S7+&SOJcQPO7+&TOOQO7+&T7+&TOIbQPO7+&TOKnQPO7+&UOOQO7+&U7+&UOJmQPO7+&UOLyQPO7+&VOMQQPO7+&VOOQO7+&W7+&WOMXQPO7+&WOOQO7+&X7+&XONYQPO7+&XO! ZQQO,59gOOQO-E8k-E8kOOQO1G/Q1G/QOOQO7+$q7+$qO! xQPO7+$qOOQO7+$v7+$vO@uQPO'#CjO!!ZQPO'#E|OOQO'#E|'#E|O!#UQPO1G.kOOQO<<Gk<<GkOOQO<<Hf<<HfOOQO1G/i1G/iOOQO<<Ht<<HtO!#gQPO<<HtOOQO<<IO<<IOO!$hQPO<<IOO!%iQPO<<IROOQO<<IV<<IVOOQO<<I[<<I[O!&mQPO<<I`O<pQSO<<I`O)yQPO<<I`OOQO1G/q1G/qO@uQPO,5:ZO!'qQPO,5:ZO!'vQPO,5:ZOOQO-E8m-E8mOOQO1G1^1G1^OOQO1G0O1G0OO!(RQQO'#CxO!(dQQO'#CwOOQO,5:i,5:iO!(rQQO,5:iOOQO-E8o-E8oOOQO1G1`1G1`OOQO1G1a1G1aO!)QQPO1G/wO@uQPO1G/wO<sQSO,5:sOOQO,5:s,5:sOOQO<<Io<<IoO!)lQPO<<IoOOQO<<Ip<<IpO!*mQPO<<IpO!+nQPO<<IqOOQO<<Ir<<IrOOQO<<Is<<IsO!,rQQO'#CsO!,yQPO'#CvOOQO'#FP'#FPO!-RQPO1G/ROOQO<<H]<<H]O!-^QPO,59UOOQO,59V,59VO! ZQQO'#ClOOQO7+$V7+$VO!-cQPO7+$VO!-nQPO7+$VOOQOAN>`AN>`OOQOAN>jAN>jO!-|QPOAN>zO<pQSOAN>zO!/QQPO1G/uO@uQPO1G/uO!/`QPO1G/uOOQO1G0T1G0TOOQO7+%c7+%cO!/eQPO7+%cO!/|QPO7+%cOOQO1G0_1G0_OOQOAN?ZAN?ZOOQOAN?[AN?[O!0TQQO'#EjO!0xQQO,59_OOQO,59_,59_O!1PQPO'#FROOQO'#Ek'#EkO!1UQPO,59bOOQO,59b,59bOOQO7+$m7+$mOOQO1G.p1G.pOOQO,59W,59WOOQO<<Gq<<GqO!1^QPO<<GqO!1iQPOG24fOOQO7+%a7+%aO!2mQPO7+%aO@uQPO7+%aOOQO<<H}<<H}O!2{QPO<<H}OOQO,5;U,5;UOOQO-E8h-E8hOOQO1G.y1G.yO! ZQQO,5;mOOQO-E8i-E8iOOQO1G.|1G.|OOQOAN=]AN=]OOQO<<H{<<H{O!3dQPO<<H{OOQOAN>iAN>iO!3rQPO1G1XOOQOAN>gAN>gOOQO7+&s7+&s",stateData:"!4S~O#hOSPOS~OcUOiPO!OiO!TjO!^kO!hlO!kmO!onO!toO!xpO#SqO#lhO#mhO#nhO~O#krO#vvO~OV!OOiPOm{O#kzO~Oi!VOm{O~O!TjO!Z!cO!^kO!hlO!kmO!onO!toO~O!xpO~P!vOm!iO~OVuXhuXiuXmuX#kuX#oTX#tuX#vuX~O#o!rO~OV!sOiPOm{OhsX#ksX#tsX#vsX~O#k!wO~OiPOm{O{#OO#kzO~O#t#POhrX#krX#vrX~Oh#RO#krO#vvO~OV!sOilXmlXhlX#klX#tlX#vlXclX!OlX!TlX!^lX!hlX!klX!olX!tlX!xlX#SlX#flX#llX#mlX#nlX#rlXUlXYlX{lX!zlX#olX~Om{OikXhkX#kkX#tkX#vkXckX!OkX!TkX!^kX!hkX!kkX!okX!tkX!xkX#SkX#fkX#lkX#mkX#nkX#rkXUkXYkX{kX!zkX#okX~OY#UO~OiPO~OiPOm{O~OV!OOiPOm{O~O{#OO~Oi!VO~Om#gO~Oi#jOm{O!a#nOc![a!O![a!T![a!^![a!h![a!k![a!o![a!t![a!x![a#S![a#f![a#l![a#m![a#n![a~Oi#jOm{O!a#nOc!fa!O!fa!T!fa!^!fa!h!fa!k!fa!o!fa!t!fa!x!fa#S!fa#f!fa#l!fa#m!fa#n!fa~Om{O#r#sOc!iai!ia!O!ia!T!ia!^!ia!h!ia!k!ia!o!ia!t!ia!x!ia#S!ia#f!ia#l!ia#m!ia#n!ia~Oi#uOm{Oc!ma!O!ma!T!ma!^!ma!h!ma!k!ma!o!ma!t!ma!x!ma#S!ma#f!ma#l!ma#m!ma#n!ma~Oi#yOm{Oc!ra!O!ra!T!ra!^!ra!h!ra!k!ra!o!ra!t!ra!x!ra#S!ra#f!ra#l!ra#m!ra#n!ra~OcUO{#OO!z$UO#kzO~O#k$_O~OiPOhsa#ksa#tsa#vsa~Om{O~P0[OV!sOm{O~P0[Om{Ohva#kva#tva#vva~O#o$kO~OU$mOY#UO~O#o$rO~Oh$sO~Om{Oc!Xii!Xi!O!Xi!T!Xi!^!Xi!h!Xi!k!Xi!o!Xi!t!Xi!x!Xi#S!Xi#f!Xi#l!Xi#m!Xi#n!Xi~Oi#jOm{Oc![i!O![i!T![i!^![i!h![i!k![i!o![i!t![i!x![i#S![i#f![i#l![i#m![i#n![i~O!a#nO~P2|Oi#jOm{Oc!fi!O!fi!T!fi!^!fi!h!fi!k!fi!o!fi!t!fi!x!fi#S!fi#f!fi#l!fi#m!fi#n!fi~O!a#nO~P4XO#r#sOc!iii!ii!O!ii!T!ii!^!ii!h!ii!k!ii!o!ii!t!ii!x!ii#S!ii#f!ii#l!ii#m!ii#n!ii~Om{O~P5dOi#uOc!mi!O!mi!T!mi!^!mi!h!mi!k!mi!o!mi!t!mi!x!mi#S!mi#f!mi#l!mi#m!mi#n!mi~Om{O~P6oOi#yOc!ri!O!ri!T!ri!^!ri!h!ri!k!ri!o!ri!t!ri!x!ri#S!ri#f!ri#l!ri#m!ri#n!ri~Om{O~P7wO#y%VO~P2|O#kzO#y%VO~OcUO#kzO~Oi#jOc![i!O![i!T![i!^![i!h![i!k![i!o![i!t![i!x![i#S![i#f![i#l![i#m![i#n![i~O#y%VO~P4XOi#jOc!fi!O!fi!T!fi!^!fi!h!fi!k!fi!o!fi!t!fi!x!fi#S!fi#f!fi#l!fi#m!fi#n!fi~O#{%]O~P5gO#kzO#{%]O~OcUOf%_O~O#o%dO~OcUO#kzO{!dX!z!dX#o!dX~O#{%lO$O%gO$P%gO$Q%gO$R%gO$S%gO$T%gO$U%gO$V%gO$W%hO$X%hO$Y%hO$Z%hO$[%hO$]%hO$^%hO$_%hO$`%hO$a%hO$b%hO~O{#OO!z$UO~Oi!VOc#Qi!O#Qi!T#Qi!^#Qi!h#Qi!k#Qi!o#Qi!t#Qi!x#Qi#S#Qi#f#Qi#l#Qi#m#Qi#n#Qi~Oi#jOm{O!a#nO~Om{O#r#sO~Oi#uOm{O~Oi#yOm{O~O#o%{O~OU%}O#k$_O~OiPOhsi#ksi#tsi#vsi~Om{O~P@]O]&RO#kzO~Oi#jOc![q!O![q!T![q!^![q!h![q!k![q!o![q!t![q!x![q#S![q#f![q#l![q#m![q#n![q~Om{O#y%VO~P@}Oi#jOc!fq!O!fq!T!fq!^!fq!h!fq!k!fq!o!fq!t!fq!x!fq#S!fq#f!fq#l!fq#m!fq#n!fq~Om{O#y%VO~PBYOc!iqi!iq!O!iq!T!iq!^!iq!h!iq!k!iq!o!iq!t!iq!x!iq#S!iq#f!iq#l!iq#m!iq#n!iq~O#{%]O~PCeO#r#sO~PCeOi#uOc!mq!O!mq!T!mq!^!mq!h!mq!k!mq!o!mq!t!mq!x!mq#S!mq#f!mq#l!mq#m!mq#n!mq~Oi#yOc!rq!O!rq!T!rq!^!rq!h!rq!k!rq!o!rq!t!rq!x!rq#S!rq#f!rq#l!rq#m!rq#n!rq~OcUO#kzO#o&eO~OcUOh&iO#kzO~Om&kOc!qXf!qXh!qX~Of&nO~OcUOf%_Oh&pO~OcUOh&qO#kzO~O#o&sO~O#{&tOc!vqi!vq!O!vq!T!vq!^!vq!h!vq!k!vq!o!vq!t!vq!x!vq#S!vq#f!vq#l!vq#m!vq#n!vq~Oi#jOc#Vq!O#Vq!T#Vq!^#Vq!h#Vq!k#Vq!o#Vq!t#Vq!x#Vq#S#Vq#f#Vq#l#Vq#m#Vq#n#Vq~Om{O#y%VO~PIbOi#jOc#Wq!O#Wq!T#Wq!^#Wq!h#Wq!k#Wq!o#Wq!t#Wq!x#Wq#S#Wq#f#Wq#l#Wq#m#Wq#n#Wq~Om{O#y%VO~PJmOc#Xqi#Xq!O#Xq!T#Xq!^#Xq!h#Xq!k#Xq!o#Xq!t#Xq!x#Xq#S#Xq#f#Xq#l#Xq#m#Xq#n#Xq~O#{%]O~PKxO#r#sO~PKxOi#uOc#Yq!O#Yq!T#Yq!^#Yq!h#Yq!k#Yq!o#Yq!t#Yq!x#Yq#S#Yq#f#Yq#l#Yq#m#Yq#n#Yq~Oi#yOc#Zq!O#Zq!T#Zq!^#Zq!h#Zq!k#Zq!o#Zq!t#Zq!x#Zq#S#Zq#f#Zq#l#Zq#m#Zq#n#Zq~OY'PO]&}Oa'POb'POc'POd'POe'POf'POi'OO~OiPOhsq#ksq#tsq#vsq~O#q'TOU#pXY#pXm#pX#r#pX#t#pXc#pX{#pX!z#pX#k#pX[#pXh#pX#o#pX~Om{O#r'UO#t'VOUXiYXi~Oi#jOc![y!O![y!T![y!^![y!h![y!k![y!o![y!t![y!x![y#S![y#f![y#l![y#m![y#n![y~Oi#jOc!fy!O!fy!T!fy!^!fy!h!fy!k!fy!o!fy!t!fy!x!fy#S!fy#f!fy#l!fy#m!fy#n!fy~O#{%]Oc!iyi!iy!O!iy!T!iy!^!iy!h!iy!k!iy!o!iy!t!iy!x!iy#S!iy#f!iy#l!iy#m!iy#n!iy~O#{&tOc!vyi!vy!O!vy!T!vy!^!vy!h!vy!k!vy!o!vy!t!vy!x!vy#S!vy#f!vy#l!vy#m!vy#n!vy~O#o'_O~OcUO#kzO#o'_O~OV!sOclXflXhlXmlX~Om&kOckXfkXhkX~Om&kOc!qaf!qah!qa~Om{O#r'UOc!ei{!ei!z!ei#k!eih!ei#o!ei~Oi#jOc#Vy!O#Vy!T#Vy!^#Vy!h#Vy!k#Vy!o#Vy!t#Vy!x#Vy#S#Vy#f#Vy#l#Vy#m#Vy#n#Vy~Oi#jOc#Wy!O#Wy!T#Wy!^#Wy!h#Wy!k#Wy!o#Wy!t#Wy!x#Wy#S#Wy#f#Wy#l#Wy#m#Wy#n#Wy~O#{%]Oc#Xyi#Xy!O#Xy!T#Xy!^#Xy!h#Xy!k#Xy!o#Xy!t#Xy!x#Xy#S#Xy#f#Xy#l#Xy#m#Xy#n#Xy~O['jO~P! ZOh'nO#kzO~O#t'oOUoi#koi~O['pO~O#t'rOUXqYXq~Om{O#t'rOUXqYXq~O#{&tOc!v!Ri!v!R!O!v!R!T!v!R!^!v!R!h!v!R!k!v!R!o!v!R!t!v!R!x!v!R#S!v!R#f!v!R#l!v!R#m!v!R#n!v!R~Om{Oc!cih!ci#k!ci~O#o'wO~Om{Oc!eq{!eq!z!eq#k!eqh!eq#o!eq~O#r'UO~P!/eO#t'zOY#^X[#^X]#^Xa#^Xb#^Xc#^Xd#^Xe#^Xf#^Xi#^X~O['|O~P! ZO#o'}O~Oh(PO#kzO~O#t(QOUXyYXy~O#{&tOc!v!Zi!v!Z!O!v!Z!T!v!Z!^!v!Z!h!v!Z!k!v!Z!o!v!Z!t!v!Z!x!v!Z#S!v!Z#f!v!Z#l!v!Z#m!v!Z#n!v!Z~Om{Oc!cqh!cq#k!cq~Om{Oc!ey{!ey!z!ey#k!eyh!ey#o!ey~Om{Oc!cyh!cy#k!cy~O#t(WOh#ui#k#ui~Odefe~",goto:":k$OPPP$P$T$[PP&d&jP&nPP'Z'd'mPPPPPP'vPP'v'}*|P,T,_,c,g-k-o-s-w-o.O-o.U.[P$P.oP.s.w.{/bP/l/|.w0P0TP0P0ZP0e0wP1P2T2X2e0P2nP0P2xP3S0P3dP3n4O0P4SP4^.w4nP4uP5P5]5i5i.s5q5uP5q5y5y5y5y5y5y5}6T6Z6a6g7r7x8O8U8cPPP8i8mPPPPP8qPP9WP9eP8m9iP9qP:Z:cTTOgSQOgR#]!VSsPyQ!SQS!TSvQ!dXQ!eYQ!fZQ!g[Q!h]Q#a![Q#b!]Q#c!^Q#d!_Q#e!`Q#f!a^#}!i#g#y$Q%X%c&gQ$X!kQ$Y!lQ$Z!mQ$[!nQ$]!oQ$^!pj$g!z#i#s$k$r%V%]%d&R&e&s'_'wS%X#j%[Q%e$OQ&g%YT'k'O'mQ!RQR#Z!ST#V!O#WQ$h!zQ%W#iQ%^#s^&S$k%d&R&e&s'_'wQ&X$rQ&d%VR&j%]_&S$k%d&R&e&s'_'w_&T$k%d&R&e&s'_'wQ'X&UQ'c&rR'y'dZ'P%{&}'U'i'}Q!QQQ!YVQ!utQ!|vS#Y!R!SQ#`!ZQ#m!dQ#q!eQ#t!fQ#x!gQ#|!hQ$W!jS$d!v!xQ$f!yQ$j!}Q$o#ZQ$q#[Q$u#aS$x#b#hS${#c#oQ$}#dQ%P#eQ%R#fQ%n$XQ%q$YQ%t$ZQ%v$[Q%x$]Q%z$^Q&P$eQ&Z$vQ&]$yQ&m%_Q&w%oQ&y%rQ'W&UQ'a&nQ'b&rQ's'XQ'u'^S'x'c'dQ(R'vQ(T'yR(V(S#Z|QVtv}!R!S!Z!d!e!f!g!h!j!v!x!y!}#Z#[#a#b#c#d#e#f#h#o$X$Y$Z$[$]$^$e$v$y%_%o%r&U&l&n&r'X'^'c'd'v'y(SQ!vtS#S{&kR$e!xT$a!s$bT$`!s$bSROgQ!PQQ!ttQ!{vU#X!Q!R!SU$c!u!v!xS$i!|!}S$n#Y#ZQ$p#[S&O$d$eQ&Q$jQ&V$oQ&W$qR'R&PTxPyTwPyTuPyStPyR!xuQ!USR!yvQ!}vR#[!US!zv!UQ$R!iU%S#g$S$TS&b%T%UR']&cTSOgTdOgT`OgSWOg^$O!i#g#y$Q%X%c&gS%Y#j%[T%`#u%bSVOgQ!ZWR!jaQ!XVS#_!Y!ZQ$V!jQ$t#`R%m$WR#^!VT^OgQ![WR!kaSXOgQ!]WR!laQ#h!dQ#o!eQ$v#bQ$y#cQ%o$YR%r$Z]#i!d!e#b#c$Y$ZQ#l!dQ#p!eU$w#b#h#mU$z#c#o#qQ%p$YQ%s$ZS&Y$v$xS&[$y${S&v%o%qS&x%r%tQ'Y&ZQ'Z&]Q'f&wR'g&yT%Z#j%[Q$T!iQ%U#gQ&f%XR'`&g_$P!i#g#y$Q%X%c&gSYOgQ!^WR!maSZOgQ!_WR!naQ#r!fS$|#d#tQ%u$[Q&^$}R&z%vS[OgQ!`WR!oaQ#w!gS%O#e#xQ%w$]Q&_%PR&{%xT%a#u%bS]OgQ!aWR!paQ#{!hS%Q#f#|Q%y$^Q&`%RR&|%zS_OgR!bWQ$S!iS%T#g$TR&c%UQ%j$RQ&a%SQ'[&bR't']W%k$R%S&b']Q&u%lR'e&t]%i$R%S%l&b&t']TcOgTaOgTbOgQgOR!qgQ#W!OR$l#WQ'i&}R'{'iQ'm'OR(O'm#Q}QVtv!R!S!Z!d!e!f!g!h!j!v!x!y!}#Z#[#a#b#c#d#e#f#h#o$X$Y$Z$[$]$^$e$v$y%o%r&U&r'X'^'c'd'v'y(SS#T}&lT&l%_&nQ$b!sR%|$bQyPR#QyQ%[#jR&h%[W$Q!i#g%X&gQ%c#yT%f$Q%cQ%b#uR&o%bTfOgTeOgQ&U$kQ&r%dQ'S&RQ'^&eQ'd&sQ'v'_R(S'wQ'Q%{S'h&}'iQ'q'UR(U'}T'l'O'm]!WV!Y!Z!j#`$W}#k!d!e#b#c#h#m#o#q$Y$Z$v$x$y${%o%q%r%t&Z&]&w&y]#v!g#e#x$]%P%x]#z!h#f#|$^%R%z",nodeNames:`⚠ Comment Document OperationDefinition OperationType Name ) ( VariableDefinitions VariableDefinition Variable NamedType ] [ ListType NonNullType DefaultValue IntValue FloatValue StringValue BooleanValue NullValue EnumValue ListValue } { ObjectValue Directives Directive DirectiveName Arguments Argument ArgumentAttributeName SelectionSet Selection Field Alias FieldName FragmentSpread FragmentName InlineFragment TypeCondition OnKeyword on FragmentDefinition FragmentKeyword fragment TypeSystemDefinition SchemaDefinition Description SchemaKeyword schema RootTypeDefinition RootOperationTypeDefinition TypeDefinition ScalarTypeDefinition ScalarKeyword scalar ObjectTypeDefinition TypeKeyword type ImplementsInterfaces ImplementsKeyword implements FieldsDefinition FieldDefinition ArgumentsDefinition InputValueDefinition InterfaceTypeDefinition InterfaceKeyword interface UnionTypeDefinition UnionKeyword union UnionMemberTypes EnumTypeDefinition EnumKeyword enum EnumValuesDefinition EnumValueDefinition InputObjectTypeDefinition InputKeyword input InputFieldsDefinition DirectiveDefinition DirectiveKeyword directive RepeatableKeyword repeatable DirectiveLocations DirectiveLocation ExecutableDirectiveLocation TypeSystemDirectiveLocation TypeSystemExtension SchemaExtension ExtendKeyword extend TypeExtension ScalarTypeExtension ObjectTypeExtension InterfaceTypeExtension UnionTypeExtension EnumTypeExtension InputObjectTypeExtension`,maxTerm:156,nodeProps:[[`openedBy`,6,`(`,12,`[`,24,`{`],[`closedBy`,7,`)`,13,`]`,25,`}`]],skippedNodes:[0,1],repeatNodeCount:10,tokenData:"#Ci~R!XX^$npq$nqr%crs%hst4ptu4{vw5jxy5oyz5t|}5y}!O6O!O!P7g!Q![6U![!]7x!_!`7}!b!c8S!c!d8q!d!g9[!g!hCZ!h!iHd!i!k9[!k!l!/v!l!o9[!o!p!Id!p!q9[!q!r!Mm!r!s9[!s!t#!u!t!u9[!u!v#%d!v!w9[!w!x#0n!x!y#3]!y!}9[!}#O#=[#P#Q#=a#R#S9[#T#Y9[#Y#Z#=f#Z#b9[#b#c#@Q#c#h9[#h#i#BU#i#o9[#o#p#CY#p#q#C_#q#r#Cd#y#z$n$f$g$n#BY#BZ$n$IS$I_$n$I|$JO$n$JT$JU$n$KV$KW$n&FU&FV$n~$sY#h~X^$npq$n#y#z$n$f$g$n#BY#BZ$n$IS$I_$n$I|$JO$n$JT$JU$n$KV$KW$n&FU&FV$n~%hO#q~~%kVOY&QZ]&Q^r&Qrs(as#O&Q#O#P&o#P~&Q~&TVOY&QZ]&Q^r&Qrs&js#O&Q#O#P&o#P~&Q~&oOc~~&rXrs&Q!P!Q&Q#O#P&Q#U#V&Q#Y#Z&Q#b#c&Q#f#g&Q#h#i&Q#i#j'_~'bR!QX^r(irs)_s#O(i#O#P)w#P~(i~)[PYZ(i~)bROr(irs)ks~(i~)nROr(irs&js~(i~)zXrs*g!P!Q(i#O#P(i#U#V(i#Y#Z(i#b#c(i#f#g(i#h#i(i#i#j3n~*jXOY(iYZ(iZ](i]^)X^r(irs+Vs#O(i#O#P)w#P~(i~+YROr(irs+cs~(i~+fXOY(iYZ(iZ](i]^(i^r(irs,Rs#O(i#O#P,a#P~(i~,WRc~Or(irs)ks~(i~,dfOY(iYZ(iZ](i]^)X^r(irs-xs!P(i!P!Q(i!Q#O(i#O#P,a#P#U(i#U#V(i#V#Y(i#Y#Z(i#Z#b(i#b#c(i#c#f(i#f#g(i#g#h(i#h#i(i#i#j/f#j~(i~-{XOY(iYZ(iZ](i]^(i^r(irs.hs#O(i#O#P,a#P~(i~.kROr(irs.ts~(i~.yXc~OY(iYZ(iZ](i]^(i^r(irs,Rs#O(i#O#P,a#P~(i~/i_OY(iYZ(iZ](i]^)X^r(irs)_s!Q(i!QX^r(irs)_s!Q(i!QX^r(irs)_s!Q(i!QX^r(irs)_s!Q(i!Q![(i![!c(i!c!i(i!i#O(i#O#P)w#P#T(i#T#Z(i#Z~(i~3qR!Q![3z!c!i3z#T#Z3z~3}R!Q![4W!c!i4W#T#Z4W~4ZR!Q![4d!c!i4d#T#Z4d~4gR!Q![(i!c!i(i#T#Z(i~4uQP~OY4pZ~4p~5OR!c!}5X#R#S5X#T#o5X~5^SY~!Q![5X!c!}5X#R#S5X#T#o5X~5oO#y~~5tOV~~5yOU~~6OO#t~~6RP!Q![6U~6ZSa~!O!P6g!Q![6U!g!h6{#X#Y6{~6jP!Q![6m~6rRb~!Q![6m!g!h6{#X#Y6{~7OR{|7X}!O7X!Q![7_~7[P!Q![7_~7dPb~!Q![7_~7jP!O!P7m~7pP!O!P7s~7xO#v~~7}O#o~~8SO#r~~8VR!c!}8`#R#S8`#T#o8`~8eSm~!Q![8`!c!}8`#R#S8`#T#o8`V8xU#kPfQ!Q![9[!c!t9[!t!u9o!u!}9[#R#S9[#T#o9[R9cS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V9vU#kPfQ!Q![9[!c!i9[!i!j:Y!j!}9[#R#S9[#T#o9[V:aU#kPfQ!Q![9[!c!w9[!w!x:s!x!}9[#R#S9[#T#o9[V:zU#kPfQ!Q![9[!c!o9[!o!p;^!p!}9[#R#S9[#T#o9[V;eU#kPfQ!Q![9[!c!g9[!g!h;w!h!}9[#R#S9[#T#o9[V<OU#kPfQ!Q![9[!c!p9[!p!q<b!q!}9[#R#S9[#T#o9[V<iU#kPfQ!Q![9[!c!v9[!v!w<{!w!}9[#R#S9[#T#o9[V=SS#kPfQ!Q![9[!c!}9[#R#S=`#T#o9[V=gU#kPfQ!Q![9[!c!f9[!f!g=y!g!}9[#R#S9[#T#o9[V>QU#kPfQ!Q![9[!c!g9[!g!h>d!h!}9[#R#S9[#T#o9[V>kU#kPfQ!Q![9[!c!h9[!h!i>}!i!}9[#R#S9[#T#o9[V?UU#kPfQ!Q![9[!c!k9[!k!l?h!l!}9[#R#S9[#T#o9[V?oU#kPfQ!Q![9[!c!p9[!p!q@R!q!}9[#R#S9[#T#o9[V@YU#kPfQ!Q![9[!c!k9[!k!l@l!l!}9[#R#S9[#T#o9[V@sU#kPfQ!Q![9[!c!v9[!v!wAV!w!}9[#R#S9[#T#o9[VA^U#kPfQ!Q![9[!c!k9[!k!lAp!l!}9[#R#S9[#T#o9[VAwU#kPfQ!Q![9[!c!q9[!q!rBZ!r!}9[#R#S9[#T#o9[VBbU#kPfQ!Q![9[!c!p9[!p!qBt!q!}9[#R#S9[#T#o9[VB}S$[S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[VCbU#kPfQ!Q![9[!c!p9[!p!qCt!q!}9[#R#S9[#T#o9[VC{U#kPfQ!Q![9[!c!w9[!w!xD_!x!}9[#R#S9[#T#o9[VDfU#kPfQ!Q![9[!c!o9[!o!pDx!p!}9[#R#S9[#T#o9[VERS$_S#kPfQ!Q![9[!c!}9[#R#SE_#T#o9[VEfU#kPfQ!Q![9[!c!x9[!x!yEx!y!}9[#R#S9[#T#o9[VFPT#kPfQ!Q![9[!c!dF`!d!}9[#R#S9[#T#o9[VFgU#kPfQ!Q![9[!c!n9[!n!oFy!o!}9[#R#S9[#T#o9[VGQU#kPfQ!Q![9[!c!w9[!w!xGd!x!}9[#R#S9[#T#o9[VGkU#kPfQ!Q![9[!c!g9[!g!hG}!h!}9[#R#S9[#T#o9[VHWS$`S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[VHkW#kPfQ!Q![9[!c!k9[!k!lIT!l!t9[!t!u!#S!u!}9[#R#S9[#T#o9[VI[U#kPfQ!Q![9[!c!g9[!g!hIn!h!}9[#R#S9[#T#o9[VIuU#kPfQ!Q![9[!c!n9[!n!oJX!o!}9[#R#S9[#T#o9[VJ`U#kPfQ!Q![9[!c!f9[!f!gJr!g!}9[#R#S9[#T#o9[VJ{S$RS#kPfQ!Q![9[!c!}9[#R#SKX#T#o9[VK`U#kPfQ!Q![9[!c!f9[!f!gKr!g!}9[#R#S9[#T#o9[VKyU#kPfQ!Q![9[!c!g9[!g!hL]!h!}9[#R#S9[#T#o9[VLdU#kPfQ!Q![9[!c!h9[!h!iLv!i!}9[#R#S9[#T#o9[VL}U#kPfQ!Q![9[!c!k9[!k!lMa!l!}9[#R#S9[#T#o9[VMhU#kPfQ!Q![9[!c!p9[!p!qMz!q!}9[#R#S9[#T#o9[VNRU#kPfQ!Q![9[!c!k9[!k!lNe!l!}9[#R#S9[#T#o9[VNlU#kPfQ!Q![9[!c!v9[!v!w! O!w!}9[#R#S9[#T#o9[V! VU#kPfQ!Q![9[!c!k9[!k!l! i!l!}9[#R#S9[#T#o9[V! pU#kPfQ!Q![9[!c!q9[!q!r!!S!r!}9[#R#S9[#T#o9[V!!ZU#kPfQ!Q![9[!c!p9[!p!q!!m!q!}9[#R#S9[#T#o9[V!!vS$ZS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!#ZT#kPfQ!Q![9[!c!d!#j!d!}9[#R#S9[#T#o9[V!#qU#kPfQ!Q![9[!c!i9[!i!j!$T!j!}9[#R#S9[#T#o9[V!$[U#kPfQ!Q![9[!c!o9[!o!p!$n!p!}9[#R#S9[#T#o9[V!$uU#kPfQ!Q![9[!c!g9[!g!h!%X!h!}9[#R#S9[#T#o9[V!%`U#kPfQ!Q![9[!c!p9[!p!q!%r!q!}9[#R#S9[#T#o9[V!%yU#kPfQ!Q![9[!c!v9[!v!w!&]!w!}9[#R#S9[#T#o9[V!&dS#kPfQ!Q![9[!c!}9[#R#S!&p#T#o9[V!&wW#kPfQ!Q![9[!c!f9[!f!g!'a!g!u9[!u!v!,q!v!}9[#R#S9[#T#o9[V!'hU#kPfQ!Q![9[!c!g9[!g!h!'z!h!}9[#R#S9[#T#o9[V!(RU#kPfQ!Q![9[!c!h9[!h!i!(e!i!}9[#R#S9[#T#o9[V!(lU#kPfQ!Q![9[!c!k9[!k!l!)O!l!}9[#R#S9[#T#o9[V!)VU#kPfQ!Q![9[!c!p9[!p!q!)i!q!}9[#R#S9[#T#o9[V!)pU#kPfQ!Q![9[!c!k9[!k!l!*S!l!}9[#R#S9[#T#o9[V!*ZU#kPfQ!Q![9[!c!v9[!v!w!*m!w!}9[#R#S9[#T#o9[V!*tU#kPfQ!Q![9[!c!k9[!k!l!+W!l!}9[#R#S9[#T#o9[V!+_U#kPfQ!Q![9[!c!q9[!q!r!+q!r!}9[#R#S9[#T#o9[V!+xU#kPfQ!Q![9[!c!p9[!p!q!,[!q!}9[#R#S9[#T#o9[V!,eS$SS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!,xU#kPfQ!Q![9[!c!r9[!r!s!-[!s!}9[#R#S9[#T#o9[V!-cU#kPfQ!Q![9[!c!t9[!t!u!-u!u!}9[#R#S9[#T#o9[V!-|U#kPfQ!Q![9[!c!g9[!g!h!.`!h!}9[#R#S9[#T#o9[V!.gT#kPfQ!Q![9[!c!d!.v!d!}9[#R#S9[#T#o9[V!.}U#kPfQ!Q![9[!c!f9[!f!g!/a!g!}9[#R#S9[#T#o9[V!/jS$TS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!/}U#kPfQ!Q![9[!c!p9[!p!q!0a!q!}9[#R#S9[#T#o9[V!0hY#kPfQ!Q![9[!c!n9[!n!o!1W!o!r9[!r!s!7|!s!v9[!v!w!Et!w!}9[#R#S9[#T#o9[V!1_U#kPfQ!Q![9[!c!k9[!k!l!1q!l!}9[#R#S9[#T#o9[V!1xU#kPfQ!Q![9[!c!p9[!p!q!2[!q!}9[#R#S9[#T#o9[V!2cU#kPfQ!Q![9[!c!g9[!g!h!2u!h!}9[#R#S9[#T#o9[V!2|S#kPfQ!Q![9[!c!}9[#R#S!3Y#T#o9[V!3aU#kPfQ!Q![9[!c!h9[!h!i!3s!i!}9[#R#S9[#T#o9[V!3zU#kPfQ!Q![9[!c!t9[!t!u!4^!u!}9[#R#S9[#T#o9[V!4eT#kPfQ!Q![9[!c!d!4t!d!}9[#R#S9[#T#o9[V!4{U#kPfQ!Q![9[!c!i9[!i!j!5_!j!}9[#R#S9[#T#o9[V!5fU#kPfQ!Q![9[!c!o9[!o!p!5x!p!}9[#R#S9[#T#o9[V!6PU#kPfQ!Q![9[!c!g9[!g!h!6c!h!}9[#R#S9[#T#o9[V!6jU#kPfQ!Q![9[!c!p9[!p!q!6|!q!}9[#R#S9[#T#o9[V!7TU#kPfQ!Q![9[!c!v9[!v!w!7g!w!}9[#R#S9[#T#o9[V!7pS$US#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!8TU#kPfQ!Q![9[!c!w9[!w!x!8g!x!}9[#R#S9[#T#o9[V!8nU#kPfQ!Q![9[!c!v9[!v!w!9Q!w!}9[#R#S9[#T#o9[V!9XS#kPfQ!Q![9[!c!}9[#R#S!9e#T#o9[V!9lW#kPfQ!Q![9[!c!h9[!h!i!:U!i!q9[!q!r!Bl!r!}9[#R#S9[#T#o9[V!:]U#kPfQ!Q![9[!c!k9[!k!l!:o!l!}9[#R#S9[#T#o9[V!:vU#kPfQ!Q![9[!c!g9[!g!h!;Y!h!}9[#R#S9[#T#o9[V!;aU#kPfQ!Q![9[!c!n9[!n!o!;s!o!}9[#R#S9[#T#o9[V!;zU#kPfQ!Q![9[!c!f9[!f!g!<^!g!}9[#R#S9[#T#o9[V!<eS#kPfQ!Q![9[!c!}9[#R#S!<q#T#o9[V!<xU#kPfQ!Q![9[!c!f9[!f!g!=[!g!}9[#R#S9[#T#o9[V!=cU#kPfQ!Q![9[!c!g9[!g!h!=u!h!}9[#R#S9[#T#o9[V!=|U#kPfQ!Q![9[!c!h9[!h!i!>`!i!}9[#R#S9[#T#o9[V!>gU#kPfQ!Q![9[!c!k9[!k!l!>y!l!}9[#R#S9[#T#o9[V!?QU#kPfQ!Q![9[!c!p9[!p!q!?d!q!}9[#R#S9[#T#o9[V!?kU#kPfQ!Q![9[!c!k9[!k!l!?}!l!}9[#R#S9[#T#o9[V!@UU#kPfQ!Q![9[!c!v9[!v!w!@h!w!}9[#R#S9[#T#o9[V!@oU#kPfQ!Q![9[!c!k9[!k!l!AR!l!}9[#R#S9[#T#o9[V!AYU#kPfQ!Q![9[!c!q9[!q!r!Al!r!}9[#R#S9[#T#o9[V!AsU#kPfQ!Q![9[!c!p9[!p!q!BV!q!}9[#R#S9[#T#o9[V!B`S$bS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!BsU#kPfQ!Q![9[!c!d9[!d!e!CV!e!}9[#R#S9[#T#o9[V!C^U#kPfQ!Q![9[!c!l9[!l!m!Cp!m!}9[#R#S9[#T#o9[V!CwU#kPfQ!Q![9[!c!g9[!g!h!DZ!h!}9[#R#S9[#T#o9[V!DbU#kPfQ!Q![9[!c!e9[!e!f!Dt!f!}9[#R#S9[#T#o9[V!D{U#kPfQ!Q![9[!c!v9[!v!w!E_!w!}9[#R#S9[#T#o9[V!EhS$aS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!E{U#kPfQ!Q![9[!c!g9[!g!h!F_!h!}9[#R#S9[#T#o9[V!FfU#kPfQ!Q![9[!c!t9[!t!u!Fx!u!}9[#R#S9[#T#o9[V!GPU#kPfQ!Q![9[!c!h9[!h!i!Gc!i!}9[#R#S9[#T#o9[V!GjT#kPfQ!Q![9[!c!d!Gy!d!}9[#R#S9[#T#o9[V!HQU#kPfQ!Q![9[!c!e9[!e!f!Hd!f!}9[#R#S9[#T#o9[V!HkU#kPfQ!Q![9[!c!g9[!g!h!H}!h!}9[#R#S9[#T#o9[V!IWS$]S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!IkU#kPfQ!Q![9[!c!w9[!w!x!I}!x!}9[#R#S9[#T#o9[V!JUU#kPfQ!Q![9[!c!v9[!v!w!Jh!w!}9[#R#S9[#T#o9[V!JoT#kPfQ!Q![9[!c!d!KO!d!}9[#R#S9[#T#o9[V!KVU#kPfQ!Q![9[!c!v9[!v!w!Ki!w!}9[#R#S9[#T#o9[V!KpU#kPfQ!Q![9[!c!k9[!k!l!LS!l!}9[#R#S9[#T#o9[V!LZU#kPfQ!Q![9[!c!q9[!q!r!Lm!r!}9[#R#S9[#T#o9[V!LtU#kPfQ!Q![9[!c!p9[!p!q!MW!q!}9[#R#S9[#T#o9[V!MaS$PS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V!MtU#kPfQ!Q![9[!c!d9[!d!e!NW!e!}9[#R#S9[#T#o9[V!N_U#kPfQ!Q![9[!c!l9[!l!m!Nq!m!}9[#R#S9[#T#o9[V!NxU#kPfQ!Q![9[!c!g9[!g!h# [!h!}9[#R#S9[#T#o9[V# cU#kPfQ!Q![9[!c!e9[!e!f# u!f!}9[#R#S9[#T#o9[V# |U#kPfQ!Q![9[!c!v9[!v!w#!`!w!}9[#R#S9[#T#o9[V#!iS$YS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#!|U#kPfQ!Q![9[!c!w9[!w!x##`!x!}9[#R#S9[#T#o9[V##gU#kPfQ!Q![9[!c!g9[!g!h##y!h!}9[#R#S9[#T#o9[V#$QU#kPfQ!Q![9[!c!t9[!t!u#$d!u!}9[#R#S9[#T#o9[V#$kU#kPfQ!Q![9[!c!{9[!{!|#$}!|!}9[#R#S9[#T#o9[V#%WS$OS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#%kW#kPfQ!Q![9[!c!e9[!e!f#&T!f!w9[!w!x#*s!x!}9[#R#S9[#T#o9[V#&[V#kPfQ!Q![9[!c!d#&q!d!j9[!j!k#(r!k!}9[#R#S9[#T#o9[V#&xU#kPfQ!Q![9[!c!n9[!n!o#'[!o!}9[#R#S9[#T#o9[V#'cT#kPfQ!Q![9[!c!d#'r!d!}9[#R#S9[#T#o9[V#'yU#kPfQ!Q![9[!c!t9[!t!u#(]!u!}9[#R#S9[#T#o9[V#(fS$XS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#(yU#kPfQ!Q![9[!c!g9[!g!h#)]!h!}9[#R#S9[#T#o9[V#)dU#kPfQ!Q![9[!c!o9[!o!p#)v!p!}9[#R#S9[#T#o9[V#)}T#kPfQ!Q![9[!c!d#*^!d!}9[#R#S9[#T#o9[V#*gS$WS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#*zU#kPfQ!Q![9[!c!d9[!d!e#+^!e!}9[#R#S9[#T#o9[V#+eU#kPfQ!Q![9[!c!u9[!u!v#+w!v!}9[#R#S9[#T#o9[V#,OU#kPfQ!Q![9[!c!e9[!e!f#,b!f!}9[#R#S9[#T#o9[V#,iU#kPfQ!Q![9[!c!t9[!t!u#,{!u!}9[#R#S9[#T#o9[V#-SU#kPfQ!Q![9[!c!k9[!k!l#-f!l!}9[#R#S9[#T#o9[V#-mU#kPfQ!Q![9[!c!r9[!r!s#.P!s!}9[#R#S9[#T#o9[V#.WU#kPfQ!Q![9[!c!v9[!v!w#.j!w!}9[#R#S9[#T#o9[V#.qU#kPfQ!Q![9[!c!k9[!k!l#/T!l!}9[#R#S9[#T#o9[V#/[U#kPfQ!Q![9[!c!q9[!q!r#/n!r!}9[#R#S9[#T#o9[V#/uU#kPfQ!Q![9[!c!p9[!p!q#0X!q!}9[#R#S9[#T#o9[V#0bS$QS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#0uU#kPfQ!Q![9[!c!p9[!p!q#1X!q!}9[#R#S9[#T#o9[V#1`U#kPfQ!Q![9[!c!k9[!k!l#1r!l!}9[#R#S9[#T#o9[V#1yU#kPfQ!Q![9[!c!q9[!q!r#2]!r!}9[#R#S9[#T#o9[V#2dU#kPfQ!Q![9[!c!p9[!p!q#2v!q!}9[#R#S9[#T#o9[V#3PS$^S#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[V#3dT#kPfQ!Q![9[!c!d#3s!d!}9[#R#S9[#T#o9[V#3zU#kPfQ!Q![9[!c!t9[!t!u#4^!u!}9[#R#S9[#T#o9[V#4eU#kPfQ!Q![9[!c!k9[!k!l#4w!l!}9[#R#S9[#T#o9[V#5OT#kPfQ!Q![9[!c!d#5_!d!}9[#R#S9[#T#o9[V#5fU#kPfQ!Q![9[!c!d9[!d!e#5x!e!}9[#R#S9[#T#o9[V#6PU#kPfQ!Q![9[!c!n9[!n!o#6c!o!}9[#R#S9[#T#o9[V#6jU#kPfQ!Q![9[!c!g9[!g!h#6|!h!}9[#R#S9[#T#o9[V#7TS#kPfQ!Q![9[!c!}9[#R#S#7a#T#o9[V#7hU#kPfQ!Q![9[!c!f9[!f!g#7z!g!}9[#R#S9[#T#o9[V#8RU#kPfQ!Q![9[!c!g9[!g!h#8e!h!}9[#R#S9[#T#o9[V#8lU#kPfQ!Q![9[!c!h9[!h!i#9O!i!}9[#R#S9[#T#o9[V#9VU#kPfQ!Q![9[!c!k9[!k!l#9i!l!}9[#R#S9[#T#o9[V#9pU#kPfQ!Q![9[!c!p9[!p!q#:S!q!}9[#R#S9[#T#o9[V#:ZU#kPfQ!Q![9[!c!k9[!k!l#:m!l!}9[#R#S9[#T#o9[V#:tU#kPfQ!Q![9[!c!v9[!v!w#;W!w!}9[#R#S9[#T#o9[V#;_U#kPfQ!Q![9[!c!k9[!k!l#;q!l!}9[#R#S9[#T#o9[V#;xU#kPfQ!Q![9[!c!q9[!q!r#<[!r!}9[#R#S9[#T#o9[V#<cU#kPfQ!Q![9[!c!p9[!p!q#<u!q!}9[#R#S9[#T#o9[V#=OS$VS#kPfQ!Q![9[!c!}9[#R#S9[#T#o9[~#=aO]~~#=fO[~R#=mT#kPfQ!Q![9[!c!}9[#R#S9[#T#U#=|#U#o9[R#>TU#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#>g#a#o9[R#>nU#kPfQ!Q![9[!c!}9[#R#S9[#T#g9[#g#h#?Q#h#o9[R#?XU#kPfQ!Q![9[!c!}9[#R#S9[#T#X9[#X#Y#?k#Y#o9[R#?tS#kPdQfQ!Q![9[!c!}9[#R#S9[#T#o9[R#@XU#kPfQ!Q![9[!c!}9[#R#S9[#T#i9[#i#j#@k#j#o9[R#@rU#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#AU#a#o9[R#A]U#kPfQ!Q![9[!c!}9[#R#S9[#T#`9[#`#a#Ao#a#o9[R#AxS#kPeQfQ!Q![9[!c!}9[#R#S9[#T#o9[R#B]U#kPfQ!Q![9[!c!}9[#R#S9[#T#f9[#f#g#Bo#g#o9[R#BvU#kPfQ!Q![9[!c!}9[#R#S9[#T#i9[#i#j#?Q#j#o9[~#C_Oi~~#CdO#{~~#CiOh~",tokenizers:[0,1,2],topRules:{Document:[0,2]},specialized:[{term:119,get:e=>sB[e]||-1}],tokenPrec:2989}),lB=`RootTypeDefinition InputFieldsDefinition EnumValuesDefinition FieldsDefinition SelectionSet { }`,uB=`scalar type interface union enum input implements fragment extend schema directive on repeatable`,dB=`( ) { } : [ ]`,fB=DO.define({parser:cB.configure({props:[RE({Variable:X.variableName,BooleanValue:X.bool,Description:X.string,StringValue:X.string,Comment:X.lineComment,IntValue:X.integer,FloatValue:X.float,EnumValue:X.special(X.name),NullValue:X.null,DirectiveName:X.modifier,[uB]:X.keyword,OperationType:X.definitionKeyword,FieldName:X.propertyName,Field:X.propertyName,ArgumentAttributeName:X.attributeName,Name:X.atom,"( )":X.paren,"{ }":X.brace,",":X.separator,[dB]:X.punctuation}),VO.add({[lB]:jD({closing:`}`,align:!0})}),KO.add({[lB]:FD})]}),languageData:{commentTokens:{line:`#`},indentOnInput:/^\s*(\{|\})$/}}),pB=/^[a-zA-Z0-9_@(]$/,mB=fB.data.of({autocomplete(e){let t=tB(e.state),n=nB(e.state);if(!t)return null;let r=e.matchBefore(/\w*/);if(!r)return null;let i=r.text.split(``).pop();if(!pB.test(i)&&!e.explicit)return null;let a=KL(t,e.state.doc.toString(),Uz(e.state.doc,e.pos),void 0,void 0,n?.autocompleteOptions);return a.length===0?null:{from:r.from,options:a.map(t=>({label:t.label,detail:t.detail||``,info(r){if(n?.onCompletionInfoRender)return n.onCompletionInfoRender(t,e,r);if(t.documentation||t.isDeprecated&&t.deprecationReason){let e=document.createElement(`div`);return e.textContent=t.documentation||t.deprecationReason||``,e}}}))}}}),hB=J.domEventHandlers({click(e,t){let n=tB(t.state);if(!n)return;let r=t.state.selection.main.head,i=Uz(t.state.doc,r),a=zL(n,AL(t.state.doc.toString(),i).state),o=nB(t.state);o?.onShowInDocs&&Jz(e)&&o.onShowInDocs(a.fieldDef?.name,a.type?.toString(),a.parentType?.toString())}}),gB=[`error`,`warning`,`info`],_B=vz(e=>{let t=tB(e.state),n=nB(e.state);if(!t)return[];let r=vl(t);if(r.length){if(!n?.showErrorOnInvalidSchema)return[];let t=r.map(e=>e.message);return[{from:0,to:e.state.doc.length,severity:`error`,message:t.join(` +`),actions:[]}]}return TR(e.state.doc.toString(),t).map(t=>{if(!t.severity||!t.source)return null;let n=Hz(e.state.doc,new Kz(t.range.start.line,t.range.start.character)),r=Math.max(0,Math.min(n,e.state.doc.length)),i=Hz(e.state.doc,new Kz(t.range.end.line,t.range.end.character-1)),a=Math.min(Math.max(r+1,i),e.state.doc.length);return{from:r,to:r===a?a+1:a,severity:gB[t.severity-1],message:t.message,actions:[]}}).filter(e=>!!e)},{needsRefresh(e){return e.startState.field(Xz)!==e.state.field(Xz)||e.startState.field(Qz)!==e.state.field(Qz)}})})),yB,bB,xB=n((()=>{lz(),uD(),yB=RE({String:X.string,Number:X.number,"True False":X.bool,PropertyName:X.propertyName,Null:X.null,", :":X.separator,"[ ]":X.squareBracket,"{ }":X.brace}),bB=cz.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[yB],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0})})),SB=i({json:()=>wB,jsonLanguage:()=>EB,jsonParseLinter:()=>TB});function CB(e,t){let n;return(n=e.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=e.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0}function wB(){return new IO(EB)}var TB,EB,DB=n((()=>{xB(),Rk(),TB=()=>e=>{try{JSON.parse(e.state.doc.toString())}catch(t){if(!(t instanceof SyntaxError))throw t;let n=CB(t,e.state.doc);return[{from:n,message:t.message,severity:`error`,to:n}]}return[]},EB=DO.define({name:`json`,parser:bB.configure({props:[VO.add({Object:ND({except:/^\s*\}/}),Array:ND({except:/^\s*\]/})}),KO.add({"Object Array":FD})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}})})),OB=A(`<div class="editor svelte-mhzyj2"></div>`);function kB(e,t){Xe(t,!0);let n=Li(t,`language`,3,`graphql`),r=Li(t,`readOnly`,3,!1),i=tn(null),a,o=tn(null),s=tn(null);Ri(()=>{if(globalThis.document===void 0)return;let e=!1;return(async()=>{let[{EditorView:c,keymap:l,lineNumbers:u,highlightActiveLine:d},{EditorState:f},{defaultKeymap:p,history:m,historyKeymap:h},{syntaxHighlighting:g,defaultHighlightStyle:_,bracketMatching:v,indentOnInput:y},{closeBrackets:b,closeBracketsKeymap:x},{graphql:S,updateSchema:ee},{json:C},{buildSchema:te}]=await Promise.all([Promise.resolve().then(()=>(eE(),Dv)),Promise.resolve().then(()=>(cv(),Sg)),Promise.resolve().then(()=>(lN(),Yk)),Promise.resolve().then(()=>(Rk(),dD)),Promise.resolve().then(()=>(_F(),uN)),Promise.resolve().then(()=>(vB(),Vz)),Promise.resolve().then(()=>(DB(),SB)),Promise.resolve().then(()=>(kh(),Oh))]);if(e)return;let ne=t.theme??Jk,re=n()===`graphql`?S(t.schema?te(t.schema):void 0):C();E(s,new c({parent:a,state:f.create({doc:t.value,extensions:[u(),d(),m(),v(),b(),y(),g(_,{fallback:!0}),l.of([...x,...p,...h]),re,ne,c.editable.of(!r()),c.updateListener.of(e=>{e.docChanged&&t.onChange(e.state.doc.toString())})]})}),!0),E(o,ee,!0),E(i,te,!0)})(),()=>{e=!0,k(s)?.destroy()}}),Nn(()=>{if(!(!k(s)||!k(o)||!k(i))&&!(n()!==`graphql`||!t.schema))try{k(o)(k(s),k(i)(t.schema))}catch{}}),Nn(()=>{k(s)&&k(s).state.doc.toString()!==t.value&&k(s).dispatch({changes:{from:0,insert:t.value,to:k(s).state.doc.length}})});var c=OB();Ii(c,e=>a=e,()=>a),j(e,c),Ze()}var AB=A(`<button class="action svelte-1x0f4yt" type="button">Export</button>`),jB=A(`<button class="action svelte-1x0f4yt" type="button">Import</button> <input accept="application/json" class="hidden-input svelte-1x0f4yt" type="file"/>`,1),MB=A(`<button class="action svelte-1x0f4yt" type="button">Clear</button>`),NB=A(`<button aria-label="Dismiss notice" class="notice-dismiss svelte-1x0f4yt" type="button">×</button>`),PB=A(`<div class="notice svelte-1x0f4yt"><span> </span> <!></div>`),FB=A(`<div class="empty svelte-1x0f4yt">No history yet.</div>`),IB=Gr(`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-1x0f4yt"><path d="M12 2L14.9389 7.95492L21.5106 8.90983L16.7553 13.5451L17.8779 20.0902L12 17L6.12215 20.0902L7.24472 13.5451L2.48944 8.90983L9.06108 7.95492L12 2Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>`),LB=Gr(`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svelte-1x0f4yt"><path d="M12 2L14.9389 7.95492L21.5106 8.90983L16.7553 13.5451L17.8779 20.0902L12 17L6.12215 20.0902L7.24472 13.5451L2.48944 8.90983L9.06108 7.95492L12 2Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>`),RB=A(`<div aria-label="Load history entry" class="entry svelte-1x0f4yt" role="button" tabindex="0"><button type="button"><!></button> <div class="meta svelte-1x0f4yt"><div class="entry-title svelte-1x0f4yt"> </div> <div class="entry-time svelte-1x0f4yt"> </div></div> <button aria-label="Remove entry" class="remove svelte-1x0f4yt" type="button">×</button></div>`),zB=A(`<div class="panel svelte-1x0f4yt"><div class="header svelte-1x0f4yt"><span class="title svelte-1x0f4yt">History</span> <div class="actions svelte-1x0f4yt"><!> <!> <!></div></div> <!> <div class="list svelte-1x0f4yt"><!></div></div>`);function BB(e,t){Xe(t,!0);let n=Li(t,`notice`,3,null),r=tn(null),i=Wt(()=>[...t.entries].sort((e,t)=>e.favorite===t.favorite?t.timestamp-e.timestamp:e.favorite?-1:1));function a(e){return new Date(e).toLocaleString()}function o(e,n){t.onLoad(n,e.shiftKey)}function s(e,n){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t.onLoad(n,e.shiftKey))}function c(e){let n=e.currentTarget,r=n.files?.[0];r&&t.onImport?.(r),n.value=``}function l(){k(r)?.click()}var u=zB(),d=D(u),f=O(D(d),2),p=D(f),m=e=>{var n=AB();Ir(`click`,n,function(...e){t.onExport?.apply(this,e)}),j(e,n)};ei(p,e=>{t.onExport&&e(m)});var h=O(p,2),g=e=>{var t=jB(),n=yn(t),i=O(n,2);Ii(i,e=>E(r,e),()=>k(r)),Ir(`click`,n,l),Ir(`change`,i,c),j(e,t)};ei(h,e=>{t.onImport&&e(g)});var _=O(h,2),v=e=>{var n=MB();Ir(`click`,n,function(...e){t.onClear?.apply(this,e)}),j(e,n)};ei(_,e=>{t.entries.length>0&&e(v)}),T(f),T(d);var y=O(d,2),b=e=>{var r=PB(),i=D(r),a=D(i,!0);T(i);var o=O(i,2),s=e=>{var n=NB();Ir(`click`,n,function(...e){t.onDismissNotice?.apply(this,e)}),j(e,n)};ei(o,e=>{t.onDismissNotice&&e(s)}),T(r),zn(()=>qr(a,n())),j(e,r)};ei(y,e=>{n()&&e(b)});var x=O(y,2),S=D(x),ee=e=>{j(e,FB())},C=e=>{var n=Kr();ai(yn(n),17,()=>k(i),e=>e.id,(e,n)=>{var r=RB(),i=D(r);let c;var l=D(i),u=e=>{j(e,IB())},d=e=>{j(e,LB())};ei(l,e=>{k(n).favorite?e(u):e(d,-1)}),T(i);var f=O(i,2),p=D(f),m=D(p,!0);T(p);var h=O(p,2),g=D(h,!0);T(h),T(f);var _=O(f,2);T(r),zn(e=>{Oi(i,`aria-label`,k(n).favorite?`Unfavorite`:`Favorite`),c=vi(i,1,`star svelte-1x0f4yt`,null,c,{active:k(n).favorite}),qr(m,k(n).title),qr(g,e)},[()=>a(k(n).timestamp)]),Ir(`click`,r,e=>o(e,k(n).id)),Ir(`keydown`,r,e=>s(e,k(n).id)),Ir(`click`,i,e=>{e.stopPropagation(),t.onFavorite(k(n).id)}),Ir(`click`,_,e=>{e.stopPropagation(),t.onRemove(k(n).id)}),j(e,r)}),j(e,n)};ei(S,e=>{k(i).length===0?e(ee):e(C,-1)}),T(x),T(u),j(e,u),Ze()}Lr([`click`,`change`,`keydown`]);var VB=A(`<div class="metadata svelte-1l6l2pw"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-1l6l2pw"><path d="M14 5.75L20.25 12L14 18.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path><path d="M19.5 12H3.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="square"></path></svg> <!></div>`),HB=A(`<div class="footer svelte-1l6l2pw"><!></div>`),UB=A(`<div class="result svelte-1l6l2pw"><div class="label svelte-1l6l2pw">Response</div> <!> <!> <!></div>`);function WB(e,t){Xe(t,!0);let n=Li(t,`streamIntervals`,19,()=>[]),r=Li(t,`timing`,3,null),i=Wt(()=>{if(!r())return null;if(n().length>0){let e=Math.round(a(n()));return`${n().length+1} messages · median ${e}ms`}return`${Math.round(r().endMs-r().startMs)}ms · first byte ${Math.round(r().firstByteMs-r().startMs)}ms`});function a(e){if(e.length===0)return 0;let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2==0?(t[n-1]+t[n])/2:t[n]}function o(e){}var s=UB(),c=O(D(s),2);kB(c,{language:`json`,onChange:o,readOnly:!0,get theme(){return t.theme},get value(){return t.value}});var l=O(c,2),u=e=>{var t=VB();di(O(D(t),2),()=>k(i)),T(t),j(e,t)};ei(l,e=>{k(i)&&e(u)});var d=O(l,2),f=e=>{var n=HB();fi(D(n),()=>t.footer,()=>({result:t.value})),T(n),j(e,n)};ei(d,e=>{t.footer&&e(f)}),T(s),j(e,s),Ze()}var GB=A(`<div role="separator" tabindex="0"></div>`);function KB(e,t){Xe(t,!0);let n=tn(!1),r=tn(0),i=tn(0);function a(e){t.onKeyAdjust&&(t.orientation===`horizontal`?e.key===`ArrowLeft`?(e.preventDefault(),t.onKeyAdjust(-16)):e.key===`ArrowRight`&&(e.preventDefault(),t.onKeyAdjust(16)):e.key===`ArrowUp`?(e.preventDefault(),t.onKeyAdjust(-16)):e.key===`ArrowDown`&&(e.preventDefault(),t.onKeyAdjust(16)))}function o(e){e.preventDefault(),E(n,!0),E(r,e.clientX,!0),E(i,e.clientY,!0),e.currentTarget instanceof Element&&e.currentTarget.setPointerCapture(e.pointerId),t.onDragStart?.()}function s(e){k(n)&&t.onDrag(e.clientX-k(r),e.clientY-k(i))}function c(e){k(n)&&(E(n,!1),e.currentTarget instanceof Element&&e.currentTarget.releasePointerCapture(e.pointerId),t.onDragEnd?.())}var l=GB();let u;zn(()=>{Oi(l,`aria-label`,t.label),Oi(l,`aria-orientation`,t.orientation),Oi(l,`aria-valuemax`,t.max),Oi(l,`aria-valuemin`,t.min),Oi(l,`aria-valuenow`,t.value),u=vi(l,1,`splitter ${t.orientation??``}`,`svelte-1f4xp5w`,u,{dragging:k(n)})}),Ir(`keydown`,l,a),Ir(`pointerdown`,l,o),Ir(`pointermove`,l,s),Ir(`pointerup`,l,c),j(e,l),Ze()}Lr([`keydown`,`pointerdown`,`pointermove`,`pointerup`]);var qB=A(`<input class="edit svelte-1s5m1m3" type="text"/>`),JB=A(`<span class="title svelte-1s5m1m3"> </span>`),YB=A(`<div role="tab" tabindex="0"><!> <!> <button aria-label="Close tab" class="close svelte-1s5m1m3">×</button></div>`),XB=A(`<div class="tabbar svelte-1s5m1m3" role="tablist"><!> <button aria-label="New tab" class="add svelte-1s5m1m3">+</button></div>`);function ZB(e,t){Xe(t,!0);let n=tn(``),r=tn(null),i=tn(null);function a(){E(r,null),E(n,``)}function o(){k(r)!==null&&(t.onRename(k(r),k(n)),E(r,null),E(n,``))}function s(e,n){e.stopPropagation(),t.onClose(n)}function c(e){e.key===`Enter`?(e.preventDefault(),o()):e.key===`Escape`&&(e.preventDefault(),a())}async function l(e){E(r,e.id,!0),E(n,e.title,!0),await Tr(),k(i)?.select()}var u=XB(),d=D(u);ai(d,17,()=>t.tabs,e=>e.id,(e,a)=>{var u=YB();let d;var f=D(u),p=e=>{var t=qB();Di(t),Ii(t,e=>E(i,e),()=>k(i)),Fr(`blur`,t,o),Ir(`click`,t,e=>e.stopPropagation()),Ir(`keydown`,t,c),Mi(t,()=>k(n),e=>E(n,e)),j(e,t)},m=e=>{var t=JB(),n=D(t,!0);T(t),zn(()=>qr(n,k(a).title)),j(e,t)};ei(f,e=>{k(r)===k(a).id?e(p):e(m,-1)});var h=O(f,2),g=e=>{var n=Kr();fi(yn(n),()=>t.extras,()=>({tab:k(a)})),j(e,n)};ei(h,e=>{t.extras&&e(g)});var _=O(h,2);T(u),zn(()=>{Oi(u,`aria-selected`,k(a).id===t.activeId),d=vi(u,1,`tab svelte-1s5m1m3`,null,d,{active:k(a).id===t.activeId})}),Ir(`dblclick`,u,()=>l(k(a))),Ir(`click`,u,()=>t.onSelect(k(a).id)),Ir(`keydown`,u,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t.onSelect(k(a).id))}),Ir(`click`,_,e=>s(e,k(a).id)),j(e,u)});var f=O(d,2);T(u),Ir(`click`,f,function(...e){t.onAdd?.apply(this,e)}),j(e,u),Ze()}Lr([`dblclick`,`click`,`keydown`]);var QB=A(`<option> </option>`),$B=A(`<select aria-label="Operation" class="picker svelte-50ld1a"><option>Select operation…</option><!></select>`),eV=A(`<button class="toggle svelte-50ld1a" type="button"><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svelte-50ld1a"><path d="M20.646 3.36267C20.0461 2.75178 19.7917 1.83922 19.7917 1H19.2083C19.2083 1.83575 18.9563 2.74893 18.3526 3.35264C17.7489 3.95635 16.8358 4.20833 16 4.20833V4.79167C16.8392 4.79167 17.7518 5.04611 18.3627 5.64596C18.9822 6.25433 19.2083 7.15499 19.2083 8H19.7917C19.7917 7.15156 20.0203 6.25159 20.6359 5.63594C21.2516 5.02029 22.1516 4.79167 23 4.79167V4.20833C22.155 4.20833 21.2543 3.98225 20.646 3.36267Z"></path><path d="M2 13.75C5.03345 13.75 7.04641 14.4196 8.31342 15.6866C9.58043 16.9536 10.25 18.9666 10.25 22H11.75C11.75 18.9666 12.4196 16.9536 13.6866 15.6866C14.9536 14.4196 16.9666 13.75 20 13.75V12.25C16.9666 12.25 14.9536 11.5804 13.6866 10.3134C12.4196 9.04641 11.75 7.03345 11.75 4H10.25C10.25 7.03345 9.58043 9.04641 8.31342 10.3134C7.04641 11.5804 5.03345 12.25 2 12.25V13.75Z"></path></svg> Format</button>`),tV=A(`<span class="hint svelte-50ld1a">Loading schema…</span>`),nV=A(`<button type="button"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-50ld1a"><path d="M7 8C7 8.55228 6.55228 9 6 9C5.44772 9 5 8.55228 5 8C5 7.44772 5.44772 7 6 7C6.55228 7 7 7.44772 7 8Z"></path><path d="M10 8C10 8.55228 9.55228 9 9 9C8.44772 9 8 8.55228 8 8C8 7.44772 8.44772 7 9 7C9.55228 7 10 7.44772 10 8Z"></path><path d="M12 9C12.5523 9 13 8.55228 13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8C11 8.55228 11.4477 9 12 9Z"></path><path d="M2 4V20H11V18.5H3.5V5.5H20.5V9H22V4H2Z"></path><path d="M13 16.75C14.6446 16.75 15.6575 17.114 16.2718 17.7282C16.886 18.3425 17.25 19.3554 17.25 21H18.75C18.75 19.3554 19.114 18.3425 19.7282 17.7282C20.3425 17.114 21.3554 16.75 23 16.75V15.25C21.3554 15.25 20.3425 14.886 19.7282 14.2718C19.114 13.6575 18.75 12.6446 18.75 11H17.25C17.25 12.6446 16.886 13.6575 16.2718 14.2718C15.6575 14.886 14.6446 15.25 13 15.25V16.75Z"></path></svg> History</button>`),rV=A(`<button type="button"><svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-50ld1a"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.5 4V5L16.5 6.5L18 9.5H19L20.5 6.5L21 6.25V21H3V3H15.5L13.5 4ZM7 16.5H14V15H7V16.5ZM7 12.75H10.5V11.25H7V12.75ZM12 12.75H17V11.25H12V12.75ZM7 9H13V7.5H7V9Z"></path><path d="M18.5 1L19.4453 3.55468L22 4.5L19.4453 5.44532L18.5 8L17.5547 5.44532L15 4.5L17.5547 3.55468L18.5 1Z"></path></svg> Docs</button>`),iV=A(`<div class="toolbar svelte-50ld1a"><button class="run svelte-50ld1a"><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svelte-50ld1a"><path d="M4 3.53711V20.4642L20.927 12.0006L4 3.53711Z"></path></svg> </button> <!> <!> <!> <!> <span class="spacer svelte-50ld1a"></span> <!> <!></div>`);function aV(e,t){Xe(t,!0);let n=Li(t,`docsAvailable`,3,!1),r=Li(t,`docsOpen`,3,!1),i=Li(t,`historyOpen`,3,!1),a=Li(t,`operationName`,3,null),o=Li(t,`operations`,19,()=>[]),s=Wt(()=>o().filter(e=>e.name!==null));function c(e){let n=e.currentTarget.value;t.onSelectOperation?.(n||null)}var l=iV(),u=D(l),d=O(D(u));T(u);var f=O(u,2),p=e=>{var t=$B(),n=D(t);n.value=n.__value=``,ai(O(n),17,()=>k(s),ti,(e,t)=>{var n=QB(),r=D(n);T(n);var i={};zn(()=>{qr(r,`${k(t).type??``} ${k(t).name??``}`),i!==(i=k(t).name)&&(n.value=(n.__value=k(t).name)??``)}),j(e,n)}),T(t);var r;Si(t),zn(()=>{r!==(r=a()??``)&&(t.value=(t.__value=a()??``)??``,xi(t,a()??``))}),Ir(`change`,t,c),j(e,t)};ei(f,e=>{k(s).length>1&&e(p)});var m=O(f,2),h=e=>{var n=eV();zn(()=>n.disabled=t.disabled),Ir(`click`,n,function(...e){t.onFormat?.apply(this,e)}),j(e,n)};ei(m,e=>{t.onFormat&&e(h)});var g=O(m,2),_=e=>{var n=Kr();fi(yn(n),()=>t.extras),j(e,n)};ei(g,e=>{t.extras&&e(_)});var v=O(g,2),y=e=>{j(e,tV())};ei(v,e=>{t.schemaLoading&&e(y)});var b=O(v,4),x=e=>{var n=nV();let r;zn(()=>{Oi(n,`aria-pressed`,i()),r=vi(n,1,`toggle svelte-50ld1a`,null,r,{active:i()})}),Ir(`click`,n,function(...e){t.onToggleHistory?.apply(this,e)}),j(e,n)};ei(b,e=>{t.onToggleHistory&&e(x)});var S=O(b,2),ee=e=>{var i=rV();let a;zn(()=>{Oi(i,`aria-pressed`,r()),a=vi(i,1,`toggle svelte-50ld1a`,null,a,{active:r()}),i.disabled=!n()}),Ir(`click`,i,function(...e){t.onToggleDocs?.apply(this,e)}),j(e,i)};ei(S,e=>{t.onToggleDocs&&e(ee)}),T(l),zn(()=>{u.disabled=t.disabled,qr(d,` ${t.running?`Running…`:`Run`}`)}),Ir(`click`,u,function(...e){t.onRun?.apply(this,e)}),j(e,l),Ze()}Lr([`click`,`change`]);function oV(e){let t=`${e}:`;function n(){try{return globalThis.localStorage!==void 0}catch{return!1}}return{get(e){if(!n())return null;let r=globalThis.localStorage.getItem(t+e);if(r===null)return null;try{return JSON.parse(r)}catch{return null}},remove(e){n()&&globalThis.localStorage.removeItem(t+e)},set(e,r){n()&&globalThis.localStorage.setItem(t+e,JSON.stringify(r))}}}function sV(){let e=new Map;return{get(t){let n=e.get(t);if(n===void 0)return null;try{return JSON.parse(n)}catch{return null}},remove(t){e.delete(t)},set(t,n){e.set(t,JSON.stringify(n))}}}function cV(e,t){if(e.length<=t)return e;let n=e.filter(e=>e.favorite),r=e.filter(e=>!e.favorite).slice(0,Math.max(0,t-n.length));return[...n,...r].sort((e,t)=>t.timestamp-e.timestamp)}var lV=100,uV=`history`,dV=class{#e=tn(cn([]));get entries(){return k(this.#e)}set entries(e){E(this.#e,e,!0)}#t;constructor(e){this.#t=e;let t=e.get(uV);Array.isArray(t)&&(this.entries=t.map(e=>({favorite:!!e.favorite,headers:e.headers??`{}`,id:e.id,operationName:e.operationName??null,query:e.query??``,timestamp:e.timestamp??Date.now(),title:e.title??`untitled`,variables:e.variables??`{}`})))}add(e){let t={favorite:!1,headers:e.headers,id:crypto.randomUUID(),operationName:e.operationName,query:e.query,timestamp:Date.now(),title:e.title,variables:e.variables};this.entries=[t,...this.entries],this.#n()}clear(){this.entries=this.entries.filter(e=>e.favorite)}favorite(e){let t=this.entries.find(t=>t.id===e);t&&(t.favorite=!t.favorite)}persist(){this.#t.set(uV,this.entries)}remove(e){this.entries=this.entries.filter(t=>t.id!==e)}#n(){this.entries=cV(this.entries,lV)}};function fV(e){if(!(e.metaKey||e.ctrlKey))return null;if(e.key===`Enter`)return e.shiftKey?{type:`newTab`}:e.altKey?null:{type:`run`};if(e.shiftKey&&!e.altKey){let t=e.key.toLowerCase();if(t===`w`)return{type:`closeTab`};if(t===`f`)return{type:`format`}}if(e.altKey&&!e.shiftKey){if(e.key===`ArrowRight`)return{type:`nextTab`};if(e.key===`ArrowLeft`)return{type:`prevTab`}}return null}kh();var pV=class{#e=tn(null);get error(){return k(this.#e)}set error(e){E(this.#e,e,!0)}#t=tn(!1);get loading(){return k(this.#t)}set loading(e){E(this.#t,e,!0)}#n=tn(null);get schema(){return k(this.#n)}set schema(e){E(this.#n,e,!0)}#r=tn(``);get sdl(){return k(this.#r)}set sdl(e){E(this.#r,e,!0)}async introspect(e){this.loading=!0,this.error=null;try{let t=(await e({query:Yp()})).data;this.schema=rm(t),this.sdl=bm(this.schema)}catch(e){this.error=String(e)}finally{this.loading=!1}}};kh();function mV(e){if(!e.trim())return e;try{return as(_o(e))}catch{return e}}kh();function hV(e,t){let n=t[0];if(n&&n.name)return n.name;if(n)return n.type;let r=e.trim();return r?r.slice(0,20):`untitled`}function gV(e){let t=e.trim();if(!t)return[];try{let e=_o(t),n=[];for(let t of e.definitions)t.kind===`OperationDefinition`&&n.push({name:t.name?.value??null,type:t.operation});return n}catch{return[]}}var _V=1024*1024,vV=50;function yV(e){return{headers:e.headers,operationName:e.operationName,query:e.query,title:e.title,variables:e.variables}}function bV(e){if(!xV(e))return{error:`not an object`};if(e.version!==1)return{error:`unsupported version: ${String(e.version)}`};if(typeof e.exportedAt!=`string`)return{error:`exportedAt: not a string`};if(!Array.isArray(e.tabs))return{error:`tabs: not an array`};if(e.tabs.length>vV)return{error:`tabs: exceeds ${vV}`};let t=[];for(let n=0;n<e.tabs.length;n++){let r=CV(e.tabs[n],n);if(typeof r==`string`)return{error:r};t.push(r)}return{exportedAt:e.exportedAt,tabs:t,version:1}}function xV(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function SV(e){return e.length>_V}function CV(e,t){return xV(e)?typeof e.headers==`string`?typeof e.query==`string`?typeof e.title==`string`?typeof e.variables==`string`?e.operationName!==null&&typeof e.operationName!=`string`?`tabs[${t}].operationName: not a string or null`:SV(e.headers)?`tabs[${t}].headers: exceeds 1 MB`:SV(e.query)?`tabs[${t}].query: exceeds 1 MB`:SV(e.title)?`tabs[${t}].title: exceeds 1 MB`:SV(e.variables)?`tabs[${t}].variables: exceeds 1 MB`:typeof e.operationName==`string`&&SV(e.operationName)?`tabs[${t}].operationName: exceeds 1 MB`:{headers:e.headers,operationName:e.operationName,query:e.query,title:e.title,variables:e.variables}:`tabs[${t}].variables: not a string`:`tabs[${t}].title: not a string`:`tabs[${t}].query: not a string`:`tabs[${t}].headers: not a string`:`tabs[${t}]: not an object`}var wV=`session`,TV=class{#e=tn(``);get activeId(){return k(this.#e)}set activeId(e){E(this.#e,e,!0)}#t=tn(cn([]));get tabs(){return k(this.#t)}set tabs(e){E(this.#t,e,!0)}#n=Wt(()=>this.tabs.find(e=>e.id===this.activeId));get active(){return k(this.#n)}set active(e){E(this.#n,e)}#r;constructor(e){this.#r=e;let t=e.get(wV);if(t&&t.tabs.length>0)this.tabs=t.tabs.map(e=>this.#a(e)),this.activeId=this.tabs.some(e=>e.id===t.activeId)?t.activeId:this.tabs[0].id;else{let e=this.#i();this.tabs=[e],this.activeId=e.id}}addTab(e){let t=e?this.#o(e):this.#i();this.tabs.push(t),this.activeId=t.id}closeTab(e){let t=this.tabs.findIndex(t=>t.id===e);if(t!==-1){if(this.tabs.length===1){let e=this.#i();this.tabs=[e],this.activeId=e.id;return}this.tabs.splice(t,1),this.activeId===e&&(this.activeId=this.tabs[Math.max(0,t-1)].id)}}exportAll(){return{exportedAt:new Date().toISOString(),tabs:this.tabs.map(yV),version:1}}exportTab(e){let t=this.tabs.find(t=>t.id===e);return t?yV(t):null}formatActive(){let e=this.active;if(!e)return;let t=mV(e.query);t!==e.query&&(e.query=t,e.operations=gV(t),e.titleDirty||(e.title=hV(t,e.operations)))}importTabs(e,t){let n=e.tabs.slice(0,50),r=[],i=e.tabs.length-n.length;if(t.mode===`replace`){this.tabs=[];for(let e of n)this.tabs.push(this.#o(e));if(this.tabs.length===0){let e=this.#i();this.tabs=[e],this.activeId=e.id}else this.activeId=this.tabs[0].id;return{added:n.length,errors:r,skipped:i}}for(let e of n)this.tabs.push(this.#o(e));return n.length>0&&(this.activeId=this.tabs[this.tabs.length-1].id),{added:n.length,errors:r,skipped:i}}nextTab(){if(this.tabs.length<=1)return;let e=this.tabs.findIndex(e=>e.id===this.activeId);if(e===-1)return;let t=(e+1)%this.tabs.length;this.activeId=this.tabs[t].id}persist(){this.#r.set(wV,{activeId:this.activeId,tabs:this.tabs})}prevTab(){if(this.tabs.length<=1)return;let e=this.tabs.findIndex(e=>e.id===this.activeId);if(e===-1)return;let t=(e-1+this.tabs.length)%this.tabs.length;this.activeId=this.tabs[t].id}renameActive(e){this.active&&(this.active.title=e.trim()||`untitled`,this.active.titleDirty=!0)}renameTab(e,t){let n=this.tabs.find(t=>t.id===e);n&&(n.title=t.trim()||`untitled`,n.titleDirty=!0)}async run(e,t={}){let n=this.active;if(!n)return!1;let r=t.subscriptionMode??`append`,i=t.signal;n.streamIntervals=[];let a=performance.now();n.timing={endMs:a,firstByteMs:a,startMs:a};try{let t=n.headers.trim()?JSON.parse(n.headers):{},o=n.variables.trim()?JSON.parse(n.variables):{},s=await e({headers:t,operationName:n.operationName,query:n.query,variables:o});if(EV(s)){n.result=``;let e=s[Symbol.asyncIterator](),t=!1,o=a;try{for(;;){if(i?.aborted){await e.return?.();break}let a=await e.next();if(a.done)break;let s=performance.now();if(!t)t=!0,o=s,n.timing={...n.timing,endMs:s,firstByteMs:s};else{let e=s-o;o=s,n.streamIntervals.length>=500&&n.streamIntervals.shift(),n.streamIntervals=[...n.streamIntervals,e],n.timing={...n.timing,endMs:s}}let c=JSON.stringify(a.value,null,2);if(r===`append`){let e=`// ${new Date().toISOString()}\n${c}\n`;n.result=n.result?`${n.result}\n${e}`:e}else n.result=c}}finally{await e.return?.()}return!0}let c=performance.now();return n.timing={...n.timing,firstByteMs:c},n.result=JSON.stringify(s,null,2),n.timing={...n.timing,endMs:performance.now()},!0}catch(e){return n.result=JSON.stringify({error:String(e)},null,2),n.timing={...n.timing,endMs:performance.now()},!1}}overwriteActive(e){let t=this.active;if(!t)return;let n=e.query??``;t.headers=e.headers??`{}`,t.operations=gV(n),t.operationName=e.operationName??null,t.query=n,t.result=``,t.streamIntervals=[],t.timing=null,t.variables=e.variables??`{}`,e.title&&!t.titleDirty?t.title=e.title:t.titleDirty||(t.title=hV(n,t.operations))}selectOperation(e,t){let n=this.tabs.find(t=>t.id===e);n&&(n.operationName=t)}selectTab(e){this.tabs.some(t=>t.id===e)&&(this.activeId=e)}updateQuery(e,t){let n=this.tabs.find(t=>t.id===e);if(!n)return;n.query=t;let r=gV(t);n.operations=r,r.length===0?n.operationName=null:r.length===1?n.operationName=r[0].name:n.operationName&&!r.some(e=>e.name===n.operationName)&&(n.operationName=null),n.titleDirty||(n.title=hV(t,r))}#i(){return{headers:`{}`,id:crypto.randomUUID(),operationName:null,operations:[],query:``,result:``,streamIntervals:[],timing:null,title:`untitled`,titleDirty:!1,variables:`{}`}}#a(e){return{headers:e.headers??`{}`,id:e.id,operationName:e.operationName??null,operations:e.operations??gV(e.query??``),query:e.query??``,result:e.result??``,streamIntervals:[],timing:null,title:e.title??`untitled`,titleDirty:e.titleDirty??e.title!==`untitled`,variables:e.variables??`{}`}}#o(e){let t=e.query??``,n=gV(t),r=e.title??hV(t,n);return{headers:e.headers??`{}`,id:crypto.randomUUID(),operationName:e.operationName??null,operations:n,query:t,result:``,streamIntervals:[],timing:null,title:r,titleDirty:!!e.title,variables:e.variables??`{}`}}};function EV(e){return typeof e==`object`&&!!e&&typeof e[Symbol.asyncIterator]==`function`}var DV=A(`<!> <!>`,1),OV=A(`<!> <!>`,1),kV=A(`<div class="status svelte-pvt4yg"><span class="svelte-pvt4yg">Schema error</span> </div>`),AV=A(`<div class="graphiql svelte-pvt4yg"><!> <!> <div><!> <div class="center svelte-pvt4yg"><div class="left svelte-pvt4yg"><div class="query svelte-pvt4yg"><!></div> <!> <div class="bottom svelte-pvt4yg"><div class="switcher svelte-pvt4yg"><button>Variables</button> <button>Headers</button></div> <!></div></div> <!> <div class="right svelte-pvt4yg"><!></div></div> <!></div> <!></div>`);function jV(e,t){Xe(t,!0);let n=Li(t,`initialQuery`,3,``),r=Li(t,`namespace`,3,`eol-graphiql`),i=Li(t,`subscriptionMode`,3,`append`),a=t.storage??(globalThis.localStorage===void 0?sV():oV(r())),o=new dV(a),s=new pV,c=new TV(a);n()&&c.active&&c.active.query===``&&c.updateQuery(c.active.id,n());let l=tn(`variables`),u=tn(cn(a.get(`layout.bottomHeight`)??35)),d=tn(null),f=tn(cn(a.get(`docExplorer`)??!1)),p=tn(cn(a.get(`layout.docsWidth`)??320)),m=0,h=0,g=0,_=0,v=0,y=0,b=tn(null),x=tn(cn(a.get(`historyPanel`)??!1)),S=tn(cn(a.get(`layout.historyWidth`)??300)),ee=tn(null),C=tn(cn(a.get(`layout.leftWidth`)??50)),te=null,ne=tn(!1),re=tn(0),ie=tn(0),ae;Nn(()=>{let e=()=>{clearTimeout(ae),ae=setTimeout(()=>{E(re,globalThis.innerWidth,!0),E(ie,globalThis.innerHeight,!0)},100)};return e(),globalThis.addEventListener(`resize`,e),()=>{globalThis.removeEventListener(`resize`,e)}}),Nn(()=>{c.tabs,c.activeId;let e=setTimeout(()=>{c.persist()},300);return()=>clearTimeout(e)}),Nn(()=>{o.entries;let e=setTimeout(()=>{o.persist()},300);return()=>clearTimeout(e)}),Nn(()=>{a.set(`docExplorer`,k(f))}),Nn(()=>{a.set(`historyPanel`,k(x))}),Nn(()=>{a.set(`layout.bottomHeight`,k(u))}),Nn(()=>{a.set(`layout.docsWidth`,k(p))}),Nn(()=>{a.set(`layout.historyWidth`,k(S))}),Nn(()=>{a.set(`layout.leftWidth`,k(C))}),Ri(()=>{s.introspect(t.fetcher)});function oe(e,t,n){return Math.min(Math.max(e,t),n)}async function se(){if(k(ne)){te?.abort();return}E(ne,!0),te=new AbortController;try{let e=c.active;await c.run(t.fetcher,{signal:te.signal,subscriptionMode:i()})&&e&&o.add({headers:e.headers,operationName:e.operationName,query:e.query,title:e.title,variables:e.variables})}finally{te=null,E(ne,!1)}}function ce(e,t){let n=o.entries.find(t=>t.id===e);if(!n)return;let r={headers:n.headers,operationName:n.operationName,query:n.query,title:n.title,variables:n.variables};t?c.addTab(r):c.overwriteActive(r)}function le(){c.persist()}function ue(e,t){if(h===0)return;let n=t/h*100;E(u,oe(m-n,15,70),!0)}function de(){m=k(u),h=k(ee)?.getBoundingClientRect().height??0}function fe(e){E(u,oe(k(u)-e,15,70),!0)}function pe(e){E(p,oe(g-e,240,600),!0)}function me(){g=k(p)}function he(e){E(p,oe(k(p)-e,240,600),!0)}function ge(){if(globalThis.URL===void 0||globalThis.document===void 0)return;let e=c.exportAll(),t=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=globalThis.document.createElement(`a`);r.download=`graphiql-session-${e.exportedAt}.json`,r.href=n,r.click(),URL.revokeObjectURL(n)}function _e(e){c.active&&(c.active.headers=e)}function ve(e){E(S,oe(_+e,300,500),!0)}function ye(){_=k(S)}function be(e){E(S,oe(k(S)+e,300,500),!0)}async function xe(e){let t;try{t=await e.text()}catch(e){E(b,`Import failed: ${String(e)}`);return}let n;try{n=JSON.parse(t)}catch(e){E(b,`Import failed: invalid JSON (${String(e)})`);return}let r=bV(n);if(`error`in r){E(b,`Import failed: ${r.error}`);return}let i=c.importTabs(r,{mode:`append`}),a=[`Imported ${i.added} tab${i.added===1?``:`s`}`];i.skipped>0&&a.push(`skipped ${i.skipped}`),i.errors.length>0&&a.push(`${i.errors.length} error${i.errors.length===1?``:`s`}`),E(b,a.join(`, `),!0)}function Se(e){let t=fV(e);if(t)switch(e.preventDefault(),t.type){case`closeTab`:c.closeTab(c.activeId);break;case`format`:c.formatActive();break;case`newTab`:c.addTab();break;case`nextTab`:c.nextTab();break;case`prevTab`:c.prevTab();break;case`run`:se();break}}function Ce(e){if(y===0)return;let t=e/y*100;E(C,oe(v+t,20,80),!0)}function we(){v=k(C),y=k(d)?.getBoundingClientRect().width??0}function Te(e){E(C,oe(k(C)+e,20,80),!0)}function Ee(e){c.active&&c.updateQuery(c.active.id,e)}function De(e){c.active&&(c.active.variables=e)}var Oe=AV();Fr(`beforeunload`,dn,le),Fr(`keydown`,dn,Se);var ke=D(Oe);{let e=Wt(()=>k(ne)||!c.active),n=Wt(()=>s.schema!==null),r=Wt(()=>c.active?.operationName??null),i=Wt(()=>c.active?.operations??[]);aV(ke,{get disabled(){return k(e)},get docsAvailable(){return k(n)},get docsOpen(){return k(f)},get extras(){return t.toolbarExtras},get historyOpen(){return k(x)},onFormat:()=>c.formatActive(),onRun:se,onSelectOperation:e=>{c.active&&c.selectOperation(c.active.id,e)},onToggleDocs:()=>E(f,!k(f)),onToggleHistory:()=>E(x,!k(x)),get operationName(){return k(r)},get operations(){return k(i)},get running(){return k(ne)},get schemaLoading(){return s.loading}})}var Ae=O(ke,2);ZB(Ae,{get activeId(){return c.activeId},get extras(){return t.tabExtras},onAdd:()=>c.addTab(),onClose:e=>c.closeTab(e),onRename:(e,t)=>c.renameTab(e,t),onSelect:e=>c.selectTab(e),get tabs(){return c.tabs}});var je=O(Ae,2);let Me;var Ne=D(je),Pe=e=>{var t=DV(),n=yn(t);BB(n,{get entries(){return o.entries},get notice(){return k(b)},onClear:()=>o.clear(),onDismissNotice:()=>E(b,null),onExport:ge,onFavorite:e=>o.favorite(e),onImport:xe,onLoad:ce,onRemove:e=>o.remove(e)}),KB(O(n,2),{onDrag:ve,onDragStart:ye,onKeyAdjust:be,orientation:`horizontal`}),j(e,t)};ei(Ne,e=>{k(x)&&e(Pe)});var Fe=O(Ne,2),w=D(Fe),Ie=D(w),Le=D(Ie);{let e=Wt(()=>c.active?.query??``);kB(Le,{language:`graphql`,onChange:Ee,get schema(){return s.sdl},get theme(){return t.theme},get value(){return k(e)}})}T(Ie);var Re=O(Ie,2);KB(Re,{onDrag:ue,onDragStart:de,onKeyAdjust:fe,orientation:`vertical`});var ze=O(Re,2),Be=D(ze),Ve=D(Be);let He;var Ue=O(Ve,2);let We;T(Be);var Ge=O(Be,2),Ke=e=>{{let n=Wt(()=>c.active?.variables??`{}`);kB(e,{language:`json`,onChange:De,get theme(){return t.theme},get value(){return k(n)}})}},qe=e=>{{let n=Wt(()=>c.active?.headers??`{}`);kB(e,{language:`json`,onChange:_e,get theme(){return t.theme},get value(){return k(n)}})}};ei(Ge,e=>{k(l)===`variables`?e(Ke):e(qe,-1)}),T(ze),T(w),Ii(w,e=>E(ee,e),()=>k(ee));var Je=O(w,2),Ye=e=>{KB(e,{onDrag:Ce,onDragStart:we,onKeyAdjust:Te,orientation:`horizontal`})};ei(Je,e=>{k(re)>=1025&&e(Ye)});var Qe=O(Je,2),$e=D(Qe);{let e=Wt(()=>c.active?.streamIntervals??[]),n=Wt(()=>c.active?.timing??null),r=Wt(()=>c.active?.result??``);WB($e,{get footer(){return t.resultFooter},get streamIntervals(){return k(e)},get theme(){return t.theme},get timing(){return k(n)},get value(){return k(r)}})}T(Qe),T(Fe),Ii(Fe,e=>E(d,e),()=>k(d));var et=O(Fe,2),tt=e=>{var t=OV(),n=yn(t);KB(n,{onDrag:pe,onDragStart:me,onKeyAdjust:he,orientation:`horizontal`}),ag(O(n,2),{get schema(){return s.schema}}),j(e,t)};ei(et,e=>{k(f)&&s.schema&&e(tt)}),T(je);var nt=O(je,2),rt=e=>{var t=kV(),n=O(D(t));T(t),zn(()=>qr(n,` ${s.error??``}`)),j(e,t)};ei(nt,e=>{s.error&&e(rt)}),T(Oe),zn(()=>{Me=vi(je,1,`panes svelte-pvt4yg`,null,Me,{"docs-open":k(f)&&s.schema,"history-open":k(x)}),bi(je,`--graphiql-history-width: ${k(S)??``}px; --graphiql-docs-width: ${k(p)??``}px;`),bi(Fe,`--graphiql-left-width: ${k(C)??``}%;`),bi(w,`--graphiql-bottom-height: ${k(u)??``}%;`),He=vi(Ve,1,`switch svelte-pvt4yg`,null,He,{active:k(l)===`variables`}),We=vi(Ue,1,`switch svelte-pvt4yg`,null,We,{active:k(l)===`headers`})}),Ir(`click`,Ve,()=>E(l,`variables`)),Ir(`click`,Ue,()=>E(l,`headers`)),j(e,Oe),Ze()}Lr([`click`]);function MV(e,t){return{"Content-Type":`application/json`,...e.headers,...t.headers}}async function NV(e,t,n,r){return await(await e(t,{body:JSON.stringify(r),headers:n,method:`POST`})).json()}function PV(e){let t=new Map,n=e.fetch??globalThis.fetch;return async r=>{let i=MV(e,r),a={persistedQuery:{sha256Hash:await FV(t,r.query),version:1}};if(e.disable===!0)return await NV(n,e.url,i,{extensions:a,operationName:r.operationName,query:r.query,variables:r.variables});let o=await NV(n,e.url,i,{extensions:a,operationName:r.operationName,variables:r.variables});return IV(o)?await NV(n,e.url,i,{extensions:a,operationName:r.operationName,query:r.query,variables:r.variables}):o}}async function FV(e,t){let n=e.get(t);if(n!==void 0)return n;let r=await LV(t);return e.set(t,r),r}function IV(e){let t=e.errors;if(!Array.isArray(t))return!1;for(let e of t){if(typeof e!=`object`||!e)continue;let t=e;if(t.message===`PersistedQueryNotFound`)return!0;let n=t.extensions;if(typeof n==`object`&&n&&n.code===`PERSISTED_QUERY_NOT_FOUND`)return!0}return!1}async function LV(e){let t=await globalThis.crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e));return Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function RV(e){let t=e.fetch??globalThis.fetch;return async n=>await NV(t,e.url,MV(e,n),{operationName:n.operationName,query:n.query,variables:n.variables})}function zV(e){return typeof e==`object`&&!!e}var BV=`x-graphql-event-stream-token`;function VV(e){if(e=e,e!==`next`&&e!==`complete`)throw Error(`Invalid stream event "${e}"`);return e}function HV(e,t){if(t)try{t=JSON.parse(t)}catch{throw Error(`Invalid stream data`)}if(e===`next`&&!t)throw Error(`Stream data must be an object for "next" events`);return t||null}var UV;(function(e){e[e.NewLine=10]=`NewLine`,e[e.CarriageReturn=13]=`CarriageReturn`,e[e.Space=32]=`Space`,e[e.Colon=58]=`Colon`})(UV||={});function WV(){let e,t,n,r=!1,i={event:``,data:``},a=[],o=new TextDecoder;return function(s){if(e===void 0)e=s,t=0,n=-1;else{let t=new Uint8Array(e.length+s.length);t.set(e),t.set(s,e.length),e=t}let c=e.length,l=0;for(;t<c;){r&&=(e[t]===UV.NewLine&&(l=++t),!1);let s=-1;for(;t<c&&s===-1;++t)switch(e[t]){case UV.Colon:n===-1&&(n=t-l);break;case UV.CarriageReturn:r=!0;case UV.NewLine:s=t;break}if(s===-1)break;if(l===s){if(i.event||i.data){if(!i.event)throw Error(`Missing message event`);let e=VV(i.event),t=HV(e,i.data);a.push({event:e,data:t}),i={event:``,data:``}}}else if(n>0){let t=e.subarray(l,s),r=o.decode(t.subarray(0,n)),a=n+(t[n+1]===UV.Space?2:1),c=o.decode(t.subarray(a));switch(r){case`event`:i.event=c;break;case`data`:i.data=i.data?i.data+` +`+c:c;break}}l=t,n=-1}if(l===c){e=void 0;let t=[...a];return a=[],t}else l!==0&&(e=e.subarray(l),t-=l)}}function GV(e){let{singleConnection:t=!1,lazy:n=!0,lazyCloseTimeout:r=0,onNonLazyError:i=console.error,generateID:a=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==`x`?t:t&3|8).toString(16)})},retryAttempts:o=5,retry:s=async function(e){let t=1e3;for(let n=0;n<e;n++)t*=2;await new Promise(e=>setTimeout(e,t+Math.floor(Math.random()*2700+300)))},credentials:c=`same-origin`,referrer:l,referrerPolicy:u,onMessage:d,on:f}=e,p=e.fetchFn||fetch,m=e.abortControllerImpl||AbortController,h=(()=>{let e=!1,t=[];return{get disposed(){return e},onDispose(n){return e?(setTimeout(()=>n(),0),()=>{}):(t.push(n),()=>{t.splice(t.indexOf(n),1)})},dispose(){if(!e){e=!0;for(let e of[...t])e()}}}})(),g,_,v=0,y=null,b=0;async function x(){try{if(h.disposed)throw Error(`Client has been disposed`);return await(_??=(async()=>{var t,n;if(y){if(await s(b),g.signal.aborted)throw Error(`Connection aborted by the client`);b++}(t=f?.connecting)==null||t.call(f,!!y),g=new m;let r=h.onDispose(()=>g.abort());g.signal.addEventListener(`abort`,()=>{r(),_=void 0});let i=e,a=typeof i.url==`function`?await i.url(void 0):i.url;if(g.signal.aborted)throw Error(`Connection aborted by the client`);let o=typeof i.headers==`function`?await i.headers(void 0):i.headers??{};if(g.signal.aborted)throw Error(`Connection aborted by the client`);let v;try{v=await p(a,{signal:g.signal,method:`PUT`,credentials:c,referrer:l,referrerPolicy:u,headers:o})}catch(e){throw new KV(e)}if(v.status!==201)throw new KV(v);o[BV]=await v.text();let x=await JV({signal:g.signal,headers:o,credentials:c,referrer:l,referrerPolicy:u,url:a,fetchFn:p,onMessage:e=>{var t;(t=f?.message)==null||t.call(f,e),d?.(e)}});return(n=f?.connected)==null||n.call(f,!!y),x.waitForThrow().catch(()=>_=void 0),x})())}catch(e){throw _=void 0,e}}t&&!n&&(async()=>{for(v++;;)try{let{waitForThrow:e}=await x();await e()}catch(e){if(h.disposed)return;if(!(e instanceof KV)||(_=void 0,!o||b>=o))return i?.(e);y=e}})();function S(i,S,ee){if(!t){let t=new m,n=h.onDispose(()=>{n(),t.abort()});return(async()=>{var n,r,a,m;let h=null,g=0;for(;;)try{if(h){if(await s(g),t.signal.aborted)throw Error(`Connection aborted by the client`);g++}(n=f?.connecting)==null||n.call(f,!!h),(r=ee?.connecting)==null||r.call(ee,!!h);let o=e,_=typeof o.url==`function`?await o.url(i):o.url;if(t.signal.aborted)throw Error(`Connection aborted by the client`);let v=typeof o.headers==`function`?await o.headers(i):o.headers??{};if(t.signal.aborted)throw Error(`Connection aborted by the client`);let{getResults:y}=await JV({signal:t.signal,headers:{...v,"content-type":`application/json; charset=utf-8`},credentials:c,referrer:l,referrerPolicy:u,url:_,body:JSON.stringify(i),fetchFn:p,onMessage:e=>{var t,n;(t=f?.message)==null||t.call(f,e),(n=ee?.message)==null||n.call(ee,e),d?.(e)}});(a=f?.connected)==null||a.call(f,!!h),(m=ee?.connected)==null||m.call(ee,!!h);for await(let e of y())h=null,g=0,S.next(e);return t.abort()}catch(e){if(t.signal.aborted)return;if(!(e instanceof KV)||!o||g>=o)throw e;h=e}})().then(()=>S.complete()).catch(e=>S.error(e)),()=>t.abort()}v++;let C=new m,te=h.onDispose(()=>{te(),C.abort()});return(async()=>{let e=a();i={...i,extensions:{...i.extensions,operationId:e}};let t=null;for(;;){t=null;try{let{url:n,headers:r,getResults:a}=await x(),o;try{o=await p(n,{signal:C.signal,method:`POST`,credentials:c,referrer:l,referrerPolicy:u,headers:{...r,"content-type":`application/json; charset=utf-8`},body:JSON.stringify(i)})}catch(e){throw new KV(e)}if(o.status!==202)throw new KV(o);t=async()=>{let t;try{let i=new m,a=h.onDispose(()=>{a(),i.abort()});t=await p(n+`?operationId=`+e,{signal:i.signal,method:`DELETE`,credentials:c,referrer:l,referrerPolicy:u,headers:r})}catch(e){throw new KV(e)}if(t.status!==200)throw new KV(t)};for await(let t of a({signal:C.signal,operationId:e}))y=null,b=0,S.next(t);return t=null,C.abort()}catch(e){if(C.signal.aborted)return await t?.();if(!(e instanceof KV)||(n&&(_=void 0),!o||b>=o))throw C.abort(),e;y=e}finally{C.signal.aborted&&--v===0&&(isFinite(r)&&r>0?setTimeout(()=>{v||g.abort()},r):g.abort())}}})().then(()=>S.complete()).catch(e=>S.error(e)),()=>C.abort()}return{subscribe:S,iterate(e,t){let n=[],r={done:!1,error:null,resolve:()=>{}},i=S(e,{next(e){n.push(e),r.resolve()},error(e){r.done=!0,r.error=e,r.resolve()},complete(){r.done=!0,r.resolve()}},t),a=(async function*(){for(;;){for(n.length||await new Promise(e=>r.resolve=e);n.length;)yield n.shift();if(r.error)throw r.error;if(r.done)return}})();return a.throw=async e=>(r.done||(r.done=!0,r.error=e,r.resolve()),{done:!0,value:void 0}),a.return=async()=>(i(),{done:!0,value:void 0}),a},dispose(){h.dispose()}}}var KV=class extends Error{constructor(e){let t,n;qV(e)?(n=e,t=`Server responded with `+e.status+`: `+e.statusText):t=e instanceof Error?e.message:String(e),super(t),this.name=this.constructor.name,this.response=n}};function qV(e){return zV(e)&&typeof e.ok==`boolean`&&typeof e.status==`number`&&typeof e.statusText==`string`}async function JV(e){let{signal:t,url:n,credentials:r,headers:i,body:a,referrer:o,referrerPolicy:s,fetchFn:c,onMessage:l}=e,u={},d={},f;try{f=await c(n,{signal:t,method:a?`POST`:`GET`,credentials:r,referrer:o,referrerPolicy:s,headers:{...i,accept:`text/event-stream`},body:a})}catch(e){throw new KV(e)}if(!f.ok)throw new KV(f);if(!f.body)throw Error(`Missing response body`);let p=null,m;return(async()=>{var e;try{let t=WV();for await(let n of YV(f.body)){if(typeof n==`string`)throw p=Error(`Unexpected string chunk "${n}"`);let r;try{r=t(n)}catch(e){throw p=e}if(r)for(let t of r){try{l?.(t)}catch(e){throw p=e}let n=t.data&&`id`in t.data?t.data.id:``;switch(n in d||(d[n]=[]),t.event){case`next`:n?d[n].push(t.data.payload):d[n].push(t.data);break;case`complete`:d[n].push(`complete`);break;default:throw p=Error(`Unexpected message event "${t.event}"`)}(e=u[n])==null||e.proceed()}}if(Object.keys(u).length)throw Error(`Connection closed while having active streams`)}catch(e){p=!p&&Object.keys(u).length?new KV(e):e,m?.(p)}finally{Object.values(u).forEach(({proceed:e})=>e())}})(),{url:n,headers:i,waitForThrow:()=>new Promise((e,t)=>{if(p)return t(p);m=t}),async*getResults(e){let{signal:t,operationId:n=``}=e??{};try{for(;;){for(;d[n]?.length;){let e=d[n].shift();if(e===`complete`)return;yield e}if(p)throw p;if(t?.aborted)throw Error(`Getting results aborted by the client`);await new Promise(e=>{let r=()=>{t?.removeEventListener(`abort`,r),delete u[n],e()};t?.addEventListener(`abort`,r),u[n]={proceed:r}})}}finally{delete d[n]}}}}function YV(e){return typeof Object(e)[Symbol.asyncIterator]==`function`?(e=e,e):(async function*(){let t=e.getReader(),n;do n=await t.read(),n.value!==void 0&&(yield n.value);while(!n.done)})()}function XV(e){let t=GV({fetchFn:e.fetch,headers:e.headers,url:e.url,...e.client});return e=>({[Symbol.asyncIterator](){let n=[],r=[],i=!1,a=null,o=t.subscribe({extensions:e.headers,operationName:e.operationName??void 0,query:e.query,variables:e.variables},{complete(){i=!0,s()},error(e){a=e,i=!0,s()},next(e){n.push(e),s()}});function s(){for(;r.length>0&&(n.length>0||i);){let e=r.shift();if(!e)break;n.length>0?e({done:!1,value:n.shift()}):e({done:!0,value:void 0})}}return{next(){if(a){let e=a;return a=null,Promise.reject(e)}return n.length>0?Promise.resolve({done:!1,value:n.shift()}):i?Promise.resolve({done:!0,value:void 0}):new Promise(e=>{r.push(e)})},return(){return o(),i=!0,s(),Promise.resolve({done:!0,value:void 0})}}}})}function ZV(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e}function QV(e){return ZV(e)===`object`}function $V(e){return Array.isArray(e)&&e.length>0&&e.every(e=>`message`in e)}function eH(e,t){return e.length<124?e:t}var tH=(e=>(e[e.InternalServerError=4500]=`InternalServerError`,e[e.InternalClientError=4005]=`InternalClientError`,e[e.BadRequest=4400]=`BadRequest`,e[e.BadResponse=4004]=`BadResponse`,e[e.Unauthorized=4401]=`Unauthorized`,e[e.Forbidden=4403]=`Forbidden`,e[e.SubprotocolNotAcceptable=4406]=`SubprotocolNotAcceptable`,e[e.ConnectionInitialisationTimeout=4408]=`ConnectionInitialisationTimeout`,e[e.ConnectionAcknowledgementTimeout=4504]=`ConnectionAcknowledgementTimeout`,e[e.SubscriberAlreadyExists=4409]=`SubscriberAlreadyExists`,e[e.TooManyInitialisationRequests=4429]=`TooManyInitialisationRequests`,e))(tH||{}),nH=(e=>(e.ConnectionInit=`connection_init`,e.ConnectionAck=`connection_ack`,e.Ping=`ping`,e.Pong=`pong`,e.Subscribe=`subscribe`,e.Next=`next`,e.Error=`error`,e.Complete=`complete`,e))(nH||{});function rH(e){if(!QV(e))throw Error(`Message is expected to be an object, but got ${ZV(e)}`);if(!e.type)throw Error(`Message is missing the 'type' property`);if(typeof e.type!=`string`)throw Error(`Message is expects the 'type' property to be a string, but got ${ZV(e.type)}`);switch(e.type){case`connection_init`:case`connection_ack`:case`ping`:case`pong`:if(e.payload!=null&&!QV(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break;case`subscribe`:if(typeof e.id!=`string`)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ZV(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!QV(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${ZV(e.payload)}`);if(typeof e.payload.query!=`string`)throw Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${ZV(e.payload.query)}`);if(e.payload.variables!=null&&!QV(e.payload.variables))throw Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${ZV(e.payload.variables)}`);if(e.payload.operationName!=null&&ZV(e.payload.operationName)!==`string`)throw Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${ZV(e.payload.operationName)}`);if(e.payload.extensions!=null&&!QV(e.payload.extensions))throw Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${ZV(e.payload.extensions)}`);break;case`next`:if(typeof e.id!=`string`)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ZV(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!QV(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${ZV(e.payload)}`);break;case`error`:if(typeof e.id!=`string`)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ZV(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);if(!$V(e.payload))throw Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break;case`complete`:if(typeof e.id!=`string`)throw Error(`"${e.type}" message expects the 'id' property to be a string, but got ${ZV(e.id)}`);if(!e.id)throw Error(`"${e.type}" message requires a non-empty 'id' property`);break;default:throw Error(`Invalid message 'type' property "${e.type}"`)}return e}function iH(e,t){return rH(typeof e==`string`?JSON.parse(e,t):e)}function aH(e,t){return rH(e),JSON.stringify(e,t)}function oH(e){let{url:t,connectionParams:n,lazy:r=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:o=0,disablePong:s,connectionAckWaitTimeout:c=0,retryAttempts:l=5,retryWait:u=async function(e){let t=2**e;await new Promise(e=>setTimeout(e,t*1e3+Math.floor(Math.random()*2700+300)))},shouldRetry:d=cH,on:f,webSocketImpl:p,generateID:m=function(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==`x`?t:t&3|8).toString(16)})},jsonMessageReplacer:h,jsonMessageReviver:g}=e,_;if(p){if(!uH(p))throw Error(`Invalid WebSocket implementation provided`);_=p}else typeof WebSocket<`u`?_=WebSocket:typeof global<`u`?_=global.WebSocket||global.MozWebSocket:typeof window<`u`&&(_=window.WebSocket||window.MozWebSocket);if(!_)throw Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");let v=_,y=(()=>{let e=(()=>{let e={};return{on(t,n){return e[t]=n,()=>{delete e[t]}},emit(t){`id`in t&&e[t.id]?.(t)}}})(),t={connecting:f?.connecting?[f.connecting]:[],opened:f?.opened?[f.opened]:[],connected:f?.connected?[f.connected]:[],ping:f?.ping?[f.ping]:[],pong:f?.pong?[f.pong]:[],message:f?.message?[e.emit,f.message]:[e.emit],closed:f?.closed?[f.closed]:[],error:f?.error?[f.error]:[]};return{onMessage:e.on,on(e,n){let r=t[e];return r.push(n),()=>{r.splice(r.indexOf(n),1)}},emit(e,...n){for(let r of[...t[e]])r(...n)}}})();function b(e){let t=[y.on(`error`,n=>{t.forEach(e=>e()),e(n)}),y.on(`closed`,n=>{t.forEach(e=>e()),e(n)})]}let x,S=0,ee,C=!1,te=0,ne=!1;async function re(){clearTimeout(ee);let[e,r]=await(x??=new Promise((e,r)=>(async()=>{if(C){if(await u(te),!S)return x=void 0,r({code:1e3,reason:`All Subscriptions Gone`});te++}y.emit(`connecting`,C);let i=new v(typeof t==`function`?await t():t,`graphql-transport-ws`),a,l;function d(){isFinite(o)&&o>0&&(clearTimeout(l),l=setTimeout(()=>{i.readyState===v.OPEN&&(i.send(aH({type:nH.Ping})),y.emit(`ping`,!1,void 0))},o))}b(e=>{x=void 0,clearTimeout(a),clearTimeout(l),r(e),e instanceof sH&&(i.close(4499,`Terminated`),i.onerror=null,i.onclose=null)}),i.onerror=e=>y.emit(`error`,e),i.onclose=e=>y.emit(`closed`,e),i.onopen=async()=>{try{y.emit(`opened`,i);let e=typeof n==`function`?await n():n;if(i.readyState!==v.OPEN)return;i.send(aH(e?{type:nH.ConnectionInit,payload:e}:{type:nH.ConnectionInit},h)),isFinite(c)&&c>0&&(a=setTimeout(()=>{i.close(tH.ConnectionAcknowledgementTimeout,`Connection acknowledgement timeout`)},c)),d()}catch(e){y.emit(`error`,e),i.close(tH.InternalClientError,eH(e instanceof Error?e.message:String(e),`Internal client error`))}};let f=!1;i.onmessage=({data:t})=>{try{let n=iH(t,g);if(y.emit(`message`,n),n.type===`ping`||n.type===`pong`){y.emit(n.type,!0,n.payload),n.type===`pong`?d():s||(i.send(aH(n.payload?{type:nH.Pong,payload:n.payload}:{type:nH.Pong})),y.emit(`pong`,!1,n.payload));return}if(f)return;if(n.type!==nH.ConnectionAck)throw Error(`First message cannot be of type ${n.type}`);clearTimeout(a),f=!0,y.emit(`connected`,i,n.payload,C),C=!1,te=0,e([i,new Promise((e,t)=>b(t))])}catch(e){i.onmessage=null,y.emit(`error`,e),i.close(tH.BadResponse,eH(e instanceof Error?e.message:String(e),`Bad response`))}}})()));e.readyState===v.CLOSING&&await r;let i=()=>{},l=new Promise(e=>i=e);return[e,i,Promise.race([l.then(()=>{if(!S){let t=()=>e.close(1e3,`Normal Closure`);isFinite(a)&&a>0?ee=setTimeout(()=>{e.readyState===v.OPEN&&t()},a):t()}}),r])]}function ie(e){if(cH(e)&&(lH(e.code)||[tH.InternalServerError,tH.InternalClientError,tH.BadRequest,tH.BadResponse,tH.Unauthorized,tH.SubprotocolNotAcceptable,tH.SubscriberAlreadyExists,tH.TooManyInitialisationRequests].includes(e.code)))throw e;if(ne)return!1;if(cH(e)&&e.code===1e3)return S>0;if(!l||te>=l||!d(e))throw e;return C=!0}r||(async()=>{for(S++;;)try{let[,,e]=await re();await e}catch(e){try{if(!ie(e))return}catch(e){return i?.(e)}}})();function ae(e,t){let n=m(e),r=!1,i=!1,a=()=>{S--,r=!0};return(async()=>{for(S++;;)try{let[o,s,c]=await re();if(r)return s();let l=y.onMessage(n,e=>{switch(e.type){case nH.Next:t.next(e.payload);return;case nH.Error:i=!0,r=!0,t.error(e.payload),a();return;case nH.Complete:r=!0,a();return}});o.send(aH({id:n,type:nH.Subscribe,payload:e},h)),a=()=>{!r&&o.readyState===v.OPEN&&o.send(aH({id:n,type:nH.Complete},h)),S--,r=!0,s()},await c.finally(l);return}catch(e){if(!ie(e))return}})().then(()=>{i||t.complete()}).catch(e=>{t.error(e)}),()=>{r||a()}}return{on:y.on,subscribe:ae,iterate(e){let t=[],n={done:!1,error:null,resolve:()=>{}},r=ae(e,{next(e){t.push(e),n.resolve()},error(e){n.done=!0,n.error=e,n.resolve()},complete(){n.done=!0,n.resolve()}}),i=async function*(){for(;;){for(t.length||await new Promise(e=>n.resolve=e);t.length;)yield t.shift();if(n.error)throw n.error;if(n.done)return}}();return i.throw=async e=>(n.done||(n.done=!0,n.error=e,n.resolve()),{done:!0,value:void 0}),i.return=async()=>(r(),{done:!0,value:void 0}),i},async dispose(){if(ne=!0,x){let[e]=await x;e.close(1e3,`Normal Closure`)}},terminate(){x&&y.emit(`closed`,new sH)}}}var sH=class extends Error{name=`TerminatedCloseEvent`;message=`4499: Terminated`;code=4499;reason=`Terminated`;wasClean=!1};function cH(e){return QV(e)&&`code`in e&&`reason`in e}function lH(e){return[1e3,1001,1006,1005,1012,1013,1014].includes(e)?!1:e>=1e3&&e<=1999}function uH(e){return typeof e==`function`&&`constructor`in e&&`CLOSED`in e&&`CLOSING`in e&&`CONNECTING`in e&&`OPEN`in e}function dH(e){let t=oH({connectionParams:e.headers,url:e.url,...e.client});return e=>({[Symbol.asyncIterator](){let n=[],r=[],i=!1,a=null,o=t.subscribe({extensions:e.headers,operationName:e.operationName??void 0,query:e.query,variables:e.variables},{complete(){i=!0,s()},error(e){a=e,i=!0,s()},next(e){n.push(e),s()}});function s(){for(;r.length>0&&(n.length>0||i);){let e=r.shift();if(!e)break;n.length>0?e({done:!1,value:n.shift()}):e({done:!0,value:void 0})}}return{next(){if(a){let e=a;return a=null,Promise.reject(e)}return n.length>0?Promise.resolve({done:!1,value:n.shift()}):i?Promise.resolve({done:!0,value:void 0}):new Promise(e=>{r.push(e)})},return(){return o(),i=!0,s(),Promise.resolve({done:!0,value:void 0})}}}})}function fH(e,t){return Jr(jV,{props:t,target:e})}function pH(e){Qr(e)}return e.createApqFetcher=PV,e.createHttpFetcher=RV,e.createSseFetcher=XV,e.createWsFetcher=dH,e.lightTheme=Jk,e.mount=fH,e.unmount=pH,e})({}); +//# sourceMappingURL=standalone.js.map
\ No newline at end of file diff --git a/source/graphiql/version.ts b/source/graphiql/version.ts new file mode 100644 index 0000000..16d9c04 --- /dev/null +++ b/source/graphiql/version.ts @@ -0,0 +1 @@ +export const GRAPHIQL_VERSION = "0.4.2"; diff --git a/source/http.ts b/source/http.ts index c4a70c8..39d6866 100755 --- a/source/http.ts +++ b/source/http.ts @@ -54,6 +54,14 @@ export function GraphQLHTTP< ...options }: GQLOptions<Ctx, Req>): GraphQLHandler<Req> { return async (request: Req) => { + if (options.graphiql) { + const { serveAsset } = await import("./graphiql/assets.ts"); + const asset = serveAsset(request); + + if (asset) + return asset; + } + if (options.subscriptions && request.headers.get("upgrade")?.toLowerCase() === "websocket") return options.subscriptions(request as unknown as Request); @@ -91,7 +99,7 @@ export function GraphQLHTTP< const playground = renderPlaygroundPage({ ...playgroundOptions, - endpoint: "/graphql" + endpoint: new URL(request.url).pathname }); return new Response(playground, { diff --git a/source/import.ts b/source/import.ts index f934ef8..bb6c7b9 100644 --- a/source/import.ts +++ b/source/import.ts @@ -3,7 +3,7 @@ /*** IMPORT ------------------------------------------- ***/ -import { dirname, resolve } from "@std/path"; +import { dirname, resolve } from "@ende/path"; /*** UTILITY ------------------------------------------ ***/ diff --git a/source/utility/pubsub.ts b/source/utility/pubsub.ts new file mode 100644 index 0000000..bb8679a --- /dev/null +++ b/source/utility/pubsub.ts @@ -0,0 +1,64 @@ +export class PubSub { + #target = new EventTarget(); + + publish(trigger: string, payload: unknown): Promise<void> { + this.#target.dispatchEvent(new CustomEvent(trigger, { detail: payload })); + return Promise.resolve(); + } + + asyncIterator<T>(triggers: string | string[]): AsyncIterableIterator<T> { + const names = Array.isArray(triggers) ? triggers : [triggers]; + const pulls: Array<(result: IteratorResult<T>) => void> = []; + const pushes: T[] = []; + let done = false; + + const listener = (event: Event) => { + const value = (event as CustomEvent<T>).detail; + const pull = pulls.shift(); + + if (pull) + pull({ done: false, value }); + else + pushes.push(value); + }; + + for (const name of names) + this.#target.addEventListener(name, listener); + + const close = (): Promise<IteratorResult<T>> => { + if (!done) { + done = true; + + for (const name of names) + this.#target.removeEventListener(name, listener); + + for (const pull of pulls.splice(0)) + pull({ done: true, value: undefined }); + + pushes.length = 0; + } + + return Promise.resolve({ done: true, value: undefined }); + }; + + return { + next: () => { + if (done) + return Promise.resolve({ done: true, value: undefined }); + + if (pushes.length > 0) + return Promise.resolve({ done: false, value: pushes.shift() as T }); + + return new Promise((resolve) => pulls.push(resolve)); + }, + return: close, + throw: (error: unknown) => { + close(); + return Promise.reject(error); + }, + [Symbol.asyncIterator]() { + return this; + } + }; + } +} diff --git a/source/utility/types.ts b/source/utility/types.ts index 2311c25..771625b 100755 --- a/source/utility/types.ts +++ b/source/utility/types.ts @@ -3,7 +3,7 @@ /*** IMPORT ------------------------------------------- ***/ -import type { GraphQLArgs, GraphQLSchema } from "graphql"; +import type { GraphQLArgs, GraphQLSchema } from "#deps"; /*** UTILITY ------------------------------------------ ***/ diff --git a/source/ws.ts b/source/ws.ts index cbf70ea..e623dc9 100644 --- a/source/ws.ts +++ b/source/ws.ts @@ -3,11 +3,11 @@ /*** IMPORT ------------------------------------------- ***/ -import { makeServer, type ServerOptions } from "graphql-ws"; +import { makeServer, type ServerOptions } from "#deps"; /*** UTILITY ------------------------------------------ ***/ -import type { GraphQLSchema } from "graphql"; +import type { GraphQLSchema } from "#deps"; /*** EXPORT ------------------------------------------- ***/ |